Ejemplo n.º 1
0
 /**
  * 获得登录用户
  */
 public function get_login()
 {
     $authinfo = trim(get_cookie($this->cookie_key));
     if (!$authinfo) {
         return FALSE;
     }
     $authinfo = explode("\t", authcode($authinfo, 'DECODE'));
     if (count($authinfo) != 3) {
         $this->logout_user();
         return FALSE;
     }
     list($user_id, $user_password, $dateline) = $authinfo;
     $user = $this->get_user($user_id, USER_GET_BY_UID);
     if (!is_array($user) or $user['banned'] or $user_password != $user['password']) {
         $this->logout_user();
         return FALSE;
     }
     self::$user = $user;
     return TRUE;
 }