new method for authorization users
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@18 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -20,7 +20,7 @@ class User
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!preg_match("/^[a-z0-9_-]{3,20}$/i", $login)) {
|
if(!preg_match("/^[a-z0-9_-]{3,50}$/i", $login)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,10 +28,14 @@ class User
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self::$user->pass != $password) {
|
if (stripslashes(self::$user->pass) != $password) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!self::isActive(self::$user->id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
self::setSession();
|
self::setSession();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -97,5 +101,10 @@ class User
|
|||||||
{
|
{
|
||||||
return Load::model('UserData')->getByLogin($login);
|
return Load::model('UserData')->getByLogin($login);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function isActive($user_id)
|
||||||
|
{
|
||||||
|
return Load::model('UserActivate')->isActive($user_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user