Saml login. Added restiction to admin users and saml button

(cherry picked from commit 9bc9bb9cc3)
This commit is contained in:
Arturo Gonzalez 2016-06-03 12:48:04 +02:00
parent 48bc2159fe
commit 3c96db8f48
1 changed files with 14 additions and 8 deletions

View File

@ -288,7 +288,8 @@ if (! isset ($config['id_user'])) {
$nick_in_db = $_SESSION["prepared_login_da"]['id_user'];
$expired_pass = false;
}
else if (($config['auth'] == 'saml') && $login_button_saml && !is_user_admin($nick)) {
else if (($config['auth'] == 'saml') && $login_button_saml) {
if (!is_user_admin($nick)) {
include_once(ENTERPRISE_DIR . "/include/auth/saml.php");
$saml_user_id = saml_process_user_login();
$nick_in_db = $saml_user_id;
@ -298,6 +299,11 @@ if (! isset ($config['id_user'])) {
$as->logout();
}
}
else {
$config["auth_error"] = "Error - Cannot log in as admin with 'login with saml' button";
$nick_in_db = false;
}
}
else {
// process_user_login is a virtual function which should be defined in each auth file.
// It accepts username and password. The rest should be internal to the auth file.