Local auth when remote enabled only api

This commit is contained in:
Calvo 2021-10-19 13:59:59 +02:00
parent 9802a59c5f
commit 47348524a7
1 changed files with 19 additions and 7 deletions

View File

@ -94,13 +94,25 @@ function process_user_login($login, $pass, $api=false)
}
// 2. Try local.
if ($login_remote === false
&& ($config['fallback_local_auth']
if ($login_remote === false) {
if ($api === true) {
$user_not_login = db_get_value(
'not_login',
'tusuario',
'id_user',
$login
);
}
if ($config['fallback_local_auth']
|| is_user_admin($login)
|| strtolower($config['auth']) == 'mysql'
|| $api === true)
|| (bool) $user_not_login === true
) {
return process_user_login_local($login, $pass, $api);
} else {
return false;
}
} else {
return $login_remote;
}