Example #1
0
 public static function isUserAuthentic()
 {
     $authentic = Auth::instance();
     if ($authentic->logged_in()) {
         if ((self::$user = User::getAuthenticUser()) && ($account_id = self::getAuthenticAttr('account_id'))) {
             self::$user['Account'] = Doctrine::getTable('Account')->find($account_id, Doctrine::HYDRATE_ARRAY);
             if (self::getAttr('account_id') != $account_id) {
                 self::masqueradeAccount(self::getAttr('account_id'));
             }
             return TRUE;
         }
         $authentic->logout(TRUE);
     }
     self::$user = array();
     self::restoreUser();
     return FALSE;
 }