refactor: fix code style
This commit is contained in:
parent
b422805af4
commit
e42c9262ef
2 changed files with 10 additions and 9 deletions
|
@ -48,9 +48,9 @@ $config->load();
|
||||||
* database.
|
* database.
|
||||||
*/
|
*/
|
||||||
session_start(
|
session_start(
|
||||||
array(
|
[
|
||||||
'name' => 'wishthis',
|
'name' => 'wishthis',
|
||||||
)
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$user = User::getCurrent();
|
$user = User::getCurrent();
|
||||||
|
|
|
@ -369,7 +369,8 @@ class User
|
||||||
?: $this->email;
|
?: $this->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updatePasswordHash(string $password, string $email): string {
|
public function updatePasswordHash(string $password, string $email): string
|
||||||
|
{
|
||||||
global $database;
|
global $database;
|
||||||
$passwordHash = User::passwordToHash($password);
|
$passwordHash = User::passwordToHash($password);
|
||||||
|
|
||||||
|
@ -379,7 +380,7 @@ class User
|
||||||
WHERE `email` = :user_email',
|
WHERE `email` = :user_email',
|
||||||
[
|
[
|
||||||
"user_email" => $email,
|
"user_email" => $email,
|
||||||
"password_hash" => $passwordHash
|
"password_hash" => $passwordHash,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
return $passwordHash;
|
return $passwordHash;
|
||||||
|
@ -416,7 +417,7 @@ class User
|
||||||
FROM `users`
|
FROM `users`
|
||||||
WHERE `email` = :user_email',
|
WHERE `email` = :user_email',
|
||||||
[
|
[
|
||||||
'user_email' => $email
|
'user_email' => $email,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->fetch(\PDO::FETCH_ASSOC);
|
->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
@ -439,7 +440,7 @@ class User
|
||||||
|
|
||||||
$password_matches = password_verify($password, $passwordHash);
|
$password_matches = password_verify($password, $passwordHash);
|
||||||
|
|
||||||
if(!$password_matches) {
|
if (!$password_matches) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,7 +453,7 @@ class User
|
||||||
SET `last_login` = NOW()
|
SET `last_login` = NOW()
|
||||||
WHERE `email` = :user_email',
|
WHERE `email` = :user_email',
|
||||||
[
|
[
|
||||||
'user_email' => $email
|
'user_email' => $email,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$user_database_fields['last_login'] = date('Y-m-d H:i');
|
$user_database_fields['last_login'] = date('Y-m-d H:i');
|
||||||
|
|
Loading…
Reference in a new issue