Add check for the username at login
This commit is contained in:
parent
849a25dfb0
commit
f02e35ac53
@ -484,11 +484,12 @@ function get_config()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_user()
|
function get_user($username)
|
||||||
{
|
{
|
||||||
return \PicoTools\singleton('db')
|
return \PicoTools\singleton('db')
|
||||||
->table('config')
|
->table('config')
|
||||||
->columns('username', 'password', 'language')
|
->columns('username', 'password', 'language')
|
||||||
|
->eq('username', $username)
|
||||||
->findOne();
|
->findOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,7 +507,7 @@ function validate_login(array $values)
|
|||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|
||||||
$user = get_user();
|
$user = get_user($values['username']);
|
||||||
|
|
||||||
if ($user && \password_verify($values['password'], $user['password'])) {
|
if ($user && \password_verify($values['password'], $user['password'])) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user