Ejemplo n.º 1
0
 public static function getUser()
 {
     $uid = Utils\Cookie::get('uid');
     $key = Utils\Cookie::get('key');
     if ($uid == null) {
         $user = new User();
         $user->isLogin = false;
         return $user;
     }
     $user = User::find($uid);
     if ($user == null) {
         $user->isLogin = false;
         return $user;
     }
     if (Hash::cookieHash($user->pass) != $key) {
         $user->isLogin = false;
         return $user;
     }
     $user->isLogin = true;
     return $user;
 }
Ejemplo n.º 2
0
 public function testCookieHash()
 {
     $str = Tools::genRandomChar();
     Hash::cookieHash($str);
 }