mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Force try remote before falling back to local if admin user
This commit is contained in:
parent
c613828777
commit
79c8c852b3
@ -80,16 +80,20 @@ function process_user_login($login, $pass, $api=false)
|
|||||||
{
|
{
|
||||||
global $config, $mysql_cache;
|
global $config, $mysql_cache;
|
||||||
|
|
||||||
// Always authenticate admins against the local database
|
// 1. Try remote.
|
||||||
if (strtolower($config['auth']) == 'mysql' || is_user_admin($login)) {
|
$login_remote = process_user_login_remote(
|
||||||
|
$login,
|
||||||
|
io_safe_output($pass),
|
||||||
|
$api
|
||||||
|
);
|
||||||
|
|
||||||
|
// 2. Try local.
|
||||||
|
if ($login_remote == false
|
||||||
|
&& ($config['fallback_local_auth'] || is_user_admin($login))
|
||||||
|
) {
|
||||||
return process_user_login_local($login, $pass, $api);
|
return process_user_login_local($login, $pass, $api);
|
||||||
} else {
|
} else {
|
||||||
$login_remote = process_user_login_remote($login, io_safe_output($pass), $api);
|
return $login_remote;
|
||||||
if ($login_remote == false && $config['fallback_local_auth']) {
|
|
||||||
return process_user_login_local($login, $pass, $api);
|
|
||||||
} else {
|
|
||||||
return $login_remote;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user