2006-03-27 05:37:27 +02:00
< ? php
2006-10-04 18:15:20 +02:00
2009-06-08 20:26:14 +02:00
// Pandora FMS - http://pandorafms.com
// ==================================================
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
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// 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
2019-02-05 09:23:53 +01:00
ui_require_css_file ( 'login' );
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
2018-01-08 13:01:29 +01:00
2019-01-30 16:18:44 +01:00
if ( $config [ 'visual_animation' ]) {
echo ' < style >
2018-01-08 13:01:29 +01:00
@ keyframes login_move {
2019-01-30 16:18:44 +01:00
from { margin - left : 10 % ; margin - right : 10 % ; opacity : 0.1 }
to { margin - left : 5 % ; margin - right : 5 % ; opacity : 1 }
2018-01-08 13:01:29 +01:00
}
div . container_login {
animation - name : login_move ;
animation - duration : 3 s ;
}
</ 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' :
$logo_link = 'http://www.pandorafms.com' ;
$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' :
$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-12-16 16:39:13 +01:00
$login_body_class = '' ;
2019-03-11 10:07:22 +01:00
// Overrides the default background with the defined by the user.
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
if ( ! empty ( $config [ 'login_background' ])) {
2019-01-30 16:18:44 +01:00
$background_url = 'images/backgrounds/' . $config [ 'login_background' ];
2019-03-11 10:07:22 +01:00
$login_body_style = " style= \" background:linear-gradient(74deg, #02020255 36%, transparent 36%), url(' " . $background_url . " '); \" " ;
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 ) {
$login_body_class = " class='login_body_trident' " ;
}
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 ;
}
}
}
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 ();
2019-12-16 16:39:13 +01:00
echo '<div id="login_body" ' . $login_body_class . ' ' . $login_body_style . '>' ;
2017-03-15 10:12:18 +01:00
echo '<div id="header_login">' ;
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 ) {
echo '<li><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
}
2019-11-21 11:14:50 +01:00
echo '<li><a href="' . ui_get_full_external_url ( $config [ 'custom_docs_url' ]) . '" target="_blank">' . __ ( 'Docs' ) . '</li>' ;
} else if ( ! $custom_conf_enabled ) {
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank"><img src="' . $docs_logo . '" alt="docs"></a></li>' ;
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank">' . __ ( 'Docs' ) . '</li>' ;
}
if ( isset ( $config [ 'custom_support_url' ])) {
if ( file_exists ( ENTERPRISE_DIR . '/load_enterprise.php' )) {
if ( $support_logo !== false ) {
echo '<li id="li_margin_left"><a href="' . ui_get_full_external_url ( $config [ 'custom_support_url' ]) . '" target="_blank"><img src="' . $support_logo . '" alt="support"></a></li>' ;
}
echo '<li><a href="' . ui_get_full_external_url ( $config [ 'custom_support_url' ]) . '" target="_blank">' . __ ( 'Support' ) . '</li>' ;
} else {
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="' . $support_logo . '" alt="support"></a></li>' ;
echo '<li>' . __ ( 'Support' ) . '</li>' ;
}
} else if ( ! $custom_conf_enabled ) {
echo '<li id="li_margin_left"><a href="https://support.artica.es" target="_blank"><img src="' . $support_logo . '" alt="support"></a></li>' ;
echo '<li><a href="https://support.artica.es" target="_blank">' . __ ( 'Docs' ) . '</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">' ;
2019-01-30 16:18:44 +01:00
echo '<form method="post" action="' . ui_get_full_url ( 'index.php' . $url ) . '" ><div class="login_logo_icon">' ;
echo '<a href="' . $logo_link . '">' ;
if ( defined ( 'METACONSOLE' )) {
if ( ! isset ( $config [ 'custom_logo_login' ])) {
2020-02-28 11:38:41 +01:00
html_print_image ( ui_get_full_url ( 'images/custom_logo_login/login_logo.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
}
} else if ( file_exists ( ENTERPRISE_DIR . '/load_enterprise.php' )) {
if ( ! isset ( $config [ 'custom_logo_login' ])) {
2020-02-28 11:38:41 +01:00
html_print_image ( ui_get_full_url ( 'enterprise/images/custom_logo_login/login_logo_v7.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 ) {
html_print_image ( ui_get_full_url ( 'images/custom_logo_login/pandora_logo.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
}
2019-03-11 10:07:22 +01:00
// I comment this in case in the future we put a logo without text.
// echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";.
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' :
if ( ! empty ( $page ) && ! empty ( $sec )) {
foreach ( $_POST as $key => $value ) {
html_print_input_hidden ( io_safe_input ( $key ), $value );
}
}
if ( $config [ 'auth' ] == 'saml' ) {
echo '<div id="log_nick" class="login_nick" style="display: none;">' ;
html_print_input_text_extended (
'nick' ,
'' ,
'nick' ,
'' ,
'' ,
'' ,
false ,
'' ,
'placeholder="' . __ ( 'User' ) . '"'
);
echo '</div>' ;
echo '<div id="log_pass" class="login_pass" style="display: none;">' ;
html_print_input_text_extended (
'pass' ,
'' ,
'pass' ,
'' ,
'' ,
'' ,
false ,
'' ,
'placeholder="' . __ ( 'Password' ) . '"' ,
false ,
true
);
echo '</div>' ;
2019-03-11 10:07:22 +01:00
echo '<div id="log_button" class="login_button" style="display: none;">' ;
2019-05-30 11:12:37 +02:00
html_print_submit_button ( __ ( 'Login as admin' ), 'login_button' , false , '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">' ;
2019-01-30 16:18:44 +01:00
echo '<input type="button" id="input_saml" value="Login as admin" onclick="show_normal_menu()">' ;
echo '</div>' ;
2019-03-11 10:07:22 +01:00
echo '<div class="login_button login_button_saml">' ;
2019-01-30 16:18:44 +01:00
html_print_submit_button ( __ ( 'Login with SAML' ), 'login_button_saml' , false , '' );
echo '</div>' ;
} else {
echo '<div class="login_nick">' ;
2019-03-11 10:07:22 +01:00
html_print_input_text_extended (
'nick' ,
'' ,
'nick' ,
'' ,
'' ,
'' ,
false ,
'' ,
'autocomplete="off" placeholder="' . __ ( 'User' ) . '"'
);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '<div class="login_pass">' ;
2019-03-11 10:07:22 +01:00
html_print_input_text_extended (
'pass' ,
'' ,
'pass' ,
'' ,
'' ,
'' ,
false ,
'' ,
'autocomplete="off" placeholder="' . __ ( 'Password' ) . '"' ,
false ,
true
);
2019-01-30 16:18:44 +01:00
echo '</div>' ;
echo '<div class="login_button">' ;
2019-05-30 11:12:37 +02:00
html_print_submit_button ( __ ( 'Login' ), 'login_button' , false , 'class="next_login"' );
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 );
}
}
echo '<div class="login_nick">' ;
echo '<div>' ;
html_print_image ( '/images/icono_autenticacion.png' , false );
echo '</div>' ;
html_print_input_text_extended ( 'auth_code' , '' , 'auth_code' , '' , '' , '' , false , '' , 'class="login login_password" placeholder="' . __ ( 'Authentication code' ) . '"' , false , true );
echo '</div>' ;
echo '<div class="login_button">' ;
2019-05-30 11:12:37 +02:00
html_print_submit_button ( __ ( 'Check code' ) . ' >' , 'login_button' , false , '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' ]) {
if ( $config [ 'reset_pass_option' ]) {
$reset_pass_link = 'reset_pass.php' ;
2019-03-11 10:07:22 +01:00
// Reset password link.
echo '<div class="reset_password">' ;
echo '<a href="index.php?reset=true&first=true">' . __ ( 'Forgot your password?' );
2019-01-30 16:18:44 +01:00
echo '</a>' ;
echo '</div>' ;
}
}
echo '</form></div>' ;
echo '<div class="login_data">' ;
echo '<div class ="text_banner_login">' ;
echo '<div><span class="span1 pandora_upper">' ;
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">' ;
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' );
}
2017-04-19 13:26:20 +02:00
2019-01-30 16:18:44 +01:00
echo '</span></div>' ;
echo '</div>' ;
echo '<div class ="img_banner_login">' ;
if ( file_exists ( ENTERPRISE_DIR . '/load_enterprise.php' )) {
if ( isset ( $config [ 'custom_splash_login' ])) {
2019-03-26 19:29:48 +01:00
html_print_image ( 'enterprise/images/custom_splash_login/' . $config [ 'custom_splash_login' ], false , [ 'alt' => 'splash' , 'border' => 0 ], false , true );
2019-01-30 16:18:44 +01:00
} else {
2019-03-26 19:29:48 +01:00
html_print_image ( 'enterprise/images/custom_splash_login/splash_image_default.png' , false , [ 'alt' => 'logo' , 'border' => 0 ], false , true );
2019-01-30 16:18:44 +01:00
}
} else {
2019-03-26 19:29:48 +01:00
html_print_image ( 'images/splash_image_default.png' , false , [ 'alt' => 'logo' , 'border' => 0 ], false , true );
2019-01-30 16:18:44 +01:00
}
echo '</div>' ;
echo '</div>' ;
2017-03-15 10:12:18 +01:00
echo '</div>' ;
2019-01-30 16:18:44 +01:00
echo '<div id="ver_num">' . $pandora_version . (( $develop_bypass == 1 ) ? ' ' . __ ( 'Build' ) . ' ' . $build_version : '' ) . '</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>' ;
echo '<div class="button_message_alert">' ;
html_print_submit_button ( 'Ok' , 'reset_correct_button' , false );
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 )) {
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_stop.png' , true , [ 'alt' => __ ( 'Password reset' ), 'border' => 0 ]);
echo '</div>' ;
echo '<div class="content_message_alert">' ;
echo '<div class="text_message_alert">' ;
echo '<h1>' . __ ( 'ERROR' ) . '</h1>' ;
echo '<p>' . $process_error_message . '</p>' ;
echo '</div>' ;
echo '<div class="button_message_alert">' ;
html_print_submit_button ( 'Ok' , 'reset_correct_button' , false );
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>' ;
echo '<div class="button_message_alert">' ;
html_print_submit_button ( 'Ok' , 'final_process_correct_button' , false );
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 )) {
2019-04-24 16:49:04 +02:00
$nick = get_parameter_post ( 'nick' );
$fails = db_get_value ( 'failed_attempt' , 'tusuario' , 'id_user' , $nick );
$attemps = ( $config [ 'number_attempts' ] - $fails );
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">' ;
echo '<p><strong>Remaining attempts: ' . $attemps . '</strong></p>' ;
echo '</div>' ;
}
2019-01-30 16:18:44 +01:00
echo '<div class="button_message_alert">' ;
html_print_submit_button ( 'Ok' , 'hide-login-error' , false );
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>' ;
echo '<p>' . __ ( 'Your session has ended. Please close your browser window to close this %s session.' , get_product_name ()) . '</p>' ;
echo '</div>' ;
echo '<div class="button_message_alert">' ;
html_print_submit_button ( 'Ok' , 'hide-login-logout' , false );
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2012-03-27 19:00:55 +02:00
}
2012-01-27 13:48:18 +01:00
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' :
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>' ;
echo '<div class="button_message_alert">' ;
html_print_submit_button ( 'Ok' , 'hide-login-error' , false );
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 "
}
});
});
$ ( " #submit-hide-login-error " ) . click ( function () {
$ ( " #modal_alert " ) . dialog ( 'close' );
});
});
break ;
case 'logout' :
$ ( document ) . ready ( function () {
$ ( function () {
$ ( " #login_logout " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
height : 220 ,
width : 528 ,
clickOutside : true ,
overlay : {
opacity : 0.5 ,
background : " black "
}
});
});
$ ( " #submit-hide-login-logout " ) . click ( function () {
$ ( " #login_logout " ) . dialog ( 'close' );
});
});
break ;
default :
$ ( document ) . ready ( function () {
// IE9- modal warning window
$ ( function () {
$ ( " #dialog " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
height : 400 ,
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 ,
height : 220 ,
width : 528 ,
overlay : {
opacity : 0.5 ,
background : " black "
}
});
});
$ ( " #submit-hide-login-error " ) . click ( function () {
$ ( " #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 ,
height : 220 ,
width : 528 ,
clickOutside : true ,
overlay : {
opacity : 0.5 ,
background : " black "
}
});
});
$ ( " #submit-reset_correct_button " ) . click ( function () {
$ ( " #reset_correct " ) . dialog ( 'close' );
});
});
$ ( document ) . ready ( function () {
$ ( function () {
$ ( " #final_process_correct " ) . dialog ({
resizable : true ,
draggable : true ,
modal : true ,
height : 220 ,
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
2019-01-30 16:18:44 +01:00
/* ]]> */
2013-04-22 12:31:20 +02:00
</ script >