:root {'; if ($config['style'] === 'pandora') { echo '--login-background-color: rgba(255, 255, 255, 0.50);'; 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 '} '; if ($config['visual_animation']) { // form#login_form, div.login_data { echo ''; } if (!isset($login_screen)) { $login_screen = 'login'; } switch ($login_screen) { 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': case 'disabled_access_node': $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; } $splash_title = __('Splash login'); $url = '?login=1'; // 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); } } $login_body_style = ''; // Overrides the default background with the defined by the user. $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]; $background_100 = 'background-size: cover !important; background-position: center !important; '; } if (empty($config['login_background']) === false) { $background_url = 'images/backgrounds/'.$config['login_background']; $background_100 = 'background-size: cover !important; background-position: center !important; '; } // Support for Internet Explorer and Microsoft Edge browsers if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') !== false) { $background_url = 'images/backgrounds/background_pandora_console_keys.jpg'; $background_100 = ''; } if (empty($config['background_opacity']) === false) { $opacity = $config['background_opacity']; } else { $opacity = 30; } 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 = [ 'custom_logo_login', 'custom_splash_login', 'custom_title1_login', 'custom_title2_login', 'rb_product_name', 'custom_docs_url', 'custom_support_url', ]; foreach ($custom_fields as $field) { if (!isset($config[$field])) { if (isset($config[$field.'_alt'])) { $config[$field] = $config[$field.'_alt']; $custom_conf_enabled = true; } } } // Get the custom icons. $docs_logo = ui_get_docs_logo(); $support_logo = ui_get_support_logo(); echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; if (empty($process_error_message) && isset($mail)) { echo '
'; echo '
'; echo '
'; echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Password reset'), 'border' => 0]); echo '
'; echo '
'; echo '
'; echo '

'.__('INFO').'

'; echo '

'.__('An email has been sent to your email address').'

'; echo '
'; echo '
'; echo '
'; html_print_submit_button('Ok', 'reset_correct_button', false, ['class' => 'mini float-right']); echo '
'; echo '
'; echo '
'; echo '
'; } else if (isset($process_error_message) && !empty($process_error_message)) { echo '
'; echo '
'; echo '
'; echo html_print_image('images/icono_stop.png', true, ['alt' => __('Forbidden'), 'border' => 0]); echo '
'; echo '
'; echo '
'; echo '

'.__('ERROR').'

'; echo '

'.$process_error_message.'

'; echo '
'; echo '
'; echo '
'; echo '
'; html_print_submit_button('Ok', 'reset_correct_button', false, ['class' => 'mini float-right']); echo '
'; echo '
'; echo '
'; echo '
'; } if (isset($correct_reset_pass_process)) { echo '
'; echo '
'; echo '
'; echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Password reset'), 'border' => 0]); echo '
'; echo '
'; echo '
'; echo '

'.__('SUCCESS').'

'; echo '

'.$correct_reset_pass_process.'

'; echo '
'; echo '
'; echo '
'; html_print_submit_button('Ok', 'final_process_correct_button', false, ['class' => 'mini float-right']); echo '
'; echo '
'; echo '
'; echo '
'; } if (isset($login_failed)) { $nick = io_safe_input(get_parameter_post('nick')); $user_in_db = db_get_row_filter( 'tusuario', ['id_user' => $nick], '*' ); $fails = $user_in_db['failed_attempt']; // If user not exist, and attempts its enable, lets make array and fails attemps. if ($fails == false && $config['enable_pass_policy'] && $user_in_db === false) { $nick_array_error = json_decode(base64_decode($config['nicks_error']), true); $nick = strtolower($nick); if (isset($nick_array_error[$nick]) !== false) { $nick_array_error[$nick] += 1; } else { $nick_array_error[$nick] = 1; } $fails = $nick_array_error[$nick]; // Save or update the array. 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))); } } else { $fails = ++$fails; } $attemps = ($config['number_attempts'] - $fails); $attemps = ($attemps < 0) ? 0 : $attemps; echo '
'; echo '
'; echo '
'; echo html_print_image('images/icono_stop.png', true, ['alt' => __('Login failed'), 'border' => 0]); echo '
'; echo '
'; echo '
'; echo '

'.__('ERROR').'

'; echo '

'.$config['auth_error'].'

'; echo '
'; if ($config['enable_pass_policy']) { echo '
'; if ($attemps !== 0 && $user_in_db['login_blocked'] == 0) { echo '

'.__('Remaining attempts: ').$attemps.'

'; } else { echo '

'.__('User is blocked').'

'; } echo '
'; } echo '
'; echo '
'; html_print_submit_button('Ok', 'hide-login-error', false, ['class' => ' mini float-right']); echo '
'; echo '
'; echo '
'; echo '
'; } if ($login_screen == 'logout') { echo '
'; echo '
'; echo '
'; echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Logged out'), 'border' => 0]); echo '
'; echo '
'; echo '
'; echo '

'.__('Logged out').'

'; if (empty($config['logout_msg']) === true) { echo '

'.__('Your session has ended. Please close your browser window to close this %s session.', get_product_name()).'

'; } else { echo '

'.__($config['logout_msg']).'

'; } echo '
'; echo '
'; echo '
'; html_print_submit_button('Ok', 'hide-login-logout', false, ['class' => ' mini float-right']); echo '
'; echo '
'; echo '
'; echo '
'; } if ($login_screen === 'disabled_access_node') { echo '
'; echo '
'; echo '
'; echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Centralized user in metaconsole'), 'border' => 0]); echo '
'; echo '
'; echo '
'; echo '

'.__('Centralized user in metaconsole').'

'; echo '

'.__('This user does not have access on node, please enable node access on this user from metaconsole.').'

'; echo '
'; echo '
'; echo '
'; html_print_submit_button('Ok', 'hide-login-logout', false, ['class' => 'mini float-right']); echo '
'; echo '
'; echo '
'; echo '
'; } switch ($login_screen) { case 'error_dbconfig': case 'error_authconfig': case 'disabled_node_access': 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']); } $message = __( 'Cannot connect to the database, please check your database setup in the include/config.php file.

Probably your database, hostname, user or password values are incorrect or the database server is not running.' ).'

'; $message .= ''; $message .= ''.__('DB ERROR').':
'; $message .= db_get_last_error(); $message .= '
'; if ($error_code == 'error_authconfig') { $message .= '

'; $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:
DELETE FROM tconfig WHERE token = "auth";
', 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 include/config.php file.

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.

%s Console cannot find include/config.php or this file has invalid permissions and HTTP server cannot read it. Please read documentation to fix this problem.
', get_product_name() ).'

'; break; case 'error_noconfig': $title = __('No configuration file found'); $message = __( '%s Console cannot find include/config.php or this file has invalid permissions and HTTP server cannot read it. Please read documentation to fix this problem.', get_product_name() ).'

'; if (file_exists('install.php')) { $link_start = ''; $link_end = ''; } else { $link_start = ''; $link_end = ''; } $message .= sprintf(__('You may try to run the %sinstallation wizard%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 ./install.php file before running %s Console.', get_product_name() ); break; case 'error_perms': $title = __('Bad permission for include/config.php'); $message = __( 'For security reasons, config.php must have restrictive permissions, and "other" users 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 permissions for include/config.php 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; } 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 ''; } ui_require_css_file('dialog'); ui_require_css_file('jquery-ui.min', 'include/styles/js/'); ui_require_jquery_file('jquery-ui.min'); ui_require_jquery_file('jquery-ui_custom'); ?> 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]); // html_print_div(array('id' => 'modal_alert', 'hidden' => true)); ?>