diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 2ef05a5ade..176eeb5ad4 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -94,13 +94,25 @@ function process_user_login($login, $pass, $api=false) } // 2. Try local. - if ($login_remote === false - && ($config['fallback_local_auth'] - || is_user_admin($login) - || strtolower($config['auth']) == 'mysql' - || $api === true) - ) { - return process_user_login_local($login, $pass, $api); + 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' + || (bool) $user_not_login === true + ) { + return process_user_login_local($login, $pass, $api); + } else { + return false; + } } else { return $login_remote; }