|
@ -42,9 +42,10 @@ class User |
|
|
|
|
|
|
|
|
static function logout() |
|
|
static function logout() |
|
|
{ |
|
|
{ |
|
|
Env::setCookie(session_name(), '', 0); |
|
|
|
|
|
Env::setCookie('login', '', 0); |
|
|
|
|
|
Env::setCookie('login_hash', '', 0); |
|
|
|
|
|
|
|
|
Env::setCookie(session_name(), '', 0); |
|
|
|
|
|
Env::setCookie('login', '', 0); |
|
|
|
|
|
Env::setCookie('login_hash', '', 0); |
|
|
|
|
|
Env::setCookie('login_ipbhash', '', 0); |
|
|
if (session_id()) { |
|
|
if (session_id()) { |
|
|
session_destroy(); |
|
|
session_destroy(); |
|
|
} |
|
|
} |
|
@ -62,8 +63,10 @@ class User |
|
|
|
|
|
|
|
|
static function setSession() |
|
|
static function setSession() |
|
|
{ |
|
|
{ |
|
|
Env::setCookie('login', self::$user->login, TIME_NOW + LOGIN_COOKIE_TTL); |
|
|
|
|
|
Env::setCookie('login_hash', self::getHash(), TIME_NOW + LOGIN_COOKIE_TTL); |
|
|
|
|
|
|
|
|
$hash = self::getHash(); |
|
|
|
|
|
Env::setCookie('login', self::$user->login, TIME_NOW + LOGIN_COOKIE_TTL); |
|
|
|
|
|
Env::setCookie('login_hash', $hash, TIME_NOW + LOGIN_COOKIE_TTL); |
|
|
|
|
|
Env::setCookie('login_ipbhash', self::getIPBHash($hash), TIME_NOW + LOGIN_COOKIE_TTL); |
|
|
|
|
|
|
|
|
@session_start(); |
|
|
@session_start(); |
|
|
|
|
|
|
|
@ -89,6 +92,15 @@ class User |
|
|
{ |
|
|
{ |
|
|
return md5(self::$user->id.'hckrz'.self::$user->login.'mst'.self::$user->pass.'dai'); |
|
|
return md5(self::$user->id.'hckrz'.self::$user->login.'mst'.self::$user->pass.'dai'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Создает хеш для проверки хеша в в IPB |
|
|
|
|
|
* |
|
|
|
|
|
*/ |
|
|
|
|
|
static public function getIPBHash($hash) |
|
|
|
|
|
{ |
|
|
|
|
|
return md5($hash . strtolower(self::$user->login) . 'brainfuck'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static function getInfo() |
|
|
static function getInfo() |
|
|
{ |
|
|
{ |
|
|