From 1194c7fb33929b21501be818b2def0ea34b1ee95 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sun, 12 May 2013 12:18:56 +0200 Subject: [PATCH] fixed user class, missing method --- public/include/classes/user.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 63b02cdb..f417fc8c 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -26,6 +26,10 @@ class User { return $this->sError; } + public function getUserName($userID) { + return $this->getSingle($userID, 'id', 'username', $this->table); + } + public function checkLogin($username, $password) { $this->debug->append("Checking login for $username with password $password", 2); if ( $this->checkUserPassword($username, $password) ) { @@ -199,8 +203,8 @@ class User { $apikey = hash("sha256",$username.$salt); $stmt = $this->mysqli->prepare(" INSERT INTO $this->table (username, pass, email, pin, api_key) - VALUES (?, ?, ?, ?, ?) - "); + VALUES (?, ?, ?, ?, ?) + "); if ($this->checkStmt($stmt)) { $stmt->bind_param('sssss', $username, hash("sha256", $password1.$this->salt), $email1, hash("sha256", $pin.$this->salt), $apikey); if (!$stmt->execute()) {