コード例 #1
0
 static function setUserLoginOut()
 {
     myCookie('s_auth', null);
     myCookie('s_saltkey', null);
     $_COOKIE['s_auth'] = null;
     $_COOKIE['s_saltkey'] = null;
     self::$adminInfo = array('id' => 0, 'aid' => 0, 'username' => '', 'isHome' => 0, 'groupid' => 0);
     return true;
 }
コード例 #2
0
 public function setUserLogin($userInfo = array(), $remember = 0, $saveLogin = true)
 {
     if ($saveLogin) {
         $this->update("logincount=logincount+1,loginip='" . ip2long(getUserIp()) . "',logintime='" . TIME . "'", array('id' => $userInfo['id']));
     }
     $saltkey = getRandStr(8);
     $auth = setEnocde($userInfo['id'] . "\t" . $userInfo['psw'], admin::getAuthKey($saltkey));
     myCookie('s_saltkey', $saltkey, $remember);
     myCookie('s_auth', $auth, $remember);
     return true;
 }
コード例 #3
0
 public function setUserLogin($userInfo = array(), $remember = 0, $saveLogin = true, $loginFrom = 'wx')
 {
     $saltkey = getRandInt(8);
     $auth = setEnocde($userInfo['uid'] . "\t" . $userInfo['aid'] . "\t" . $loginFrom, user::getAuthKey($saltkey));
     myCookie('saltkey', $saltkey, $remember);
     myCookie('auth', $auth, $remember);
     //修改登录数据
     if ($saveLogin) {
         $this->update(array('last_login_ip' => ip2long(getUserIp()), 'last_login_time' => TIME), array('uid' => $userInfo['uid']));
     }
     return true;
 }
コード例 #4
0
 static function setUserLoginOut()
 {
     myCookie('auth', null);
     myCookie('saltkey', null);
     $_COOKIE['auth'] = null;
     $_COOKIE['saltkey'] = null;
     self::$userInfo = array('uid' => 0, 'aid' => 0);
     return true;
 }