From e01d36255d7c9286075196fe2add40743895d2f2 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 18 Feb 2016 12:41:41 +0100 Subject: [PATCH] Some changes in saml login system. --- pandora_console/general/login_page.php | 13 ++++++------- pandora_console/godmode/setup/setup_auth.php | 5 ++++- pandora_console/index.php | 5 +++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 00e20274b0..ca70fe9eae 100644 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -87,12 +87,6 @@ echo ' html_print_image ($config['homeurl'] . "/images/pandora_login.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true); } echo ''; - echo '
'; - if ($config['auth'] == 'saml') { - html_print_submit_button(__("Login with SAML"), "login_button_saml", false, 'class="sub login_boton"'); - - } - echo '
'; // This prints the current pandora console version. // For stable/live function it might be wise to comment it out @@ -126,7 +120,12 @@ echo ' html_print_input_text_extended ("pass", '', "pass", '', '', '' ,false, '', 'class="login login_password"', false, true); echo ''; echo '
'; - html_print_submit_button(__("Login") . '  >', "login_button", false, 'class="sub next_login"'); + if ($config['auth'] == 'saml') { + html_print_submit_button(__("Login with SAML"), "login_button_saml", false, 'class="sub login_boton"'); + } + 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 5ee5d6cc86..b075f57a47 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -252,8 +252,11 @@ 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 { diff --git a/pandora_console/index.php b/pandora_console/index.php index 630db703fa..4e38e6e131 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -181,9 +181,14 @@ if (! isset ($config['id_user']) && isset ($_GET["login"])) { $login_button_saml = get_parameter("login_button_saml", false); if (($config['auth'] == 'saml') && $login_button_saml) { + 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.