Added proper session handling while in development mode
This commit is contained in:
		| @@ -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; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  * BOOTSTRAPPING SCRIPT | ||||
|  */ | ||||
|  | ||||
| session_start(); | ||||
|  | ||||
| // Get the Slim framework settings | ||||
| $settings = require __DIR__ . '/settings.php'; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user