示例#1
0
 public function getQuery()
 {
     if ($this->_query) {
         return $this->_query;
     }
     $this->_query = $this->filter_params(parent::getQuery());
     return $this->_query;
 }
示例#2
0
 /**
  * 获取用户信息
  *
  */
 public function _initUserInfo()
 {
     $userModel = new UserModel();
     $httpRequest = new Yaf\Request\Http();
     // 获取cookies
     $email = $httpRequest->getCookie('email');
     $password = $httpRequest->getCookie('password');
     $userInfo = array();
     if ($email) {
         // 查询用户信息
         $userInfoQuery = $userModel->getUserByEmail($email);
         if ($userInfoQuery['password'] == $password) {
             $userInfo = $userInfoQuery;
         } else {
             // 清除 Cookies
             Local\Header\Cookies::clearCookie('email');
             Local\Header\Cookies::clearCookie('password');
         }
         unset($userInfoQuery);
     }
     Yaf\Registry::set('userInfo', $userInfo);
     unset($userInfo);
 }