parent
785c04441c
commit
6a5f938895
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user