10712-New login

This commit is contained in:
Pablo Aragon 2023-03-21 13:31:11 +01:00
parent 2db4ec6a2b
commit e8744b5d12
5 changed files with 145 additions and 65 deletions

View File

@ -27,6 +27,22 @@ require_once __DIR__.'/../include/functions_ui.php';
require_once __DIR__.'/../include/functions.php';
require_once __DIR__.'/../include/functions_html.php';
echo '<style>
:root {';
if ($config['style'] === 'pandora') {
echo '--login-background-color: rgba(255, 255, 255, 0.2);';
echo '--login-label-color: #545454;';
echo '--login-text-color: #000;';
$style_theme = 'white-theme';
} else {
echo '--login-background-color: rgba(0, 0, 0, 0.8);';
echo '--login-label-color: #c5c5c5;';
echo '--login-text-color: #fff;';
$style_theme = '';
}
echo '}
</style>';
if ($config['visual_animation']) {
// form#login_form, div.login_data {
@ -121,7 +137,13 @@ if (empty($config['background_opacity']) === false) {
$opacity = 30;
}
$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba(0,0,0,.'.$opacity.'), rgba(0,0,0,.'.$opacity.")), url('".$background_url."');\"";
if ($config['style'] === 'pandora') {
$opacity_color = '255, 255, 255, .';
} else {
$opacity_color = '0, 0, 0, .';
}
$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba('.$opacity_color.$opacity.'), rgba('.$opacity_color.$opacity.")), url('".$background_url."');\"";
// Get alternative custom in case of db fail.
$custom_fields = [
@ -148,7 +170,7 @@ foreach ($custom_fields as $field) {
$docs_logo = ui_get_docs_logo();
$support_logo = ui_get_support_logo();
echo '<div id="login_body" '.$login_body_style.'>';
echo '<div id="header_login">';
echo '<div id="header_login" class="'.$style_theme.'">';
echo '<div id="list_icon_docs_support"><ul>';
@ -298,7 +320,7 @@ switch ($login_screen) {
);
echo '</div>';
} else {
echo '<div class="login_nick">';
echo '<div class="login_nick '.$style_theme.'">';
html_print_input_text_extended(
'nick',
'',
@ -312,7 +334,7 @@ switch ($login_screen) {
);
echo '<label for="nick" class="placeholder">'.__('User').'</label>';
echo '</div>';
echo '<div class="login_pass">';
echo '<div class="login_pass '.$style_theme.'">';
html_print_input_text_extended(
'pass',
'',
@ -322,7 +344,7 @@ switch ($login_screen) {
'',
false,
'',
'autocomplete="off" class="input" placeholder=" "',
'autocomplete="off" class="input " placeholder=" " style="background-image: url(images/enable.svg);"',
false,
true
);
@ -346,7 +368,7 @@ switch ($login_screen) {
}
}
echo '<div class="login_nick">';
echo '<div class="login_nick '.$style_theme.'">';
echo '<div>';
echo '</div>';
@ -495,31 +517,28 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
echo '</div>';
echo '<div class ="text_banner_login">';
// echo '<div><span class="span1">';
// if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
// if ($config['custom_title1_login']) {
// echo io_safe_output($config['custom_title1_login']);
// } else {
// echo __('WELCOME TO %s', get_product_name());
// }
// } else {
// echo __('WELCOME TO %s', get_product_name());
// }
// echo '</span></div>';
echo '<div><span class="span2">';
echo '<div><span class="span1">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title1_login']) {
echo io_safe_output($config['custom_title1_login']);
} else {
echo __('ONE TOOL TO MONITOR THEM ALL');
}
} else {
echo __('ONE TOOL TO MONITOR THEM ALL');
}
echo '</span></div>';
echo '<div><span class="span2">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title2_login']) {
echo io_safe_output($config['custom_title2_login']);
} else {
echo __('NEXT GENERATION');
}
} else {
echo __('NEXT GENERATION');
}
echo '</span></div>';
echo '</div>';
echo '</div>';
echo '</span></div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';

View File

@ -431,7 +431,7 @@ $table_styles->data[$row][] = html_print_label_input_block(
$config['login_background'],
'',
__('Default'),
'background_pandora_console_keys.jpg',
'',
true,
false,
true,
@ -571,7 +571,7 @@ if (enterprise_installed() === true) {
$config['custom_splash_login'],
'',
__('Default'),
'default.svg',
'default',
true,
false,
true,

View File

@ -2561,7 +2561,7 @@ function config_process_config()
}
if (!isset($config['custom_splash_login'])) {
config_update_value('custom_splash_login', 'default');
config_update_value('custom_splash_login', 'none.png');
}
if (!isset($config['custom_docs_logo'])) {
@ -2597,11 +2597,11 @@ function config_process_config()
}
if (!isset($config['custom_title1_login'])) {
config_update_value('custom_title1_login', __('PANDORA FMS'));
config_update_value('custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL'));
}
if (!isset($config['custom_title2_login'])) {
config_update_value('custom_title2_login', __('ONE TOOL TO MONITOR THEM ALL'));
config_update_value('custom_title2_login', '');
}
if (!isset($config['custom_docs_url'])) {
@ -2649,11 +2649,11 @@ function config_process_config()
}
if (!isset($config['meta_custom_title1_login'])) {
config_update_value('meta_custom_title1_login', __('PANDORA FMS NEXT GENERATION'));
config_update_value('meta_custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL'));
}
if (!isset($config['meta_custom_title2_login'])) {
config_update_value('meta_custom_title2_login', __('METACONSOLE'));
config_update_value('meta_custom_title2_login', __('COMMAND CENTER'));
}
if (!isset($config['vc_favourite_view'])) {
@ -3482,7 +3482,7 @@ function config_process_config()
}
if (!isset($config['random_background'])) {
config_update_value('random_background', '');
config_update_value('random_background', 1);
}
if (!isset($config['meta_random_background'])) {

View File

@ -26,7 +26,7 @@ div#error_buttons a {
/* Set rules to fill background */
/* background-color:#000 !important; */
min-height: 100%;
min-width: 1200px;
/* min-width: 1200px; */
width: 100%;
position: absolute;
background-repeat: repeat;
@ -68,7 +68,7 @@ div#login_f {
#ver_num {
width: 100%;
color: #878787;
color: #dddddd;
text-align: center;
font-weight: 350;
font-size: 10px;
@ -105,7 +105,7 @@ div#list_icon_docs_support ul {
div#list_icon_docs_support ul li {
display: inline-block;
color: white;
color: #fff;
vertical-align: middle;
margin-right: 5px;
font-size: 10pt;
@ -140,7 +140,9 @@ li#li_margin_support {
}
div.login_page {
background-color: rgba(0, 0, 0, 0.8);
/* background-color: rgba(0, 0, 0, 0.8); */
/* background-color: rgba(255, 255, 255, 0.2); */
background-color: var(--login-background-color);
width: 40vw;
min-width: 300px;
height: 100vh;
@ -164,7 +166,8 @@ div.login_logo_icon {
div.login_logo_icon img {
margin: 0 auto;
width: 300px;
max-height: 185px;
max-width: 300px;
}
div.login_double_auth_code,
@ -174,7 +177,6 @@ div.login_pass {
width: 300px;
height: 40px;
margin-bottom: 20px;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 3px;
}
@ -195,8 +197,8 @@ div.login_pass input {
box-sizing: border-box;
}
div.login_pass > input#pass {
background-image: url(../../images/enable.svg);
input {
background-color: transparent;
}
input:not([type="image"]):focus,
@ -335,23 +337,26 @@ div.login_data {
div.text_banner_login {
width: 100%;
color: white;
color: #fff;
margin-top: 40px;
display: flex;
flex-direction: column;
}
span.span1 {
font-size: 38px;
letter-spacing: -0.38px;
display: block;
max-width: 700px;
font-size: 80pt;
line-height: 80pt;
font-family: "lato-bolder";
color: white;
line-height: 49pt;
color: #fff;
}
span.span2 {
display: block;
width: 700px;
font-size: 80pt;
line-height: 80pt;
max-width: 700px;
font-size: 30pt;
line-height: 30pt;
font-family: "lato-bolder";
color: #fff;
}
@ -377,16 +382,18 @@ div.img_banner_login img {
@media all and (max-width: 1266px) {
span.span1 {
font-size: 38px;
letter-spacing: -0.38px;
font-weight: bold;
color: white;
line-height: 49pt;
}
span.span2 {
width: 550px;
display: block;
max-width: 500px;
font-size: 60pt;
line-height: 60pt;
font-weight: bold;
color: #fff;
}
span.span2 {
display: block;
max-width: 500px;
font-size: 20pt;
line-height: 20pt;
font-family: "lato-bolder";
color: #fff;
}
@ -682,7 +689,7 @@ div.button_message_alert_form input {
bottom: 10px;
/* background: transparent; */
background: #f1f1f1;
border: solid white 10px;
border: solid #fff 10px;
border-radius: 50%;
}
@ -715,6 +722,7 @@ div.login_pass input:-webkit-autofill:active {
background-size: 27px;
background-position: right 10px bottom 50%;
box-sizing: border-box;
-webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0) inset !important;
}
div.login_pass input:-webkit-autofill,
@ -796,3 +804,62 @@ button.submitButton > span {
font-size: 9pt;
top: -10px;
}
div.login_nick.white-theme input,
div.login_pass.white-theme input {
background-color: #f6f7fb;
border: 0px;
color: #343434;
border-radius: 3px;
width: 100%;
height: 40px;
font-size: 10pt;
padding: 0px 0px 0px 8%;
background-repeat: no-repeat;
background-size: 27px;
background-position: right 10px bottom 50%;
box-sizing: border-box;
}
div.white-theme > .placeholder {
color: #8b8b8b;
left: 24px;
}
div.white-theme > .input:not(:placeholder-shown) ~ .placeholder {
top: 15px;
color: transparent;
}
div.white-theme > .input:focus ~ .placeholder {
top: 15px;
color: transparent;
}
div.white-theme input:-webkit-autofill,
div.white-theme input:-webkit-autofill:hover,
div.white-theme input:-webkit-autofill:focus,
div.white-theme input:-webkit-autofill:active {
-webkit-text-fill-color: #343434;
border: 0px;
border-bottom: 0px;
border-radius: 3px;
width: 100%;
height: 40px;
font-size: 12pt;
background-repeat: no-repeat;
background-size: 27px;
background-position: right 10px bottom 50%;
box-sizing: border-box;
-webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0) inset !important;
}
div.white-theme input:not([type="image"]):focus,
textarea:focus,
select:focus {
border: 2px solid #8a96a6;
}
div#header_login.white-theme {
background-color: rgba(0, 0, 0, 0.5);
}

View File

@ -31,7 +31,7 @@ ul.subsubmenu li,
input.search_input,
.filters input,
input#text-id_parent.ac_input,
input,
input:not(div.login_pass > input):not(div.login_nick > input),
textarea,
select,
.edit_user_comments #textarea_comments,
@ -466,12 +466,6 @@ ul.tree-group
filter: invert(100%);
}
/* login.css */
div.login_nick input,
div.login_pass input {
background-color: #111 !important;
}
/* user edit */
.edit_user_info_right input {
border-bottom: 1px solid #5f5f5f;