Bug correction with recent load method refactor
This commit is contained in:
parent
73b772aa61
commit
17871b984c
1
TODO
1
TODO
@ -14,6 +14,7 @@ Manage paybacks :
|
||||
TODO :
|
||||
======
|
||||
* Add / Edit a bill
|
||||
* Bug in connection form
|
||||
|
||||
Tests :
|
||||
=======
|
||||
|
@ -135,7 +135,7 @@ class Storage {
|
||||
}
|
||||
|
||||
if($first_only)
|
||||
return $return[0];
|
||||
return $return[$result['id']];
|
||||
else
|
||||
return $return;
|
||||
}
|
||||
|
@ -70,14 +70,10 @@ class User extends Storage {
|
||||
// Check if a user exists by login and load it
|
||||
// ===========================================
|
||||
public function exists() {
|
||||
$user_data = $this->load(array('login'=>$this->login));
|
||||
if(count($user_data) == 1) {
|
||||
$this->setId($user_data[0]['id']);
|
||||
$this->setDisplayName($user_data[0]['display_name']);
|
||||
$this->setAdmin($user_data[0]['admin']);
|
||||
$this->setPassword($user_data[0]['password']);
|
||||
$user_data = $this->load(array('login'=>$this->login), true);
|
||||
|
||||
return true;
|
||||
if(count($user_data) == 1) {
|
||||
return $user_data;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
@ -77,7 +77,8 @@
|
||||
$error = "Unknown username / password.";
|
||||
}
|
||||
else {
|
||||
if($user->exists($_POST['login']) && $user->checkPassword($_POST['password'])) {
|
||||
$user = $user->exists($_POST['login']);
|
||||
if($user !== false && $user->checkPassword($_POST['password'])) {
|
||||
ban_loginOk();
|
||||
$_SESSION['current_user'] = $user->sessionStore();
|
||||
$_SESSION['ip'] = user_ip();
|
||||
|
Loading…
Reference in New Issue
Block a user