/** * 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'); }
/** * 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'); }
public function hasPaid() { $test = $this->userRepository->checkBankCard($_SESSION['user']); if ($test) { return true; } else { return false; } }