2006-03-27 05:37:27 +02:00
< ? php
2006-10-04 18:15:20 +02:00
2021-11-04 16:28:15 +01:00
// Pandora FMS - http://pandorafms.com
2009-06-08 20:26:14 +02:00
// ==================================================
2020-11-27 13:52:35 +01:00
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
// Please see http://pandorafms.org for full contribution list
2006-10-04 18:15:20 +02:00
// This program is free software; you can redistribute it and/or
2011-03-23 Raul Mateos <raulofpandora@gmail.com>
* extensions/ssh_console.php, extensions/vnc_view.php,
extensions/update_manager.php, extensions/users_connected.php,
extensions/extension_uploader.php, extensions/insert_data.php,
extensions/module_groups.php, extensions/plugin_registration.php,
extensions/agent_modules.php, extensions/resource_registration.php,
extensions/resource_exportation.php, extensions/dbmanager.php,
extensions/pandora_logs.php, general/*.php, ajax.php,
operation/search_*.php, operation/menu.php, operation/extensions.php,
godmode/menu.php, godmode/extensions.php, godmode/admin_access_logs.php:
CReverted unwanted license changes.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4126 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-23 17:13:28 +01:00
// modify it under the terms of the GNU General Public License
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
// as published by the Free Software Foundation; version 2
2006-10-04 18:15:20 +02:00
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2006-10-04 18:15:20 +02:00
// GNU General Public License for more details.
2019-01-30 16:18:44 +01:00
if ( isset ( $config [ 'homedir' ])) {
$homedir = $config [ 'homedir' ] . '/' ;
} else {
$homedir = '' ;
2013-04-22 12:31:20 +02:00
}
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
2021-03-11 15:40:23 +01:00
global $config ;
2020-12-23 17:58:05 +01:00
ui_require_css_file ( 'login' , 'include/styles/' , true );
2019-01-24 11:10:49 +01:00
2019-05-22 15:31:59 +02:00
require_once __DIR__ . '/../include/functions_ui.php' ;
require_once __DIR__ . '/../include/functions.php' ;
2019-01-30 16:18:44 +01:00
require_once __DIR__ . '/../include/functions_html.php' ;
2013-04-22 12:31:20 +02:00
2023-03-21 13:31:11 +01:00
echo ' < style >
: root { ' ;
if ( $config [ 'style' ] === 'pandora' ) {
2023-03-23 11:51:21 +01:00
echo '--login-background-color: rgba(255, 255, 255, 0.4);' ;
2023-03-21 13:31:11 +01:00
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 > ' ;
2018-01-08 13:01:29 +01:00
2019-01-30 16:18:44 +01:00
if ( $config [ 'visual_animation' ]) {
2023-03-17 11:33:50 +01:00
// form#login_form, div.login_data {
2019-01-30 16:18:44 +01:00
echo ' < style >
2023-03-17 11:33:50 +01:00
div . container_login {
2023-02-17 12:52:13 +01:00
animation : container_login 3 s ease ;
}
@ keyframes container_login {
0 % {
transform : scale ( . 9 );
opacity : 0.1 ;
}
100 % {
transform : scale ( 1 );
opacity : 1 ;
}
}
2018-01-08 13:01:29 +01:00
</ style > ' ;
}
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
if ( ! isset ( $login_screen )) {
2019-01-30 16:18:44 +01:00
$login_screen = 'login' ;
2013-04-22 12:31:20 +02:00
}
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
switch ( $login_screen ) {
2019-01-30 16:18:44 +01:00
case 'login' :
2021-11-04 16:28:15 +01:00
$logo_link = 'http://www.pandorafms.com' ;
2019-01-30 16:18:44 +01:00
$logo_title = __ ( 'Go to %s Website' , get_product_name ());
break ;
case 'logout' :
case 'double_auth' :
case 'error_install' :
case 'error_authconfig' :
case 'error_dbconfig' :
case 'error_noconfig' :
case 'error_perms' :
case 'homedir_bad_defined' :
case 'homeurl_bad_defined' :
2021-07-22 09:34:58 +02:00
case 'disabled_access_node' :
2019-01-30 16:18:44 +01:00
$logo_link = 'index.php' ;
$logo_title = __ ( 'Go to Login' );
break ;
default :
error_reporting ( 0 );
$error_info = ui_get_error ( $login_screen );
$logo_link = 'index.php' ;
$logo_title = __ ( 'Refresh' );
break ;
2013-04-22 12:31:20 +02:00
}
2018-10-15 10:32:24 +02:00
$splash_title = __ ( 'Splash login' );
2009-01-07 11:42:38 +01:00
$url = '?login=1' ;
2019-01-30 16:18:44 +01:00
// These variables come from index.php
if ( ! empty ( $page ) && ! empty ( $sec )) {
foreach ( $_GET as $key => $value ) {
$url .= '&' . safe_url_extraclean ( $key ) . '=' . safe_url_extraclean ( $value );
}
2007-08-06 13:44:49 +02:00
}
2019-01-30 16:18:44 +01:00
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
$login_body_style = '' ;
2019-03-11 10:07:22 +01:00
// Overrides the default background with the defined by the user.
2023-02-17 12:52:13 +01:00
$background_url = 'images/backgrounds/background_pandora_console_keys.jpg' ;
if ( empty ( $config [ 'random_background' ]) === false ) {
$random_backgrounds = scandir ( $config [ 'homedir' ] . '/images/backgrounds/random_backgrounds' );
unset ( $random_backgrounds [ 0 ], $random_backgrounds [ 1 ]);
$random_background = array_rand ( $random_backgrounds );
$background_url = 'images/backgrounds/random_backgrounds/' . $random_backgrounds [ $random_background ];
2023-04-12 17:21:18 +02:00
$background_100 = 'background-size: cover !important; background-position: center !important; ' ;
2023-02-17 12:52:13 +01:00
}
if ( empty ( $config [ 'login_background' ]) === false ) {
2019-01-30 16:18:44 +01:00
$background_url = 'images/backgrounds/' . $config [ 'login_background' ];
2023-04-12 17:21:18 +02:00
$background_100 = 'background-size: cover !important; background-position: center !important; ' ;
2014-03-27 Alejandro Gallardo <alejandro.gallardo@artica.es>
* include/functions_config.php,
godmode/setup/setup_visuals.php,
general/login_page.php: Now is possible to select a
custom login background in the setup visuals section.
* images/backgrounds/default_4.0-stripes.gif,
images/backgrounds/default_4.0.jpg,
images/backgrounds/default_5.0.png,
images/backgrounds/flowers.jpg,
images/backgrounds/grass.jpg,
images/backgrounds/tiles.jpg,
images/backgrounds/wall.jpg,
images/backgrounds/wood.jpg: Added new images to use
it as custom login backgrounds.
* images/backgrounds/background1.jpg,
images/backgrounds/background2.jpg,
images/backgrounds/background3.jpg,
images/backgrounds/background4.jpg,
images/backgrounds/background5.jpg,
images/backgrounds/background6.jpg,
images/backgrounds/background7.jpg,
images/backgrounds/background8.jpg,
images/backgrounds/background9.jpg,
images/backgrounds/background10.jpg,
images/backgrounds/background_red.jpg: Delete some
VERY old images.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9655 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-03-27 12:49:00 +01:00
}
2019-01-30 16:18:44 +01:00
2019-12-16 16:39:13 +01:00
// Support for Internet Explorer and Microsoft Edge browsers
if ( strpos ( $_SERVER [ 'HTTP_USER_AGENT' ], 'Trident' ) !== false || strpos ( $_SERVER [ 'HTTP_USER_AGENT' ], 'Edge' ) !== false ) {
2023-02-17 12:52:13 +01:00
$background_url = 'images/backgrounds/background_pandora_console_keys.jpg' ;
$background_100 = '' ;
}
if ( empty ( $config [ 'background_opacity' ]) === false ) {
$opacity = $config [ 'background_opacity' ];
} else {
$opacity = 30 ;
2019-12-16 16:39:13 +01:00
}
2023-03-21 13:31:11 +01:00
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 . " '); \" " ;
2023-02-17 12:52:13 +01:00
2019-11-11 13:33:37 +01:00
// Get alternative custom in case of db fail.
$custom_fields = [
'custom_logo_login' ,
'custom_splash_login' ,
'custom_title1_login' ,
'custom_title2_login' ,
'rb_product_name' ,
2019-11-21 11:14:50 +01:00
'custom_docs_url' ,
'custom_support_url' ,
2019-11-11 13:33:37 +01:00
];
foreach ( $custom_fields as $field ) {
if ( ! isset ( $config [ $field ])) {
if ( isset ( $config [ $field . '_alt' ])) {
$config [ $field ] = $config [ $field . '_alt' ];
$custom_conf_enabled = true ;
}
}
}
2020-11-04 16:41:25 +01:00
2019-03-11 10:07:22 +01:00
// Get the custom icons.
2018-05-21 14:29:11 +02:00
$docs_logo = ui_get_docs_logo ();
$support_logo = ui_get_support_logo ();
2023-02-17 12:52:13 +01:00
echo '<div id="login_body" ' . $login_body_style . '>' ;
2023-03-21 13:31:11 +01:00
echo '<div id="header_login" class="' . $style_theme . '">' ;
2019-01-30 16:18:44 +01:00
2019-11-21 11:14:50 +01:00
echo '<div id="list_icon_docs_support"><ul>' ;
2019-01-30 16:18:44 +01:00
2019-11-21 11:14:50 +01:00
if ( isset ( $config [ 'custom_docs_url' ])) {
if ( $docs_logo !== false ) {
2023-02-17 12:52:13 +01:00
echo '<li id="li_margin_doc_img"><a href="' . ui_get_full_external_url ( $config [ 'custom_docs_url' ]) . '" target="_blank"><img src="' . $docs_logo . '" alt="docs"></a></li>' ;
2019-01-30 16:18:44 +01:00
}
2023-02-17 12:52:13 +01:00
echo '<li id="li_margin_doc"><a href="' . ui_get_full_external_url ( $config [ 'custom_docs_url' ]) . '" target="_blank">' . __ ( 'Docs' ) . '</li>' ;
2019-11-21 11:14:50 +01:00
} else if ( ! $custom_conf_enabled ) {
2023-02-17 12:52:13 +01:00
echo '<li id="li_margin_doc_img"><a href="https://pandorafms.com/manual/" target="_blank"><img src="' . $docs_logo . '" alt="docs"></a></li>' ;
echo '<li id="li_margin_doc"><a href="https://pandorafms.com/manual/" target="_blank">' . __ ( 'Docs' ) . '</li>' ;
2019-11-21 11:14:50 +01:00
}
if ( isset ( $config [ 'custom_support_url' ])) {
if ( file_exists ( ENTERPRISE_DIR . '/load_enterprise.php' )) {
if ( $support_logo !== false ) {
2023-02-17 12:52:13 +01:00
echo '<li id="li_margin_support_img"><a href="' . ui_get_full_external_url ( $config [ 'custom_support_url' ]) . '" target="_blank"><img src="' . $support_logo . '" alt="support"></a></li>' ;
2019-11-21 11:14:50 +01:00
}
2023-02-17 12:52:13 +01:00
echo '<li id="li_margin_support"><a href="' . ui_get_full_external_url ( $config [ 'custom_support_url' ]) . '" target="_blank">' . __ ( 'Support' ) . '</li>' ;
2019-11-21 11:14:50 +01:00
} else {
2023-02-17 12:52:13 +01:00
echo '<li id="li_margin_support_img"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="' . $support_logo . '" alt="support"></a></li>' ;
2023-02-20 09:54:48 +01:00
echo '<li id="li_margin_support"><a href="https://support.pandorafms.com" target="_blank">' . __ ( 'Support' ) . '</a></li>' ;
2019-11-21 11:14:50 +01:00
}
} else if ( ! $custom_conf_enabled ) {
2023-02-17 12:52:13 +01:00
echo '<li id="li_margin_support_img"><a href="https://support.pandorafms.com" target="_blank"><img src="' . $support_logo . '" alt="support"></a></li>' ;
2023-02-20 09:54:48 +01:00
echo '<li id="li_margin_support"><a href="https://support.pandorafms.com" target="_blank">' . __ ( 'Support' ) . '</a></li>' ;
2019-01-30 16:18:44 +01:00
}
echo '</ul></div>' ;
2017-03-15 10:12:18 +01:00
echo '</div>' ;
echo '<div class="container_login">' ;
echo '<div class="login_page">' ;
2023-03-17 11:33:50 +01:00
echo '<form method="post" id="login_form" action="' . ui_get_full_url ( 'index.php' . $url ) . '" ><div class="login_logo_icon">' ;
2019-01-30 16:18:44 +01:00
echo '<a href="' . $logo_link . '">' ;
2020-11-27 13:21:14 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
if ( ! isset ( $config [ 'custom_logo_login' ])) {
2020-11-27 13:21:14 +01:00
html_print_image (
2023-03-23 11:51:21 +01:00
'enterprise/images/custom_logo_login/Pandora-FMS-1.png' ,
2020-11-27 13:21:14 +01:00
false ,
[
'class' => 'login_logo' ,
'alt' => 'logo' ,
'border' => 0 ,
'title' => $logo_title ,
],
false
);
2019-01-30 16:18:44 +01:00
} else {
2020-11-27 13:21:14 +01:00
html_print_image (
'enterprise/images/custom_logo_login/' . $config [ 'custom_logo_login' ],
false ,
[
'class' => 'login_logo' ,
'alt' => 'logo' ,
'border' => 0 ,
'title' => $logo_title ,
],
false
);
2019-01-30 16:18:44 +01:00
}
} else if ( file_exists ( ENTERPRISE_DIR . '/load_enterprise.php' )) {
if ( ! isset ( $config [ 'custom_logo_login' ])) {
2023-03-23 11:51:21 +01:00
html_print_image ( ui_get_full_url ( 'enterprise/images/custom_logo_login/Pandora-FMS-1.png' ), false , [ 'class' => 'login_logo' , 'alt' => 'logo' , 'border' => 0 , 'title' => $logo_title ], false , true );
2019-01-30 16:18:44 +01:00
} else {
2020-02-28 11:38:41 +01:00
html_print_image ( ui_get_full_url ( 'enterprise/images/custom_logo_login/' . $config [ 'custom_logo_login' ]), false , [ 'class' => 'login_logo' , 'alt' => 'logo' , 'border' => 0 , 'title' => $logo_title ], false , true );
2019-01-30 16:18:44 +01:00
}
} else {
2020-02-28 11:38:41 +01:00
if ( empty ( $config [ 'custom_logo_login' ]) === true ) {
2023-03-23 11:51:21 +01:00
html_print_image ( ui_get_full_url ( 'images/custom_logo_login/Pandora-FMS-1.png' ), false , [ 'class' => 'login_logo' , 'alt' => 'logo' , 'border' => 0 , 'title' => $logo_title ], false , true );
2019-01-30 16:18:44 +01:00
} else {
2020-02-28 11:38:41 +01:00
html_print_image ( ui_get_full_url ( 'images/custom_logo_login/' ) . $config [ 'custom_logo_login' ], false , [ 'class' => 'login_logo' , 'alt' => 'logo' , 'border' => 0 , 'title' => $logo_title ], false , true );
2019-01-30 16:18:44 +01:00
}
}
2017-04-19 13:26:20 +02:00
2019-01-30 16:18:44 +01:00
echo '</a></div>' ;
switch ( $login_screen ) {
case 'logout' :
case 'login' :
2021-07-22 09:34:58 +02:00
case 'disabled_access_node' :
2019-01-30 16:18:44 +01:00
if ( ! empty ( $page ) && ! empty ( $sec )) {
foreach ( $_POST as $key => $value ) {
2021-05-04 12:54:21 +02:00
html_print_input_hidden ( io_safe_input ( $key ), io_safe_input ( $value ));
2019-01-30 16:18:44 +01:00
}
}
if ( $config [ 'auth' ] == 'saml' ) {
2021-03-11 15:40:23 +01:00
echo '<div id="log_nick" class="login_nick invisible" >' ;
2019-01-30 16:18:44 +01:00
html_print_input_text_extended (
'nick' ,
'' ,
'nick' ,
'' ,
'' ,
'' ,
false ,
'' ,
'placeholder="' . __ ( 'User' ) . '"'
);
echo '</div>' ;
2021-03-11 15:40:23 +01:00
echo '<div id="log_pass" class="login_pass invisible">' ;
2019-01-30 16:18:44 +01:00
html_print_input_text_extended (
'pass' ,
'' ,
'pass' ,
'' ,
'' ,
'' ,
false ,
'' ,
'placeholder="' . __ ( 'Password' ) . '"' ,
false ,
true
);
echo '</div>' ;
2021-03-11 15:40:23 +01:00
echo '<div id="log_button" class="login_button invisible">' ;
2023-02-10 13:38:47 +01:00
html_print_submit_button ( __ ( 'Login as admin' ), 'login_button' , false , [ 'fixed_id' => 'submit-login_button' , 'class' => 'next_login' ]);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
2019-03-11 10:07:22 +01:00
echo '<div class="login_button" id="remove_button">' ;
2023-03-06 08:21:04 +01:00
html_print_submit_button (
__ ( 'Login as admin' ),
'input_saml' ,
false ,
[
'fixed_id' => 'submit-login_button' ,
'class' => 'next_login' ,
'onclick' => 'show_normal_menu()' ,
'id' => 'input_saml' ,
]
);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
2019-03-11 10:07:22 +01:00
echo '<div class="login_button login_button_saml">' ;
2023-03-06 08:21:04 +01:00
html_print_submit_button (
__ ( 'Login with SAML' ),
'login_button_saml' ,
false ,
[ 'class' => 'next_login secondary' ]
);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
} else {
2023-03-21 13:31:11 +01:00
echo '<div class="login_nick ' . $style_theme . '">' ;
2019-03-11 10:07:22 +01:00
html_print_input_text_extended (
'nick' ,
'' ,
'nick' ,
'' ,
'' ,
'' ,
false ,
'' ,
2023-03-17 11:33:50 +01:00
'autocomplete="off" class="input" placeholder=" "'
2019-03-11 10:07:22 +01:00
);
2023-03-17 11:33:50 +01:00
echo '<label for="nick" class="placeholder">' . __ ( 'User' ) . '</label>' ;
2019-01-30 16:18:44 +01:00
echo '</div>' ;
2023-03-21 13:31:11 +01:00
echo '<div class="login_pass ' . $style_theme . '">' ;
2019-03-11 10:07:22 +01:00
html_print_input_text_extended (
'pass' ,
'' ,
'pass' ,
'' ,
'' ,
'' ,
false ,
'' ,
2023-03-21 13:31:11 +01:00
'autocomplete="off" class="input " placeholder=" " style="background-image: url(images/enable.svg);"' ,
2019-03-11 10:07:22 +01:00
false ,
true
);
2023-03-17 11:33:50 +01:00
echo '<label for="pass" class="placeholder">' . __ ( 'Password' ) . '</label>' ;
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '<div class="login_button">' ;
2023-02-17 12:52:13 +01:00
html_print_submit_button (
2023-03-17 11:33:50 +01:00
__ ( 'Let's go' ),
2023-02-17 12:52:13 +01:00
'login_button' ,
false ,
2023-03-17 11:33:50 +01:00
[ 'fixed_id' => 'submit-login_button' ]
2023-02-17 12:52:13 +01:00
);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
}
break ;
case 'double_auth' :
if ( ! empty ( $page ) && ! empty ( $sec )) {
foreach ( $_POST as $key => $value ) {
html_print_input_hidden ( io_safe_input ( $key ), $value );
}
}
2023-03-21 13:31:11 +01:00
echo '<div class="login_nick ' . $style_theme . '">' ;
2019-01-30 16:18:44 +01:00
echo '<div>' ;
2023-02-20 11:27:20 +01:00
2019-01-30 16:18:44 +01:00
echo '</div>' ;
2023-03-17 11:33:50 +01:00
html_print_input_text_extended (
'auth_code' ,
'' ,
'auth_code' ,
'' ,
'' ,
'' ,
false ,
'' ,
'class="login login_password input" placeholder=" "' ,
false ,
true
);
echo '<label for="pass" class="placeholder">' . __ ( 'Authentication code' ) . '</label>' ;
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '<div class="login_button">' ;
2023-02-10 13:38:47 +01:00
// html_print_submit_button(__('Check code').' >', 'login_button', false, 'class="next_login"');
2023-03-17 11:33:50 +01:00
html_print_submit_button (
__ ( 'Check code' ),
'login_button' ,
false ,
[
'fixed_id' => 'submit-login_button' ,
'class' => 'next_login' ,
]
);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
break ;
default :
if ( isset ( $error_info )) {
echo '<h1 id="log_title">' . $error_info [ 'title' ] . '</h1>' ;
echo '<div id="error_buttons">' ;
echo '<a href="index.php">' . html_print_image ( $config [ 'homeurl' ] . '/images/refresh_white.png' , true , [ 'title' => __ ( 'Refresh' )], false , true ) . '</a>' ;
echo '<a href="javascript: modal_alert_critical()">' . html_print_image ( $config [ 'homeurl' ] . '/images/help_white.png' , true , [ 'title' => __ ( 'View details' )], false , true ) . '</a>' ;
echo '</div>' ;
echo '<div id="log_msg">' ;
echo $error_info [ 'message' ];
echo '</div>' ;
}
break ;
}
if ( $config [ 'enterprise_installed' ]) {
2022-01-12 17:16:02 +01:00
if ( $config [ 'reset_pass_option' ]) {
2019-01-30 16:18:44 +01:00
$reset_pass_link = 'reset_pass.php' ;
2019-03-11 10:07:22 +01:00
// Reset password link.
echo '<div class="reset_password">' ;
2022-01-12 17:16:02 +01:00
if (( ! $config [ 'centralized_management' ])) {
echo '<a href="index.php?reset=true&first=true">' . __ ( 'Forgot your password?' );
echo '</a>' ;
} else {
echo '<a href="javascript:centralized_mode_reset_dialog();">' . __ ( 'Forgot your password?' );
echo '</a>' ;
2023-02-20 09:54:48 +01:00
echo '<div id="centralized_mode_reset_dialog" title="' . __ ( 'Centralized mode' ) . '" style="display:none">' ;
2022-01-12 17:16:02 +01:00
echo '<div class="content_alert">' ;
echo '<div class="icon_message_alert">' ;
2023-02-20 09:54:48 +01:00
echo html_print_image ( 'images/icono_stop.png' , true , [ 'alt' => __ ( 'Centralized mode' ), 'border' => 0 ]);
2022-01-12 17:16:02 +01:00
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<p>' . __ ( 'This node is configured with centralized mode. Go to metaconsole to reset the password' ) . '</p>' ;
echo '</div>' ;
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2022-01-12 17:16:02 +01:00
echo '<div class="button_message_alert">' ;
2023-02-20 09:54:48 +01:00
html_print_submit_button ( 'Ok' , 'centralized_mode_reset_button' , false , [ 'class' => 'mini float-right' ]);
2022-01-12 17:16:02 +01:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
}
2019-01-30 16:18:44 +01:00
echo '</div>' ;
}
}
2023-02-17 12:52:13 +01:00
echo '
< div class = " loader " id = " spinner_login " >
< span ></ span >
< span ></ span >
< span ></ span >
< span ></ span >
</ div >
' ;
echo '<div id="ver_num">' . $pandora_version . (( $develop_bypass == 1 ) ? ' ' . __ ( 'Build' ) . ' ' . $build_version : '' ) . '</div>' ;
2021-05-21 13:59:54 +02:00
// CSRF validation.
2023-02-20 10:47:00 +01:00
if ( isset ( $_SESSION [ 'csrf_code' ]) === true ) {
unset ( $_SESSION [ 'csrf_code' ]);
}
2021-05-21 13:59:54 +02:00
html_print_csrf_hidden ();
2019-01-30 16:18:44 +01:00
echo '</form></div>' ;
echo '<div class="login_data">' ;
2017-04-19 13:26:20 +02:00
2023-03-17 11:33:50 +01:00
echo '<div class ="img_banner_login">' ;
2019-01-30 16:18:44 +01:00
if ( file_exists ( ENTERPRISE_DIR . '/load_enterprise.php' )) {
2023-02-17 12:52:13 +01:00
if ( empty ( $config [ 'custom_splash_login' ]) === false && $config [ 'custom_splash_login' ] !== 'default' ) {
2023-03-23 11:51:21 +01:00
if ( $config [ 'custom_splash_login' ] !== 'none.png' ) {
html_print_image (
'enterprise/images/custom_splash_login/' . $config [ 'custom_splash_login' ],
false ,
[
'class' => 'splash-logo' ,
'alt' => 'splash' ,
'border' => 0 ,
],
false ,
false
);
}
2019-01-30 16:18:44 +01:00
} else {
2023-02-17 12:52:13 +01:00
echo '
2023-03-17 11:33:50 +01:00
< div class = " loginimg-container " >
< div class = " lineone " ></ div >
< div class = " linetwo " ></ div >
< div class = " linethree " ></ div >
< div style = " display:flex; " >
< div class = " towerone " ></ div >
< div class = " towertwo " ></ div >
< div class = " towerthree " ></ div >
< div class = " towerfour " ></ div >
</ div >
2023-02-17 12:52:13 +01:00
</ div >
2023-03-17 11:33:50 +01:00
' ;
2019-01-30 16:18:44 +01:00
}
} else {
2023-02-17 12:52:13 +01:00
echo '
2023-03-17 11:33:50 +01:00
< div class = " loginimg-container " >
< div class = " lineone " ></ div >
< div class = " linetwo " ></ div >
< div class = " linethree " ></ div >
< div style = " display:flex; " >
< div class = " towerone " ></ div >
< div class = " towertwo " ></ div >
< div class = " towerthree " ></ div >
< div class = " towerfour " ></ div >
</ div >
2023-02-17 12:52:13 +01:00
</ div >
2023-03-17 11:33:50 +01:00
' ;
}
echo '</div>' ;
echo '<div class ="text_banner_login">' ;
2023-03-21 13:31:11 +01:00
echo '<div><span class="span1">' ;
2023-03-17 11:33:50 +01:00
if ( file_exists ( ENTERPRISE_DIR . '/load_enterprise.php' )) {
2023-03-21 13:31:11 +01:00
if ( $config [ 'custom_title1_login' ]) {
echo io_safe_output ( $config [ 'custom_title1_login' ]);
2023-03-17 11:33:50 +01:00
} else {
2023-03-22 18:57:36 +01:00
echo __ ( 'ONE TOOL TO RULE THEM ALL' );
2023-03-17 11:33:50 +01:00
}
} else {
2023-03-22 18:57:36 +01:00
echo __ ( 'ONE TOOL TO RULE THEM ALL' );
2019-01-30 16:18:44 +01:00
}
2023-03-21 13:31:11 +01:00
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' ]);
}
}
echo '</span></div>' ;
echo '</div>' ;
echo '</div>' ;
2017-03-15 10:12:18 +01:00
echo '</div>' ;
2017-03-21 11:44:46 +01:00
echo '</div>' ;
2012-03-27 19:00:55 +02:00
2019-02-12 17:45:25 +01:00
if ( empty ( $process_error_message ) && isset ( $mail )) {
2019-01-30 16:18:44 +01:00
echo '<div id="reset_correct" title="' . __ ( 'Password reset' ) . '">' ;
echo '<div class="content_alert">' ;
echo '<div class="icon_message_alert">' ;
echo html_print_image ( 'images/icono_logo_pandora.png' , true , [ 'alt' => __ ( 'Password reset' ), 'border' => 0 ]);
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<h1>' . __ ( 'INFO' ) . '</h1>' ;
echo '<p>' . __ ( 'An email has been sent to your email address' ) . '</p>' ;
echo '</div>' ;
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2019-01-30 16:18:44 +01:00
echo '<div class="button_message_alert">' ;
2023-02-20 09:54:48 +01:00
html_print_submit_button ( 'Ok' , 'reset_correct_button' , false , [ 'class' => 'mini float-right' ]);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2019-02-12 17:45:25 +01:00
} else if ( isset ( $process_error_message ) && ! empty ( $process_error_message )) {
2023-02-20 09:54:48 +01:00
echo '<div id="reset_correct" title="' . __ ( 'Error' ) . '">' ;
2019-01-30 16:18:44 +01:00
echo '<div class="content_alert">' ;
echo '<div class="icon_message_alert">' ;
2023-02-20 09:54:48 +01:00
echo html_print_image ( 'images/icono_stop.png' , true , [ 'alt' => __ ( 'Forbidden' ), 'border' => 0 ]);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<h1>' . __ ( 'ERROR' ) . '</h1>' ;
echo '<p>' . $process_error_message . '</p>' ;
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2019-01-30 16:18:44 +01:00
echo '</div>' ;
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2019-01-30 16:18:44 +01:00
echo '<div class="button_message_alert">' ;
2023-02-20 09:54:48 +01:00
html_print_submit_button ( 'Ok' , 'reset_correct_button' , false , [ 'class' => 'mini float-right' ]);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2017-04-19 13:26:20 +02:00
}
2017-04-20 12:36:33 +02:00
2018-10-15 10:32:24 +02:00
if ( isset ( $correct_reset_pass_process )) {
2019-01-30 16:18:44 +01:00
echo '<div id="final_process_correct" title="' . __ ( 'Password reset' ) . '">' ;
echo '<div class="content_alert">' ;
echo '<div class="icon_message_alert">' ;
echo html_print_image ( 'images/icono_logo_pandora.png' , true , [ 'alt' => __ ( 'Password reset' ), 'border' => 0 ]);
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<h1>' . __ ( 'SUCCESS' ) . '</h1>' ;
echo '<p>' . $correct_reset_pass_process . '</p>' ;
echo '</div>' ;
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2019-01-30 16:18:44 +01:00
echo '<div class="button_message_alert">' ;
2023-02-20 09:54:48 +01:00
html_print_submit_button ( 'Ok' , 'final_process_correct_button' , false , [ 'class' => 'mini float-right' ]);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2017-04-20 10:59:32 +02:00
}
2019-01-30 16:18:44 +01:00
if ( isset ( $login_failed )) {
2023-02-07 17:24:40 +01:00
$nick = io_safe_input ( get_parameter_post ( 'nick' ));
2023-02-08 11:59:20 +01:00
$user_in_db = db_get_row_filter (
'tusuario' ,
[ 'id_user' => $nick ],
'*'
);
$fails = $user_in_db [ 'failed_attempt' ];
2023-02-07 17:24:40 +01:00
// If user not exist, and attempts its enable, lets make array and fails attemps.
2023-02-08 11:59:20 +01:00
if ( $fails == false && $config [ 'enable_pass_policy' ] && $user_in_db === false ) {
2023-02-07 17:24:40 +01:00
$nick_array_error = json_decode ( base64_decode ( $config [ 'nicks_error' ]), true );
2023-02-08 11:59:20 +01:00
$nick = strtolower ( $nick );
2023-02-07 17:24:40 +01:00
if ( isset ( $nick_array_error [ $nick ]) !== false ) {
$nick_array_error [ $nick ] += 1 ;
} else {
$nick_array_error [ $nick ] = 1 ;
}
$fails = $nick_array_error [ $nick ];
2023-02-08 11:59:20 +01:00
// Save or update the array.
2023-02-07 17:24:40 +01:00
if ( $config [ 'nicks_error' ]) {
config_update_value ( 'nicks_error' , base64_encode ( json_encode ( $nick_array_error )));
} else {
config_create_value ( 'nicks_error' , base64_encode ( json_encode ( $nick_array_error )));
}
2023-02-08 11:59:20 +01:00
} else {
$fails = ++ $fails ;
2023-02-07 17:24:40 +01:00
}
2019-04-24 16:49:04 +02:00
$attemps = ( $config [ 'number_attempts' ] - $fails );
2023-02-07 17:24:40 +01:00
$attemps = ( $attemps < 0 ) ? 0 : $attemps ;
2019-01-30 16:18:44 +01:00
echo '<div id="login_failed" title="' . __ ( 'Login failed' ) . '">' ;
echo '<div class="content_alert">' ;
echo '<div class="icon_message_alert">' ;
echo html_print_image ( 'images/icono_stop.png' , true , [ 'alt' => __ ( 'Login failed' ), 'border' => 0 ]);
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<h1>' . __ ( 'ERROR' ) . '</h1>' ;
echo '<p>' . $config [ 'auth_error' ] . '</p>' ;
echo '</div>' ;
2019-08-30 11:28:24 +02:00
if ( $config [ 'enable_pass_policy' ]) {
echo '<div class="text_message_alert">' ;
2023-02-08 11:59:20 +01:00
if ( $attemps !== 0 && $user_in_db [ 'login_blocked' ] == 0 ) {
echo '<p><strong>' . __ ( 'Remaining attempts: ' ) . $attemps . '</strong></p>' ;
} else {
echo '<p><strong>' . __ ( 'User is blocked' ) . '</strong></p>' ;
}
2019-08-30 11:28:24 +02:00
echo '</div>' ;
}
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2019-01-30 16:18:44 +01:00
echo '<div class="button_message_alert">' ;
2023-02-20 09:54:48 +01:00
html_print_submit_button ( 'Ok' , 'hide-login-error' , false , [ 'class' => ' mini float-right' ]);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2017-03-15 10:12:18 +01:00
}
2019-01-30 16:18:44 +01:00
if ( $login_screen == 'logout' ) {
echo '<div id="login_logout" title="' . __ ( 'Logged out' ) . '">' ;
echo '<div class="content_alert">' ;
echo '<div class="icon_message_alert">' ;
echo html_print_image ( 'images/icono_logo_pandora.png' , true , [ 'alt' => __ ( 'Logged out' ), 'border' => 0 ]);
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<h1>' . __ ( 'Logged out' ) . '</h1>' ;
2020-10-19 10:59:46 +02:00
if ( empty ( $config [ 'logout_msg' ]) === true ) {
echo '<p>' . __ ( 'Your session has ended. Please close your browser window to close this %s session.' , get_product_name ()) . '</p>' ;
} else {
echo '<p>' . __ ( $config [ 'logout_msg' ]) . '</p>' ;
}
2019-01-30 16:18:44 +01:00
echo '</div>' ;
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2019-01-30 16:18:44 +01:00
echo '<div class="button_message_alert">' ;
2023-02-20 09:54:48 +01:00
html_print_submit_button ( 'Ok' , 'hide-login-logout' , false , [ 'class' => ' mini float-right' ]);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2012-03-27 19:00:55 +02:00
}
2012-01-27 13:48:18 +01:00
2021-07-22 09:34:58 +02:00
if ( $login_screen === 'disabled_access_node' ) {
echo '<div id="disabled_access_node" title="' . __ ( 'User node access not enabled' ) . '">' ;
echo '<div class="content_alert">' ;
echo '<div class="icon_message_alert">' ;
echo html_print_image ( 'images/icono_logo_pandora.png' , true , [ 'alt' => __ ( 'Centralized user in metaconsole' ), 'border' => 0 ]);
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<h1>' . __ ( 'Centralized user in metaconsole' ) . '</h1>' ;
echo '<p>' . __ ( 'This user does not have access on node, please enable node access on this user from metaconsole.' ) . '</p>' ;
echo '</div>' ;
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2021-07-22 09:34:58 +02:00
echo '<div class="button_message_alert">' ;
2023-02-20 09:54:48 +01:00
html_print_submit_button ( 'Ok' , 'hide-login-logout' , false , [ 'class' => 'mini float-right' ]);
2021-07-22 09:34:58 +02:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
}
2017-03-22 15:26:54 +01:00
switch ( $login_screen ) {
2019-01-30 16:18:44 +01:00
case 'error_dbconfig' :
2019-11-11 13:33:37 +01:00
case 'error_authconfig' :
2021-07-22 09:34:58 +02:00
case 'disabled_node_access' :
2019-11-11 13:33:37 +01:00
if ( ! isset ( $config [ 'rb_product_name_alt' ])) {
$title = __ ( 'Problem with %s database' , get_product_name ());
} else {
$title = __ ( 'Problem with %s database' , $config [ 'rb_product_name_alt' ]);
}
2019-01-30 16:18:44 +01:00
$message = __ (
' Cannot connect to the database , please check your database setup in the < b > include / config . php </ b > file .< i >< br />< br />
2017-03-22 15:26:54 +01:00
Probably your database , hostname , user or password values are incorrect or
2019-01-30 16:18:44 +01:00
the database server is not running . '
) . '<br /><br />' ;
$message .= '<span class="red">' ;
$message .= '<b>' . __ ( 'DB ERROR' ) . ':</b><br>' ;
$message .= db_get_last_error ();
$message .= '</span>' ;
if ( $error_code == 'error_authconfig' ) {
$message .= '<br/><br/>' ;
$message .= __ ( 'If you have modified the auth system, the origin of this problem could be that %s cannot override the authorization variables from the config database. Please remove them from your database by executing:<br><pre>DELETE FROM tconfig WHERE token = "auth";</pre>' , get_product_name ());
}
break ;
case 'error_emptyconfig' :
$title = __ ( 'Empty configuration table' );
$message = __ (
' Cannot load configuration variables from database . Please check your database setup in the
2018-05-09 18:50:45 +02:00
< b > include / config . php </ b > file .< i >< br >< br >
Most likely your database schema has been created but there are is no data in it , you have a problem with the database access credentials or your schema is out of date .
< br >< br >% s Console cannot find < i > include / config . php </ i > or this file has invalid
permissions and HTTP server cannot read it . Please read documentation to fix this problem .</ i > ' ,
2019-01-30 16:18:44 +01:00
get_product_name ()
) . '<br /><br />' ;
break ;
case 'error_noconfig' :
$title = __ ( 'No configuration file found' );
$message = __ (
' % s Console cannot find < i > include / config . php </ i > or this file has invalid
permissions and HTTP server cannot read it . Please read documentation to fix this problem . ' ,
get_product_name ()
) . '<br /><br />' ;
if ( file_exists ( 'install.php' )) {
$link_start = '<a href="install.php">' ;
$link_end = '</a>' ;
} else {
$link_start = '' ;
$link_end = '' ;
}
$message .= sprintf ( __ ( 'You may try to run the %s<b>installation wizard</b>%s to create one.' ), $link_start , $link_end );
break ;
case 'error_install' :
$title = __ ( 'Installer active' );
$message = __ (
' For security reasons , normal operation is not possible until you delete installer file .
Please delete the < i >./ install . php </ i > file before running % s Console . ' ,
get_product_name ()
);
break ;
case 'error_perms' :
$title = __ ( 'Bad permission for include/config.php' );
$message = __ (
' For security reasons , < i > config . php </ i > must have restrictive permissions , and " other " users
2017-03-22 15:26:54 +01:00
should not read it or write to it . It should be written only for owner
( usually www - data or http daemon user ), normal operation is not possible until you change
2019-01-30 16:18:44 +01:00
permissions for < i > include / config . php </ i > file . Please do it , it is for your security . '
);
break ;
case 'homedir_bad_defined' :
$title = __ ( 'Bad defined homedir' );
$message = __ ( 'In the config.php file in the variable $config["homedir"] = add the correct path' );
break ;
case 'homeurl_bad_defined' :
$title = __ ( 'Bad defined homeurl or homeurl_static' );
$message = __ ( 'In the config.php file in the variable $config["homeurl"] or $config["homeurl_static"] = add the correct path' );
break ;
2017-03-22 15:26:54 +01:00
}
2019-01-30 16:18:44 +01:00
if ( $login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig' || $login_screen == 'error_install'
|| $login_screen == 'error_dbconfig' || $login_screen == 'error_noconfig' || $login_screen == 'error_perms'
|| $login_screen == 'homedir_bad_defined' || $login_screen == 'homeurl_bad_defined'
) {
echo '<div id="modal_alert" title="' . __ ( 'Login failed' ) . '">' ;
echo '<div class="content_alert">' ;
echo '<div class="icon_message_alert">' ;
echo html_print_image ( 'images/icono_stop.png' , true , [ 'alt' => __ ( 'Login failed' ), 'border' => 0 ]);
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<h1>' . $title . '</h1>' ;
echo '<p> ' . $message . '</h1>' ;
echo '</div>' ;
2023-02-20 09:54:48 +01:00
echo '<br>' ;
2019-01-30 16:18:44 +01:00
echo '<div class="button_message_alert">' ;
2023-02-20 09:54:48 +01:00
html_print_submit_button ( 'Ok' , 'hide-login-error' , false , [ 'class' => 'mini float-right' ]);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2017-03-22 15:26:54 +01:00
}
2019-01-30 16:18:44 +01:00
ui_require_css_file ( 'dialog' );
2019-02-07 08:59:45 +01:00
ui_require_css_file ( 'jquery-ui.min' , 'include/styles/js/' );
2018-11-07 17:09:42 +01:00
ui_require_jquery_file ( 'jquery-ui.min' );
2019-06-03 11:55:56 +02:00
ui_require_jquery_file ( 'jquery-ui_custom' );
2012-03-27 19:00:55 +02:00
?>
2012-01-27 13:48:18 +01:00
2012-09-06 Miguel de Dios <miguel.dedios@artica.es>
* general/header.php, general/login_page.php,
godmode/setup/setup.php, include/functions_ui.php,
include/functions_graph.php, include/functions_html.php,
include/graphs/fgraph.php, include/graphs/functions_pchart.php,
include/graphs/functions_flot.php, include/functions_reporting.php,
include/functions_visual_map.php, include/functions_config.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php,
operation/agentes/tactical.php, operation/menu.php,
operation/events/events.php: added the feature to set a
public url for inverse proxy or for example mod_proxy of Apache.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6936 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-06 19:01:22 +02:00
< ? php
2019-03-11 10:07:22 +01:00
// Hidden div to forced title.
2019-01-30 16:18:44 +01:00
html_print_div ([ 'id' => 'forced_title_layer' , 'class' => 'forced_title_layer' , 'hidden' => true ]);
2013-04-22 12:31:20 +02:00
2019-01-30 16:18:44 +01:00
// html_print_div(array('id' => 'modal_alert', 'hidden' => true));
2015-03-16 15:21:18 +01:00
?>
2019-01-30 16:18:44 +01:00
< script type = " text/javascript " language = " javascript " >
function show_normal_menu () {
document . getElementById ( 'input_saml' ) . style . display = 'none' ;
document . getElementById ( 'log_nick' ) . style . display = 'block' ;
document . getElementById ( 'log_pass' ) . style . display = 'block' ;
document . getElementById ( 'log_button' ) . style . display = 'block' ;
document . getElementById ( 'remove_button' ) . style . display = 'none' ;
document . getElementById ( 'log_nick' ) . className = 'login_nick' ;
document . getElementById ( 'log_pass' ) . className = 'login_pass' ;
}
switch ( " <?php echo $login_screen ; ?> " ) {
case 'error_authconfig' :
case 'error_dbconfig' :
case 'error_emptyconfig' :
case 'error_noconfig' :
case 'error_install' :
case 'error_perms' :
case 'homedir_bad_defined' :
case 'homeurl_bad_defined' :
// Auto popup
$ ( document ) . ready ( function () {
$ ( function () {
$ ( " #modal_alert " ) . dialog ({
title : $ ( '#log_title' ) . html (),
resizable : true ,
draggable : false ,
modal : true ,
width : 600 ,
overlay : {
opacity : 0.5 ,
background : " black "
}
});
});
2023-02-17 12:52:13 +01:00
$ ( " #button-hide-login-error " ) . click ( function () {
2019-01-30 16:18:44 +01:00
$ ( " #modal_alert " ) . dialog ( 'close' );
});
});
break ;
case 'logout' :
$ ( document ) . ready ( function () {
$ ( function () {
$ ( " #login_logout " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
width : 528 ,
clickOutside : true ,
overlay : {
opacity : 0.5 ,
2021-07-22 09:34:58 +02:00
background : " black "
2023-02-20 09:54:48 +01:00
},
open : function ( event , ui ) {
$ ( " .ui-widget-overlay " ) . click ( function () {
$ ( '#login_logout' ) . dialog ( 'close' );
});
2021-07-22 09:34:58 +02:00
}
});
});
2023-02-13 14:25:34 +01:00
$ ( " #button-hide-login-logout " ) . click ( function () {
2023-02-20 09:54:48 +01:00
$ ( " #login_logout " ) . dialog ( " close " );
});
2021-07-22 09:34:58 +02:00
});
break ;
case 'disabled_access_node' :
$ ( document ) . ready ( function () {
$ ( function () {
$ ( " #disabled_access_node " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
width : 528 ,
clickOutside : true ,
overlay : {
opacity : 0.5 ,
2019-01-30 16:18:44 +01:00
background : " black "
}
});
});
2023-02-13 14:25:34 +01:00
$ ( " #button-hide-login-logout " ) . click ( function () {
2021-06-16 10:15:53 +02:00
document . location = " <?php echo ui_get_full_url('index.php'); ?> " ;
2019-01-30 16:18:44 +01:00
});
});
break ;
default :
$ ( document ) . ready ( function () {
// IE9- modal warning window
$ ( function () {
$ ( " #dialog " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
width : 700 ,
overlay : {
opacity : 0.5 ,
background : " black "
}
});
});
$ ( " #close-dialog-browser " ) . click ( function () {
$ ( " #dialog " ) . dialog ( 'close' );
});
$ ( function () {
$ ( " #login_failed " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
2023-02-07 17:24:40 +01:00
height : 230 ,
width : 530 ,
2019-01-30 16:18:44 +01:00
overlay : {
opacity : 0.5 ,
background : " black "
}
});
});
2023-02-17 12:52:13 +01:00
$ ( " #button-hide-login-error " ) . click ( function () {
2019-01-30 16:18:44 +01:00
$ ( " #login_failed " ) . dialog ( 'close' );
$ ( " #login_correct_pass " ) . dialog ( 'close' );
});
});
$ ( '#nick' ) . focus ();
break ;
}
$ ( document ) . ready ( function () {
$ ( function () {
$ ( " #reset_correct " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
width : 528 ,
clickOutside : true ,
overlay : {
opacity : 0.5 ,
background : " black "
}
});
});
2023-02-17 12:52:13 +01:00
$ ( " #button-reset_correct_button " ) . click ( function () {
2019-01-30 16:18:44 +01:00
$ ( " #reset_correct " ) . dialog ( 'close' );
});
});
$ ( document ) . ready ( function () {
$ ( function () {
$ ( " #final_process_correct " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
width : 528 ,
clickOutside : true ,
overlay : {
opacity : 0.5 ,
background : " black "
}
});
});
$ ( " #submit-final_process_correct_button " ) . click ( function () {
$ ( " #final_process_correct " ) . dialog ( 'close' );
});
});
2019-04-24 17:11:02 +02:00
2022-01-12 17:16:02 +01:00
function centralized_mode_reset_dialog () {
$ ( " #centralized_mode_reset_dialog " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
width : 528 ,
overlay : {
opacity : 0.5 ,
background : " black "
}
});
$ ( " #submit-centralized_mode_reset_button " ) . click ( function () {
$ ( " #centralized_mode_reset_dialog " ) . dialog ( 'close' );
});
}
2023-02-17 12:52:13 +01:00
$ ( document ) . ready ( function () {
$ ( '#submit-login_button span' ) . removeAttr ( 'style' );
$ ( '#spinner_login' ) . hide ();
});
$ ( '#submit-login_button' ) . click ( function ( e ) {
$ ( '.login_nick' ) . hide ();
$ ( '.login_pass' ) . hide ();
$ ( '.login_button' ) . hide ();
$ ( '.reset_password' ) . hide ();
$ ( '#spinner_login' ) . show ();
});
2019-01-30 16:18:44 +01:00
/* ]]> */
2013-04-22 12:31:20 +02:00
</ script >