예제 #1
0
파일: login.php 프로젝트: gudwin/extasy
 /**
  * @return UserAccount
  */
 public static function getCurrentSession()
 {
     if (!empty(self::$currentUser)) {
         return self::$currentUser;
     } elseif (!empty(self::$session)) {
         try {
             self::$currentUser = UserAccount::getById(self::$session['id']);
         } catch (\NotFoundException $e) {
             self::unsetSession();
             throw $e;
         }
         return self::$currentUser;
     }
     return null;
 }