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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user