diff --git a/public/include/classes/base.class.php b/public/include/classes/base.class.php index 9d6bdf48..a2f8c7e1 100644 --- a/public/include/classes/base.class.php +++ b/public/include/classes/base.class.php @@ -238,7 +238,7 @@ class Base { if ($this->checkStmt($stmt) && $stmt->bind_param($field['type'].'i', $field['value'], $id) && $stmt->execute()) return true; $this->debug->append("Unable to update " . $field['name'] . " with " . $field['value'] . " for ID $id"); - $this->sqlError(); + return $this->sqlError(); } /** diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 27608ae5..f335f75f 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -128,6 +128,7 @@ class User extends Base { return false; } if ($this->checkUserPassword($username, $password)) { + $this->updateLoginTimestamp($this->getUserId($username)); $this->createSession($username); if ($this->setUserIp($this->getUserId($username), $_SERVER['REMOTE_ADDR'])) return true; @@ -407,6 +408,16 @@ class User extends Base { $_SESSION['USERDATA'] = $this->user; } + /** + * Update users last_login timestamp + * @param id int UserID + * @return bool true of false + **/ + private function updateLoginTimestamp($id) { + $field = array('name' => 'last_login', 'type' => 'i', 'value' => time()); + return $this->updateSingle($id, $field); + } + /** * Log out current user, destroy the session * @param none diff --git a/public/include/version.inc.php b/public/include/version.inc.php index e3f284f6..77d41b4d 100644 --- a/public/include/version.inc.php +++ b/public/include/version.inc.php @@ -1,6 +1,6 @@