From e9eb16a84870a588b88f29af050d354aa1a70956 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 18 Feb 2016 12:29:50 +0100 Subject: [PATCH] Some changes in saml login system. --- pandora_console/general/login_page.php | 4 +++- pandora_console/godmode/setup/setup_auth.php | 8 +++++--- pandora_console/index.php | 11 ++++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 45228d3957..fcfd3e5607 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -127,7 +127,9 @@ echo '
'; if ($config['auth'] == 'saml') { html_print_submit_button(__("Login with SAML"), "login_button_saml", false, 'class="sub login_boton"'); } - html_print_submit_button(__("Login"), "login_button", false, 'class="sub next_login"'); + else { + html_print_submit_button(__("Login"), "login_button", false, 'class="sub next_login"'); + } echo '
'; break; case 'logout': diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index 466eacc4a3..47adec0ef7 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -253,14 +253,16 @@ echo ''; function show_selected_rows (event) { var auth_method = $(this).val(); - if ((auth_method !== 'mysql') && (auth_method !== 'saml')) { + if (auth_method !== 'mysql') { $('tr.remote').show(); + if (auth_method == 'saml') { + $('tr#table2-autocreate_remote_users').hide(); + } show_autocreate_options(null); } else { $('tr.remote').hide(); - } - + } // Hide all the auth methods (except mysql) _.each(auth_methods, function(value, key) { if (value !== 'mysql') diff --git a/pandora_console/index.php b/pandora_console/index.php index 7813340752..1a0f617f4c 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -289,9 +289,14 @@ if (! isset ($config['id_user'])) { $expired_pass = false; } else if (($config['auth'] == 'saml') && $login_button_saml) { - include_once(ENTERPRISE_DIR . "/include/auth/saml.php"); - $saml_user_id = saml_process_user_login(); - $nick_in_db = $saml_user_id; + if (is_user_admin($nick)) { + $nick_in_db = $nick; + } + else { + include_once(ENTERPRISE_DIR . "/include/auth/saml.php"); + $saml_user_id = saml_process_user_login(); + $nick_in_db = $saml_user_id; + } } else { // process_user_login is a virtual function which should be defined in each auth file.