mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Fix local login with local user token enabled
This commit is contained in:
parent
f1dca5e525
commit
3d02febd22
@ -82,8 +82,15 @@ function process_user_login($login, $pass, $api=false)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
// 0. Check first is user y set as local user.
|
||||||
|
$local_user = (bool) db_get_value_filter(
|
||||||
|
'local_user',
|
||||||
|
'tusuario',
|
||||||
|
['id_user' => $login]
|
||||||
|
);
|
||||||
|
|
||||||
// 1. Try remote.
|
// 1. Try remote.
|
||||||
if (strtolower($config['auth']) != 'mysql') {
|
if ($local_user !== true && strtolower($config['auth']) != 'mysql') {
|
||||||
$login_remote = process_user_login_remote(
|
$login_remote = process_user_login_remote(
|
||||||
$login,
|
$login,
|
||||||
io_safe_output($pass),
|
io_safe_output($pass),
|
||||||
@ -94,16 +101,10 @@ function process_user_login($login, $pass, $api=false)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. Try local.
|
// 2. Try local.
|
||||||
$local_user = db_get_value_filter(
|
|
||||||
'local_user',
|
|
||||||
'tusuario',
|
|
||||||
['id_user' => $login]
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($login_remote === false
|
if ($login_remote === false
|
||||||
&& ($config['fallback_local_auth']
|
&& ($config['fallback_local_auth']
|
||||||
|| is_user_admin($login)
|
|| is_user_admin($login)
|
||||||
|| $local_user
|
|| $local_user === true
|
||||||
|| strtolower($config['auth']) == 'mysql')
|
|| strtolower($config['auth']) == 'mysql')
|
||||||
) {
|
) {
|
||||||
return process_user_login_local($login, $pass, $api);
|
return process_user_login_local($login, $pass, $api);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user