diff --git a/classes/User.class.php b/classes/User.class.php index 07d2a43..4f7d32e 100644 --- a/classes/User.class.php +++ b/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); + } } ?> \ No newline at end of file