From 8019ffe457f035a830336d5a4e5faaf9fcd2b3af Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 28 Oct 2008 17:40:14 +0000 Subject: Fixed wierd bug in login system. --- forum/utils/login.php | 2 +- forum/utils/users.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'forum') diff --git a/forum/utils/login.php b/forum/utils/login.php index 50d0da2..87f76a9 100644 --- a/forum/utils/login.php +++ b/forum/utils/login.php @@ -31,7 +31,7 @@ function checklogin() $current_uid = $users->getUserID($current_username); $u = $users->getUser($current_uid); - if($u && $u->checkPassword($current_password) ) { + if($current_uid != -1 && $u && $u->checkPassword($current_password) ) { $current_user = $u; setcookie("current_uid", $current_uid, time()+$ADMIN_TIMEOUT); setcookie("current_password", $current_password, time()+$ADMIN_TIMEOUT); diff --git a/forum/utils/users.php b/forum/utils/users.php index 7f54eee..ee04b92 100644 --- a/forum/utils/users.php +++ b/forum/utils/users.php @@ -97,7 +97,7 @@ class Users { foreach($this->users as $user) { if($user->username == $username) return $user->uid; } - return false; + return -1; } public function getUser($uid) @@ -143,4 +143,4 @@ class Users { } } -?> \ No newline at end of file +?> -- cgit v1.2.3