login page new

This commit is contained in:
daniel 2017-03-15 15:23:28 +01:00
parent a87839bd07
commit aec0d91109
6 changed files with 150 additions and 30 deletions

View File

@ -45,9 +45,9 @@ switch ($login_screen) {
$logo_link = 'index.php'; $logo_link = 'index.php';
$logo_title = __('Refresh'); $logo_title = __('Refresh');
break; break;
$splash_title = __('Splash login');
} }
$url = '?login=1'; $url = '?login=1';
//These variables come from index.php //These variables come from index.php
if (!empty ($page) && !empty ($sec)) { if (!empty ($page) && !empty ($sec)) {
@ -64,7 +64,17 @@ if (!empty($config['login_background'])) {
echo '<div id="login_body" ' . $login_body_style . '></div>'; echo '<div id="login_body" ' . $login_body_style . '></div>';
echo '<div id="header_login">'; echo '<div id="header_login">';
echo '<div id="icon_custom_pandora">'; echo '<div id="icon_custom_pandora">';
echo '<img src="images/custom_logo/logo_login_consola.png" alt="pandora_console">'; if (defined ('PANDORA_ENTERPRISE')) {
if(isset ($config['custom_logo'])){
echo '<img src="images/custom_logo/' . $config['custom_logo'] .'" alt="pandora_console">';
}
else{
echo '<img src="images/custom_logo/logo_login_consola.png" alt="pandora_console">';
}
}
else{
echo '<img src="images/custom_logo/logo_login_consola.png" alt="pandora_console">';
}
echo '</div>'; echo '</div>';
echo '<div id="list_icon_docs_support"><ul>'; echo '<div id="list_icon_docs_support"><ul>';
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank"><img src="images/icono_docs.png" alt="docs pandora"></a></li>'; echo '<li><a href="http://wiki.pandorafms.com/" target="_blank"><img src="images/icono_docs.png" alt="docs pandora"></a></li>';
@ -100,7 +110,7 @@ echo '<div class="login_page">';
html_print_image ("images/custom_logo_login/login_logo.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true); html_print_image ("images/custom_logo_login/login_logo.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
} }
else{ else{
html_print_image ("images/custom_logo_login/".$config['custom_logo_login'], false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true); html_print_image ("images/custom_logo_login/".$config['custom_logo_login'], false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
} }
echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>"; echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";
} }
@ -195,18 +205,47 @@ echo '<div class="login_page">';
} }
echo '</form></div>'; echo '</form></div>';
echo '<div class="login_data">'; echo '<div class="login_data">';
echo '<div class ="text_banner_login">'; echo '<div class ="text_banner_login">';
echo '<div><span class="span1">'; echo '<div><span class="span1">';
echo "WELCOME TO PANDORA FMS"; if(defined ('PANDORA_ENTERPRISE')){
if($config['custom_title1_login']){
echo strtoupper(io_safe_output($config['custom_title1_login']));
}
else{
echo __('WELCOME TO PANDORA FMS');
}
}
else{
echo __('WELCOME TO PANDORA FMS');
}
echo '</span></div>'; echo '</span></div>';
echo '<div><span class="span2">'; echo '<div><span class="span2">';
echo " NEXT GENERATION "; if(defined ('PANDORA_ENTERPRISE')){
if($config['custom_title2_login']){
echo strtoupper(io_safe_output($config['custom_title2_login']));
}
else{
echo __('NEXT GENERATION');
}
}
else{
echo __('NEXT GENERATION');
}
echo '</span></div>'; echo '</span></div>';
echo '</div>'; echo '</div>';
echo '<div class ="img_banner_login">'; echo '<div class ="img_banner_login">';
html_print_image ("/images/splash_imagenes.png", false); if (defined ('PANDORA_ENTERPRISE')) {
if(isset($config['custom_splash_login'])){
html_print_image ("enterprise/images/custom_splash_login/".$config['custom_splash_login'], false, array ( "alt" => "splash", "border" => 0, "title" => $splash_title), false, true);
}
else{
html_print_image ("enterprise/images/custom_splash_login/splash_image_default.png", false, array ("alt" => "logo", "border" => 0, "title" => $splash_title), false, true);
}
}
else{
html_print_image ("images/splash_image_default.png", false, array ("alt" => "logo", "border" => 0, "title" => $splash_title), false, true);
}
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -304,7 +343,6 @@ html_print_div(array('id' => 'modal_alert', 'hidden' => true));
.show (); .show ();
} }
<?php <?php
html_debug_print($login_screen, true);
switch($login_screen) { switch($login_screen) {
case 'error_authconfig': case 'error_authconfig':
case 'error_emptyconfig': case 'error_emptyconfig':
@ -378,7 +416,7 @@ html_print_div(array('id' => 'modal_alert', 'hidden' => true));
}); });
$("#submit-hide-login-error").click (function () { $("#submit-hide-login-error").click (function () {
$("#login_failed" ).dialog('close'): $("#login_failed" ).dialog('close');
$("#login_correct_pass").dialog('close'); $("#login_correct_pass").dialog('close');
}); });
}); });

View File

