Ejemplo n.º 1
0
 public function canView()
 {
     $loggedIn = Account_AccountAPI::getLoggedIn();
     if ($loggedIn === false) {
         /* if we're not logged in and the page isn't assecible to anyone */
         if ($this->privelage !== 'NONE') {
             Lunor::$base->router->throwError('needlogin');
             return false;
         }
     } else {
         /* if we are logged in and the page is only accessible to admins */
         if ($this->privelage === 'ADMIN' && !Account_AccountAPI::isAdmin()) {
             Lunor::$base->router->throwError('adminarea');
             return false;
         }
     }
     return true;
 }