From aec0d911099c5be842de721f57004b95da5acaa5 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 15 Mar 2017 15:23:28 +0100 Subject: [PATCH] login page new --- pandora_console/general/login_page.php | 56 +++++++++++--- .../godmode/setup/setup_visuals.php | 73 +++++++++++++++++- ..._imagenes.png => splash_image_default.png} | Bin pandora_console/include/functions_config.php | 36 +++++---- pandora_console/include/styles/pandora.css | 12 ++- pandora_console/index.php | 3 +- 6 files changed, 150 insertions(+), 30 deletions(-) rename pandora_console/images/{splash_imagenes.png => splash_image_default.png} (100%) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 52d89b1f67..c67f4d63c4 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -45,9 +45,9 @@ switch ($login_screen) { $logo_link = 'index.php'; $logo_title = __('Refresh'); break; + $splash_title = __('Splash login'); } - $url = '?login=1'; //These variables come from index.php if (!empty ($page) && !empty ($sec)) { @@ -64,7 +64,17 @@ if (!empty($config['login_background'])) { echo '
'; echo '
'; echo '
'; - echo 'pandora_console'; + if (defined ('PANDORA_ENTERPRISE')) { + if(isset ($config['custom_logo'])){ + echo 'pandora_console'; + } + else{ + echo 'pandora_console'; + } + } + else{ + echo 'pandora_console'; + } echo '
'; echo '
    '; echo '
  • docs pandora
  • '; @@ -100,7 +110,7 @@ echo ''; @@ -304,7 +343,6 @@ html_print_div(array('id' => 'modal_alert', 'hidden' => true)); .show (); } 'modal_alert', 'hidden' => true)); }); $("#submit-hide-login-error").click (function () { - $("#login_failed" ).dialog('close'): + $("#login_failed" ).dialog('close'); $("#login_correct_pass").dialog('close'); }); }); diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 08e454a0ec..80533799d3 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -217,9 +217,35 @@ else { $config["custom_logo_login"], '', '', '',true,false,true,'',$open,'width:240px'); } - $table_styles->data[$row][1] .= " " . html_print_button(__("View"), 'custom_logo_login_preview', $open, '', 'class="sub camera"', true,false,$open,'visualmodal'); +$table_styles->data[$row][1] .= " " . html_print_button(__("View"), 'custom_logo_login_preview', $open, '', 'class="sub camera"', true,false,$open,'visualmodal'); $row++; +//Splash login +if(enterprise_installed()) { + $table_styles->data[$row][0] = __('Custom Splash (login)') . ui_print_help_icon("custom_logo_login", true); + + $table_styles->data[$row][1] = html_print_select( + list_files('enterprise/images/custom_splash_login', "png", 1, 0), 'custom_splash_login', + $config["custom_splash_login"], '', '', '',true,false,true,'',$open,'width:240px'); + + $table_styles->data[$row][1] .= " " . html_print_button(__("View"), 'custom_splash_login_preview', $open, '', 'class="sub camera"', true,false,$open,'visualmodal'); + + $row++; +} + +//login title1 +if(enterprise_installed()) { + $table_styles->data[$row][0] = __('Title 1 (login)') . ui_print_help_icon("custom_logo_login", true); + $table_styles->data[$row][1] = html_print_input_text ('custom_title1_login', $config["custom_title1_login"], '', 50, 50, true); + $row++; +} + +//login text2 +if(enterprise_installed()) { + $table_styles->data[$row][0] = __('Title 2 (login)') . ui_print_help_icon("custom_logo_login", true); + $table_styles->data[$row][1] = html_print_input_text ('custom_title2_login', $config["custom_title2_login"], '', 50, 50, true); + $row++; +} $table_styles->data[$row][0] = __('Disable logo in graphs'); $table_styles->data[$row][1] = __('Yes') . ' ' . @@ -909,7 +935,7 @@ $("#button-custom_logo_preview").click (function (e) { return; $dialog = $("
    "); - $image = $(""); + $image = $("
    "); $image .css('max-width', '500px') .css('max-height', '500px'); @@ -949,7 +975,7 @@ $("#button-custom_logo_login_preview").click (function (e) { return; $dialog = $("
    "); - $image = $(""); + $image = $("
    "); $image .css('max-width', '500px') .css('max-height', '500px'); @@ -981,6 +1007,47 @@ $("#button-custom_logo_login_preview").click (function (e) { } }); +$("#button-custom_splash_login_preview").click (function (e) { + var icon_name = $("select#custom_splash_login option:selected").val(); + var icon_path = "images/custom_splash_login/" + icon_name; + + if (icon_name == "") + return; + + $dialog = $("
    "); + $image = $(""); + $image + .css('max-width', '500px') + .css('max-height', '500px'); + + try { + $dialog + .hide() + .html($image) + .dialog({ + title: "", + resizable: true, + draggable: true, + modal: true, + overlay: { + opacity: 0.5, + background: "black" + }, + minHeight: 1, + width: $image.width, + close: function () { + $dialog + .empty() + .remove(); + } + }).show(); + } + catch (err) { + // console.log(err); + } +}); + + $("#button-login_background_preview").click (function (e) { var icon_name = $("select#login_background option:selected").val(); var icon_path = "/images/backgrounds/" + icon_name; diff --git a/pandora_console/images/splash_imagenes.png b/pandora_console/images/splash_image_default.png similarity index 100% rename from pandora_console/images/splash_imagenes.png rename to pandora_console/images/splash_image_default.png diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 8f8676641f..08560e5516 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -467,15 +467,16 @@ function config_update_config () { $error_update[] = __('Font size'); if (!config_update_value ('flash_charts', (bool) get_parameter ('flash_charts'))) $error_update[] = __('Interactive charts'); - - - if (!config_update_value ('custom_logo', (string) get_parameter ('custom_logo'))) - $error_update[] = __('Custom logo'); - if (!config_update_value ('custom_logo_login', (string) get_parameter ('custom_logo_login'))) - $error_update[] = __('Custom logo login'); - - - + if (!config_update_value ('custom_logo', (string) get_parameter ('custom_logo'))) + $error_update[] = __('Custom logo'); + if (!config_update_value ('custom_logo_login', (string) get_parameter ('custom_logo_login'))) + $error_update[] = __('Custom logo login'); + if (!config_update_value ('custom_splash_login', (string) get_parameter ('custom_splash_login'))) + $error_update[] = __('Custom splash login'); + if (!config_update_value ('custom_title1_login', (string) get_parameter ('custom_title1_login'))) + $error_update[] = __('Custom title1 login'); + if (!config_update_value ('custom_title2_login', (string) get_parameter ('custom_title2_login'))) + $error_update[] = __('Custom title2 login'); if (!config_update_value ('login_background', (string) get_parameter ('login_background'))) $error_update[] = __('Login background'); if (!config_update_value ('vc_refr', get_parameter('vc_refr'))) @@ -1084,17 +1085,26 @@ function config_process_config () { config_update_value ('fixed_menu', false); } - - if (!isset ($config["custom_logo"])) { config_update_value ('custom_logo', 'pandora_logo_head_4.png'); + } - } if (!isset ($config["custom_logo_login"])) { - config_update_value ('custom_logo_login', 'login_logo.png'); + config_update_value ('custom_logo_login', 'login_logo_v7.png'); } + if (!isset ($config["custom_splash_login"])) { + config_update_value ('custom_splash_login', 'splash_image_default.png'); + } + if (!isset ($config["custom_title1_login"])) { + config_update_value ('custom_title1_login', __('WELCOME TO PANDORA FMS')); + } + + if (!isset ($config["custom_title2_login"])) { + config_update_value ('custom_title2_login', __('NEXT GENERATION')); + } + if (!isset ($config['history_db_enabled'])) { config_update_value ( 'history_db_enabled', false); } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 112e77a0a9..a7f9f93033 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3881,11 +3881,16 @@ div#list_icon_docs_support{ margin-right: 4%; } +div#list_icon_docs_support ul{ + margin-top: 5px; +} + div#list_icon_docs_support ul li{ display: inline-block; color:white; vertical-align: middle; margin-right: 5px; + font-size: 10pt; } li#li_margin_left{ @@ -4033,16 +4038,15 @@ div.text_banner_login span{ } span.span1{ - font-weight: 100; + font-weight: lighter; font-size: 3vw; - font-family: leto; - font-style: italic; + font-family: 'lato'; } span.span2{ font-weight: 300; font-size: 3vw; - font-family: leto; + font-family: 'lato'; } div.img_banner_login{ diff --git a/pandora_console/index.php b/pandora_console/index.php index 80e983b9e6..e13a5ad03f 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -140,7 +140,8 @@ echo '' . "\n"; //This starts the page head. In the call back function, things from $page['head'] array will be processed into the head ob_start ('ui_process_page_head'); - +echo ''; +echo ''; // Enterprise main enterprise_include ('index.php');