Пример #1
0
 /**
  * 判断用户是否登录
  * 
  * @return boolean|UserForm
  */
 public function isLogin()
 {
     /* @var $user UserForm */
     $user = WindCookie::get($this->cookieName);
     if (!$user) {
         return false;
     }
     $stmt = $this->_getConnecion()->createStatement('SELECT * FROM user WHERE username=:username');
     if (!$stmt->getValue(array('username' => $user->getUsername()))) {
         return false;
     }
     return $user;
 }
Пример #2
0
	/**
	 * 取得指定名称的cookie值
	 *
	 * @param string $name cookie名称
	 * @param string $pre cookie前缀,默认为null即没有前缀
	 * @return boolean
	 */
	public static function getCookie($name) {
		$pre = Wekit::C('site', 'cookie.pre');
		$pre && $name = $pre . '_' . $name;
		return WindCookie::get($name);
	}
Пример #3
0
 /**
  * 获取cookie值
  *
  * @param string $name
  * @return void
  */
 public function get($name)
 {
     $this->prefix && ($name = $this->prefix . $name);
     return WindCookie::get($name, $this->encode);
 }
Пример #4
0
 public function getToken($tokenName)
 {
     return WindCookie::get($tokenName);
 }