Browse Source

additional hash for ipb auth, #18

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@74 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
master
pzinovkin 16 years ago
parent
commit
7ee3a6edd1
  1. 22
      classes/User.class.php

22
classes/User.class.php

@ -42,9 +42,10 @@ class User
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()) {
session_destroy();
}
@ -62,8 +63,10 @@ class User
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();
@ -89,6 +92,15 @@ class User
{
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()
{

Loading…
Cancel
Save