Browse Source

new method for authorization users

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@18 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
master
ejikharev 16 years ago
parent
commit
e3f004da7f
  1. 13
      classes/User.class.php

13
classes/User.class.php

@ -20,7 +20,7 @@ class User
return false;
}
if(!preg_match("/^[a-z0-9_-]{3,20}$/i", $login)) {
if(!preg_match("/^[a-z0-9_-]{3,50}$/i", $login)) {
return false;
}
@ -28,10 +28,14 @@ class User
return false;
}
if (self::$user->pass != $password) {
if (stripslashes(self::$user->pass) != $password) {
return false;
}
if (!self::isActive(self::$user->id)) {
return false;
}
self::setSession();
return true;
}
@ -97,5 +101,10 @@ class User
{
return Load::model('UserData')->getByLogin($login);
}
static function isActive($user_id)
{
return Load::model('UserActivate')->isActive($user_id);
}
}
?>
Loading…
Cancel
Save