diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index cc8d7c70..9e69b01d 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -69,7 +69,6 @@ class User { ); return $this->updateSingle($id, $field); } - public function setUserToken($id) { $field = array( 'name' => 'token', @@ -78,6 +77,10 @@ class User { ); return $this->updateSingle($id, $field); } + private function setUserIp($id, $ip) { + $field = array( 'name' => 'loggedIp', 'type' => 's', 'value' => $ip ); + return $this->updateSingle($id, $field); + } /** * Fetch all users for administrative tasks @@ -106,6 +109,7 @@ class User { } if ( $this->checkUserPassword($username, $password)) { $this->createSession($username); + $this->setUserIp($this->getUserId($username), $_SERVER['REMOTE_ADDR']); return true; } $this->setErrorMessage("Invalid username or password");