From 29a3ffb99435827d5a7ea6886ac22bd2ee18d593 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 27 Oct 2011 19:44:10 -0400 Subject: I think this fixes everything, but it now depends on PHP 5.3+ The introduction of the dependency on PHP 5.3 is that lib/Singleton.class uses `get_called_class()' --- src/lib/Database.class.php | 4 ++-- src/lib/Login.class.php | 2 +- src/lib/Model.class.php | 2 +- src/lib/Singleton.class.php | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Database.class.php b/src/lib/Database.class.php index 1e98511..a76d891 100644 --- a/src/lib/Database.class.php +++ b/src/lib/Database.class.php @@ -122,7 +122,7 @@ class Database extends Singleton { $table = $this->mysql_table('auth'); $hasher = Hasher::getInstance(); - @$hash = $hasher->hashPassword($password); + @$hash = $hasher->hash($password); $query = "UPDATE $table \n". "SET hash='$hash' \n". @@ -139,7 +139,7 @@ class Database extends Singleton { $table = $this->mysql_table('auth'); $user = $this->mysql_escape($username); $hasher = Hasher::getInstance(); - @$hash = $hasher->hashPassword($password); + @$hash = $hasher->hash($password); $status = 0; $query = "INSERT INTO $table ( name, hash , status) \n". diff --git a/src/lib/Login.class.php b/src/lib/Login.class.php index a470176..bb21928 100644 --- a/src/lib/Login.class.php +++ b/src/lib/Login.class.php @@ -19,7 +19,7 @@ class Login { return 2; } $hash = $db->getPasswordHash($uid); - if ($hasher->CheckPassword($password, $hash)) { + if ($hasher->check($password, $hash)) { // success $_SESSION['uid'] = $uid; return 0; diff --git a/src/lib/Model.class.php b/src/lib/Model.class.php index 14f59d4..0cce525 100644 --- a/src/lib/Model.class.php +++ b/src/lib/Model.class.php @@ -4,6 +4,6 @@ require_once('Database.class.php'); abstract class Model { protected $db; public function __construct() { - $db = Database::getInstance(); + $this->db = Database::getInstance(); } } diff --git a/src/lib/Singleton.class.php b/src/lib/Singleton.class.php index 4eb3bb3..2f8c74f 100644 --- a/src/lib/Singleton.class.php +++ b/src/lib/Singleton.class.php @@ -1,12 +1,12 @@