Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
From 8f958e82fe1895b502203df91599bc47cd638635 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 27 Apr 2010 00:55:04 -0400 Subject: [PATCH] Use the User model in AuthenticationLocal. --- includes/auth/auth_local.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/includes/auth/auth_local.php b/includes/auth/auth_local.php index 6b4c26b..4a70297 100644 --- a/includes/auth/auth_local.php +++ b/includes/auth/auth_local.php @@ -15,6 +15,7 @@ // this program. If not, see . require_once BUGDAR_ROOT . '/includes/auth/auth.php'; +require_once BUGDAR_ROOT . '/includes/model_user.php'; require_once BUGDAR_ROOT . '/events/user_login.php'; // AuthenticationLocal uses the default Bugdar 2 user database. It should be @@ -26,15 +27,15 @@ class AuthenticationLocal extends Authentication if ($this->current_user()) return $this->current_user(); - $stmt = Bugdar::$db->Prepare(" - SELECT * FROM " . TABLE_PREFIX . "users - WHERE user_id = ? AND authkey = ? - "); - if (!$stmt->Execute(array($_COOKIE['bugdar_user'], $_COOKIE['bugdar_pass']))) + $user = new User($_COOKIE['bugdar_user']); + try { + $user->FetchInto(); + } + catch (phalanx\data\ModelException $e) { return FALSE; + } - $user = $stmt->FetchObject(); - if (!$user) + if ($user->authkey != $_COOKIE['bugdar_pass']) return FALSE; $this->current_user = $user; -- 1.7.11.3