From 017d1c2cc978527f29172a9b0d7a36246382ef0f Mon Sep 17 00:00:00 2001 From: ejikharev Date: Wed, 3 Dec 2008 15:21:43 +0000 Subject: [PATCH] add login check by regular expression git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@12 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- User.class.php | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/User.class.php b/User.class.php index 4e595d2..07d2a43 100644 --- a/User.class.php +++ b/User.class.php @@ -1,14 +1,14 @@ password != md5($password)) { + if (self::$user->pass != $password) { return false; } @@ -54,7 +58,7 @@ 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); + Env::setCookie('login_hash', self::getHash(), TIME_NOW + LOGIN_COOKIE_TTL); session_start(); @@ -76,9 +80,9 @@ class User static function getHash() { - return md5(self::$user->id.'hckrz'.self::$user->login.'mst'.self::$user->password.'dai'); + return md5(self::$user->id.'hckrz'.self::$user->login.'mst'.self::$user->pass.'dai'); } - + static function getInfo() { return Env::Session('user', self::$user); @@ -91,7 +95,7 @@ class User static function getByLogin($login) { - return Load::model('UserData')->getByLogin($login); + return Load::model('UserData')->getByLogin($login); } } ?> \ No newline at end of file