diff options
Diffstat (limited to 'src/lib/Login.class.php')
-rw-r--r-- | src/lib/Login.class.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/Login.class.php b/src/lib/Login.class.php index 870774a..bb21928 100644 --- a/src/lib/Login.class.php +++ b/src/lib/Login.class.php @@ -1,4 +1,6 @@ <?php +require_once('Database.class.php'); +require_once('Hasher.class.php'); class Login { /** Decalare an empty __construct() so that the login function doesn't @@ -6,9 +8,8 @@ class Login { public function __construct() {} public static function login($username, $password) { - global $mm; - $db = $mm->database(); - $hasher = $mm->hasher(); + $db = Database::getInstance(); + $hasher = Hasher::getInstance(); $uid = $db->getUID($username); if ($uid!==false && $db->getStatus($uid)>=3) @@ -18,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; |