@ -217,9 +217,35 @@ else {
$config["custom_logo_login"], '', '', '',true,false,true,'',$open,'width:240px'); $config["custom_logo_login"], '', '', '',true,false,true,'',$open,'width:240px');
} }
$table_styles->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'custom_logo_login_preview', $open, '', 'class="sub camera"', true,false,$open,'visualmodal'); $table_styles->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'custom_logo_login_preview', $open, '', 'class="sub camera"', true,false,$open,'visualmodal');
$row++; $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] .= "&nbsp;" . 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][0] = __('Disable logo in graphs');
$table_styles->data[$row][1] = __('Yes') . '&nbsp;' . $table_styles->data[$row][1] = __('Yes') . '&nbsp;' .
@ -909,7 +935,7 @@ $("#button-custom_logo_preview").click (function (e) {
return; return;
$dialog = $("<div></div>"); $dialog = $("<div></div>");
$image = $("<img src=\"" + icon_path + "\">"); $image = $("<div style='background-color:grey'><img src=\"" + icon_path + "\"></div>");
$image $image
.css('max-width', '500px') .css('max-width', '500px')
.css('max-height', '500px'); .css('max-height', '500px');
@ -949,7 +975,7 @@ $("#button-custom_logo_login_preview").click (function (e) {
return; return;
$dialog = $("<div></div>"); $dialog = $("<div></div>");
$image = $("<img src=\"" + icon_path + "\">"); $image = $("<div style='background-color:grey'><img src=\"" + icon_path + "\"></div>");
$image $image
.css('max-width', '500px') .css('max-width', '500px')
.css('max-height', '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 = "<?php echo $config['homeurl']; if(enterprise_installed){ echo 'enterprise/'; } ?>images/custom_splash_login/" + icon_name;
if (icon_name == "")
return;
$dialog = $("<div></div>");
$image = $("<img src=\"" + icon_path + "\">");
$image
.css('max-width', '500px')
.css('max-height', '500px');
try {
$dialog
.hide()
.html($image)
.dialog({
title: "<?php echo __('Splash Preview'); ?>",
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) { $("#button-login_background_preview").click (function (e) {
var icon_name = $("select#login_background option:selected").val(); var icon_name = $("select#login_background option:selected").val();
var icon_path = "<?php echo $config['homeurl']; ?>/images/backgrounds/" + icon_name; var icon_path = "<?php echo $config['homeurl']; ?>/images/backgrounds/" + icon_name;

View File

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 300 KiB

View File

@ -467,15 +467,16 @@ function config_update_config () {
$error_update[] = __('Font size'); $error_update[] = __('Font size');
if (!config_update_value ('flash_charts', (bool) get_parameter ('flash_charts'))) if (!config_update_value ('flash_charts', (bool) get_parameter ('flash_charts')))
$error_update[] = __('Interactive 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', (string) get_parameter ('custom_logo'))) if (!config_update_value ('custom_logo_login', (string) get_parameter ('custom_logo_login')))
$error_update[] = __('Custom logo'); $error_update[] = __('Custom logo login');
if (!config_update_value ('custom_logo_login', (string) get_parameter ('custom_logo_login'))) if (!config_update_value ('custom_splash_login', (string) get_parameter ('custom_splash_login')))
$error_update[] = __('Custom logo 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'))) if (!config_update_value ('login_background', (string) get_parameter ('login_background')))
$error_update[] = __('Login background'); $error_update[] = __('Login background');
if (!config_update_value ('vc_refr', get_parameter('vc_refr'))) if (!config_update_value ('vc_refr', get_parameter('vc_refr')))
@ -1084,16 +1085,25 @@ function config_process_config () {
config_update_value ('fixed_menu', false); config_update_value ('fixed_menu', false);
} }
if (!isset ($config["custom_logo"])) { if (!isset ($config["custom_logo"])) {
config_update_value ('custom_logo', 'pandora_logo_head_4.png'); config_update_value ('custom_logo', 'pandora_logo_head_4.png');
} }
if (!isset ($config["custom_logo_login"])) { 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'])) { if (!isset ($config['history_db_enabled'])) {
config_update_value ( 'history_db_enabled', false); config_update_value ( 'history_db_enabled', false);

View File

@ -3881,11 +3881,16 @@ div#list_icon_docs_support{
margin-right: 4%; margin-right: 4%;
} }
div#list_icon_docs_support ul{
margin-top: 5px;
}
div#list_icon_docs_support ul li{ div#list_icon_docs_support ul li{
display: inline-block; display: inline-block;
color:white; color:white;
vertical-align: middle; vertical-align: middle;
margin-right: 5px; margin-right: 5px;
font-size: 10pt;
} }
li#li_margin_left{ li#li_margin_left{
@ -4033,16 +4038,15 @@ div.text_banner_login span{
} }
span.span1{ span.span1{
font-weight: 100; font-weight: lighter;
font-size: 3vw; font-size: 3vw;
font-family: leto; font-family: 'lato';
font-style: italic;
} }
span.span2{ span.span2{
font-weight: 300; font-weight: 300;
font-size: 3vw; font-size: 3vw;
font-family: leto; font-family: 'lato';
} }
div.img_banner_login{ div.img_banner_login{

View File

@ -140,7 +140,8 @@ echo '<head>' . "\n";
//This starts the page head. In the call back function, things from $page['head'] array will be processed into the head //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'); ob_start ('ui_process_page_head');
echo '<link href="https://fonts.googleapis.com/css?family=Lato:300" rel="stylesheet">';
echo '<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet">';
// Enterprise main // Enterprise main
enterprise_include ('index.php'); enterprise_include ('index.php');