Example #1
0
 /**
  * Get currently logged in user.
  */
 public function user()
 {
     if ($this->check()) {
         return $this->userRepository->findByUser($_SESSION['user']);
     }
     throw new Exception('Not logged in but called Auth::user() anyway');
 }
Example #2
0
 /**
  * Is currently logged in user admin?
  */
 public function isAdmin()
 {
     if ($this->check()) {
         return $this->userRepository->getIsAdmin($_SESSION['user']) == 1;
         # return $_COOKIE['isadmin'] === 'yes';
     }
     throw new Exception('Not logged in but called Auth::isAdmin() anyway');
 }
Example #3
0
 public function hasPaid()
 {
     $test = $this->userRepository->checkBankCard($_SESSION['user']);
     if ($test) {
         return true;
     } else {
         return false;
     }
 }