1
0

Added proper session handling while in development mode

This commit is contained in:
2017-03-26 15:28:33 +02:00
parent 55b8b75c0e
commit 45db7e7b93
4 changed files with 19 additions and 6 deletions

View File

@ -33,17 +33,22 @@ class Authorization
$klantnr = $rekeningen[$id]['klantid'];
$klant = $db->klanten->where('id', $klantnr)[$klantnr];
if ($klant['code'] === $passcode) {
$_SESSION['user'] = $klant;
if ($klant['code'] === $passcode) {
$_SESSION['userid'] = $klant['id'];
return true;
}
return false;
}
public function getUser()
public function getUserID()
{
return $_SESSION['user'];
return $_SESSION['userid'];
}
public function isUserAuthenticated()
{
return $this->getUserID() !== null;
}
}

View File

@ -16,6 +16,8 @@
* BOOTSTRAPPING SCRIPT
*/
session_start();
// Get the Slim framework settings
$settings = require __DIR__ . '/settings.php';