diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-09-05 18:58:43 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-09-05 18:58:43 -0400 |
commit | 70557422c2d999b85fd7ba45718da357f022fcfd (patch) | |
tree | c3824157a49d46252d6c969a525d9b885c6f5440 | |
parent | c81e480daaa233c35fec262e9907d35179db5e86 (diff) |
Fix 3 bugs (stray * in SQL, typo in variable name, a place where isLoggedIn() was still being called on the DB
-rw-r--r-- | src/controllers/Users.class.php | 2 | ||||
-rw-r--r-- | src/lib/Database.class.php | 6 | ||||
-rw-r--r-- | src/models/Auth.class.php | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/controllers/Users.class.php b/src/controllers/Users.class.php index 4a8f04c..dc89603 100644 --- a/src/controllers/Users.class.php +++ b/src/controllers/Users.class.php @@ -148,7 +148,7 @@ class Users extends Controller { $this->new_user($routed, $vars); } else { $username = $vars['username']; - $passowrd = $vars['password1']; + $password = $vars['password1']; $uid = $db->addUser($username, $password); if ($uid===false) { $this->showView('users/500'); diff --git a/src/lib/Database.class.php b/src/lib/Database.class.php index 07df993..a7c8b4b 100644 --- a/src/lib/Database.class.php +++ b/src/lib/Database.class.php @@ -164,9 +164,9 @@ class Database { $table = $this->mysql_table('auth'); $s = $this->mysql_escape($status); $query = - "UPDATE $table * \n". - "SET status=$s \n". - "WHERE uid=$uid ;"; + "UPDATE $table \n". + "SET status=$s \n". + "WHERE uid=$uid ;"; $q = $this->mysql_query($query); return ($q?true:false); } diff --git a/src/models/Auth.class.php b/src/models/Auth.class.php index 3aba0f3..f2c9120 100644 --- a/src/models/Auth.class.php +++ b/src/models/Auth.class.php @@ -46,11 +46,10 @@ class Auth { return $type; } protected function setType($type) { - $logged_in_uid = $this->db->isLoggedIn(); + $logged_in_uid = Login::isLoggedIn(); $logged_in_obj = Auth::getObj($logged_in_uid); - $is_admin = $logged_in_obj->isAdmin(); + $is_admin = $logged_in_obj->isAdmin(); if (!$is_admin) return false; - return $this->db->setStatus($this->uid, $type); } public function isUser() { |