new header and menu

Former-commit-id: 975b72219cb07e0d4f9b332607e554bd65ea7cc3
This commit is contained in:
Tatiana Llorente 2019-02-26 10:43:59 +01:00
parent 6ec148c59c
commit 3e87c8e931
8 changed files with 589 additions and 360 deletions

View File

@ -1,16 +1,19 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Pandora FMS - http://pandorafms.com
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas * ==================================================
// Please see http://pandorafms.org for full contribution list * Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// This program is free software; you can redistribute it and/or * Please see http://pandorafms.org for full contribution list
// modify it under the terms of the GNU General Public License * This program is free software; you can redistribute it and/or
// as published by the Free Software Foundation; version 2 * modify it under the terms of the GNU General Public License
// This program is distributed in the hope that it will be useful, * as published by the Free Software Foundation; version 2
// but WITHOUT ANY WARRANTY; without even the implied warranty of * This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of
// GNU General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
if (isset($_SERVER['REQUEST_TIME'])) { if (isset($_SERVER['REQUEST_TIME'])) {
$time = $_SERVER['REQUEST_TIME']; $time = $_SERVER['REQUEST_TIME'];
} else { } else {

View File

@ -13,6 +13,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
require_once 'include/functions_messages.php'; require_once 'include/functions_messages.php';
require_once 'include/functions_servers.php'; require_once 'include/functions_servers.php';
require_once 'include/functions_notifications.php';
// Check permissions // Check permissions
// Global errors/warnings checking. // Global errors/warnings checking.

View File

@ -23,26 +23,30 @@ if (! isset($config['id_user'])) {
Cambiar $config['classic_menu'] Cambiar $config['classic_menu']
¿¿¿donde??? ¿donde la repeticion? ¿¿¿donde??? ¿donde la repeticion?
*/ */
/*
var type_menu = "<?php echo $config['classic_menu']; ?>"; var type_menu = "
<?php
// echo $config['classic_menu'];
?>
";
if(type_menu){ if(type_menu){
console.log('es clasico, mantenlo'); console.log('es clasico, mantenlo');
} }
else{ else{
console.log('es colapsado, mantenlo'); console.log('es collapsed, mantenlo');
} }
*/
//Asignar por defecto colapsado !!! IMPORTANTE!!!!!!!!!!!!!!!!!!!!!!!!! //Asignar por defecto collapsed !!! IMPORTANTE!!!!!!!!!!!!!!!!!!!!!!!!!
$(document).ready(function(){ $(document).ready(function(){
var variable_boton = localStorage.getItem("variable"); var menuType_value = localStorage.getItem("menuType");
document.getElementById("menu_type").innerHTML = variable_boton; document.getElementById("menu_type").innerHTML = menuType_value;
if ($('#menu_type').text() == 'colapsado' || $('#menu_type').text() == '') { if ($('#menu_type').text() == 'collapsed' || $('#menu_type').text() == '') {
if($('#menu_type').text() == ''){ if($('#menu_type').text() == ''){
localStorage.setItem("variable", "colapsado"); localStorage.setItem("menuType", "collapsed");
document.getElementById("menu_type").innerHTML = localStorage.variable; document.getElementById("menu_type").innerHTML = localStorage.menuType;
} }
$('#menu_full').removeClass('menu_full_classic').addClass('menu_full_collapsed'); $('#menu_full').removeClass('menu_full_classic').addClass('menu_full_collapsed');
@ -58,7 +62,7 @@ $(document).ready(function(){
$('li.menu_icon').removeClass("no_hidden_menu").addClass('menu_icon_collapsed');//PROBLEMA Y TB SBMENU NO HIDDEN $('li.menu_icon').removeClass("no_hidden_menu").addClass('menu_icon_collapsed');//PROBLEMA Y TB SBMENU NO HIDDEN
$('#top_btn').css('left', '0px'); $('#top_btn').css('left', '0px');
} }
else if ($('#menu_type').text() == 'clasico') { else if ($('#menu_type').text() == 'classic') {
$('#menu_full').removeClass('menu_full_collapsed').addClass('menu_full_classic'); $('#menu_full').removeClass('menu_full_collapsed').addClass('menu_full_classic');
/* $('.logo_icon').removeClass('logo_show').addClass('logo_hide'); /* $('.logo_icon').removeClass('logo_show').addClass('logo_hide');
$('.logo_full').removeClass("logo_hide").addClass("logo_show");*/ $('.logo_full').removeClass("logo_hide").addClass("logo_show");*/
@ -74,8 +78,8 @@ $(document).ready(function(){
} }
else{ else{
console.log('else no ha elegido aun, default-else'); console.log('else no ha elegido aun, default-else');
localStorage.setItem("variable", "colapsado"); localStorage.setItem("menuType", "collapsed");
document.getElementById("menu_type").innerHTML = localStorage.variable; document.getElementById("menu_type").innerHTML = localStorage.menuType;
} }
}); });
@ -95,11 +99,11 @@ $(document).ready(function(){
window.onscroll = function() {scrollFunction()}; window.onscroll = function() {scrollFunction()};
function scrollFunction() { function scrollFunction() {
if (document.body.scrollTop > 400 || document.documentElement.scrollTop > 400) { /* if (document.body.scrollTop > 400 || document.documentElement.scrollTop > 400) {
document.getElementById("top_btn").style.display = "block"; document.getElementById("top_btn").style.display = "block";
} else { } else {
document.getElementById("top_btn").style.display = "none"; document.getElementById("top_btn").style.display = "none";
} }*/
} }
// When the user clicks on the button, scroll to the top of the document. // When the user clicks on the button, scroll to the top of the document.
@ -189,16 +193,16 @@ $('#button_collapse').on('click', function() {
elem.className = elem.className.replace('button_collapse', 'cambiar'); elem.className = elem.className.replace('button_collapse', 'cambiar');
*/ */
if($('#menu_full').hasClass('menu_full_classic')){ if($('#menu_full').hasClass('menu_full_classic')){
localStorage.setItem("variable", "colapsado"); localStorage.setItem("menuType", "collapsed");
//$('#button_collapse').css('color','pink'); //$('#button_collapse').css('color','pink');
document.getElementById("menu_type").innerHTML = localStorage.variable; document.getElementById("menu_type").innerHTML = localStorage.menuType;
$('ul.submenu').css('left', '59px');//hacer que esto se haga aqui $('ul.submenu').css('left', '59px');//hacer que esto se haga aqui
$('#top_btn').css('left', '0px'); $('#top_btn').css('left', '0px');
} }
else if($('#menu_full').hasClass('menu_full_collapsed')){ else if($('#menu_full').hasClass('menu_full_collapsed')){
localStorage.setItem("variable", "clasico"); localStorage.setItem("menuType", "classic");
//$('#button_collapse').css('color','blue'); //$('#button_collapse').css('color','blue');
document.getElementById("menu_type").innerHTML = localStorage.variable; document.getElementById("menu_type").innerHTML = localStorage.menuType;
$('ul.submenu').css('left', '214px');//hacer que esto se haga aqui $('ul.submenu').css('left', '214px');//hacer que esto se haga aqui
$('#top_btn').css('left', '77.5px'); $('#top_btn').css('left', '77.5px');
} }
@ -220,9 +224,9 @@ elem.className = elem.className.replace('button_collapse', 'cambiar');
console.log('entra click'); console.log('entra click');
console.log(localStorage.variable); console.log(localStorage.menuType);
/* /*
if ($('#button_collapse').text() == 'clasico') { if ($('#button_collapse').text() == 'classic') {
classic_menu = true; classic_menu = true;
} }
else { else {
@ -249,9 +253,9 @@ var click_display = "<?php echo $config['click_display']; ?>";
//if ((isNaN(classic_menu)) || (classic_menu == 0)) { //if ((isNaN(classic_menu)) || (classic_menu == 0)) {
//f(localStorage.variable == 'clasico'){ //f(localStorage.menuType == 'classic'){
/* /*
if ($('#button_collapse').text() == 'clasico') { if ($('#button_collapse').text() == 'classic') {
classic_menu = true; classic_menu = true;
} }
else { else {
@ -296,7 +300,7 @@ $(document).ready( function() {
// repeticion de if // repeticion de if
var classic_menu; var classic_menu;
if ($('#menu_type').text() == 'clasico') { if ($('#menu_type').text() == 'classic') {
classic_menu = true; classic_menu = true;
<?php $config['classic_menu'] = true; ?> <?php $config['classic_menu'] = true; ?>
} }

View File

@ -21,6 +21,21 @@ require_once 'include/functions_menu.php';
$menu_godmode = []; $menu_godmode = [];
$menu_godmode['class'] = 'godmode'; $menu_godmode['class'] = 'godmode';
if (check_acl($config['id_user'], 0, 'PM')) {
$sub = [];
$sub['godmode/servers/discovery']['text'] = __('Discover');
$sub['godmode/servers/discovery']['id'] = 'Discover';
$sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery'];
// Add to menu.
$menu_godmode['discover']['text'] = __('Discovery');
$menu_godmode['discover']['sec2'] = 'godmode/servers/discovery';
$menu_godmode['discover']['id'] = 'god-discovery';
$menu_godmode['discover']['sub'] = $sub;
}
$sub = []; $sub = [];
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AD')) { if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AD')) {
$sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents'); $sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents');
@ -54,7 +69,6 @@ if (check_acl($config['id_user'], 0, 'AW')) {
} }
} }
$menu_godmode['nuevo_texto']['text'] = __('nuevo_texto');
if (!empty($sub)) { if (!empty($sub)) {
$menu_godmode['gagente']['text'] = __('Resources'); $menu_godmode['gagente']['text'] = __('Resources');
$menu_godmode['gagente']['sec2'] = 'godmode/agentes/modificar_agente'; $menu_godmode['gagente']['sec2'] = 'godmode/agentes/modificar_agente';
@ -270,6 +284,9 @@ if (check_acl($config['id_user'], 0, 'PM')) {
$sub2['godmode/setup/setup&amp;section=ehorus']['text'] = __('eHorus'); $sub2['godmode/setup/setup&amp;section=ehorus']['text'] = __('eHorus');
$sub2['godmode/setup/setup&amp;section=ehorus']['refr'] = 0; $sub2['godmode/setup/setup&amp;section=ehorus']['refr'] = 0;
$sub2['godmode/setup/setup&amp;section=notifications']['text'] = __('Notifications');
$sub2['godmode/setup/setup&amp;section=notifications']['refr'] = 0;
if ($config['activate_gis']) { if ($config['activate_gis']) {
$sub2['godmode/setup/gis']['text'] = __('Map conections GIS'); $sub2['godmode/setup/gis']['text'] = __('Map conections GIS');
} }

View File

@ -1,26 +1,39 @@
<?php <?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
/** /**
* @package Include * Extension to self monitor Pandora FMS Console
*
* @category Config
* @package Pandora FMS
* @subpackage Config * @subpackage Config
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/ */
// Config functions.
/** /**
* Creates a single config value in the database. * Creates a single config value in the database.
* *
* @param string Config token to create. * @param string $token Config token to create.
* @param string Value to set. * @param string $value Value to set.
* *
* @return boolean Config id if success. False on failure. * @return boolean Config id if success. False on failure.
*/ */
@ -41,15 +54,15 @@ function config_create_value($token, $value)
* *
* If the config token doesn't exists, it's created. * If the config token doesn't exists, it's created.
* *
* @param string Config token to update. * @param string $token Config token to update.
* @param string New value to set. * @param string $value New value to set.
* *
* @return boolean True if success. False on failure. * @return boolean True if success. False on failure.
*/ */
function config_update_value($token, $value) function config_update_value($token, $value)
{ {
global $config; global $config;
// Include functions_io to can call __() function // Include functions_io to can call __() function.
include_once $config['homedir'].'/include/functions_io.php'; include_once $config['homedir'].'/include/functions_io.php';
if ($token == 'list_ACL_IPs_for_API') { if ($token == 'list_ACL_IPs_for_API') {
@ -73,7 +86,7 @@ function config_update_value($token, $value)
return (bool) config_create_value($token, io_safe_input($value)); return (bool) config_create_value($token, io_safe_input($value));
} }
// If it has not changed // If it has not changed.
if ($config[$token] == $value) { if ($config[$token] == $value) {
return true; return true;
} }
@ -97,15 +110,17 @@ function config_update_value($token, $value)
/** /**
* Updates all config values in case setup page was invoked * Updates all config values in case setup page was invoked
*
* @return boolean
*/ */
function config_update_config() function config_update_config()
{ {
global $config; global $config;
// Include functions_io to can call __() function // Include functions_io to can call __() function.
include_once $config['homedir'].'/include/functions_io.php'; include_once $config['homedir'].'/include/functions_io.php';
// If user is not even log it, don't try this // If user is not even log it, don't try this.
if (! isset($config['id_user'])) { if (! isset($config['id_user'])) {
$config['error_config_update_config'] = []; $config['error_config_update_config'] = [];
$config['error_config_update_config']['correct'] = false; $config['error_config_update_config']['correct'] = false;
@ -127,7 +142,7 @@ function config_update_config()
if ($update_config) { if ($update_config) {
db_pandora_audit('Setup', 'Setup has changed'); db_pandora_audit('Setup', 'Setup has changed');
} else { } else {
// Do none // Do nothing.
return false; return false;
} }
@ -137,8 +152,8 @@ function config_update_config()
switch ($sec2) { switch ($sec2) {
case 'godmode/setup/setup': case 'godmode/setup/setup':
$section_setup = get_parameter('section'); $section_setup = get_parameter('section');
// MAIN SETUP // MAIN SETUP.
// Setup now is divided in different tabs // Setup now is divided in different tabs.
switch ($section_setup) { switch ($section_setup) {
case 'general': case 'general':
if (!config_update_value('language', (string) get_parameter('language'))) { if (!config_update_value('language', (string) get_parameter('language'))) {
@ -165,7 +180,7 @@ function config_update_config()
$error_update[] = __('Automatic check for updates'); $error_update[] = __('Automatic check for updates');
} }
if (!config_update_value('cert_path', get_parameter('cert_path'))) { if (!config_update_value('cert_path', (bool) get_parameter('cert_path'))) {
$error_update[] = __('SSL cert path'); $error_update[] = __('SSL cert path');
} }
@ -228,7 +243,7 @@ function config_update_config()
$error_update[] = __('Sound for Monitor warning'); $error_update[] = __('Sound for Monitor warning');
} }
// Update of Pandora FMS license // Update of Pandora FMS license.
$update_manager_installed = db_get_value('value', 'tconfig', 'token', 'update_manager_installed'); $update_manager_installed = db_get_value('value', 'tconfig', 'token', 'update_manager_installed');
if ($update_manager_installed == 1) { if ($update_manager_installed == 1) {
@ -472,7 +487,7 @@ function config_update_config()
break; break;
case 'auth': case 'auth':
// AUTHENTICATION SETUP // AUTHENTICATION SETUP.
if (!config_update_value('auth', get_parameter('auth'))) { if (!config_update_value('auth', get_parameter('auth'))) {
$error_update[] = __('Authentication method'); $error_update[] = __('Authentication method');
} }
@ -639,9 +654,10 @@ function config_update_config()
break; break;
case 'perf': case 'perf':
// PERFORMANCE SETUP // PERFORMANCE SETUP.
if (!config_update_value('event_purge', get_parameter('event_purge'))) { if (!config_update_value('event_purge', get_parameter('event_purge'))) {
$error_update[] = $check_metaconsole_events_history = get_parameter('metaconsole_events_history', -1); $check_metaconsole_events_history = get_parameter('metaconsole_events_history', -1);
$error_update[] = $check_metaconsole_events_history;
} }
if ($check_metaconsole_events_history != -1) { if ($check_metaconsole_events_history != -1) {
@ -746,7 +762,7 @@ function config_update_config()
break; break;
case 'vis': case 'vis':
// VISUAL STYLES SETUP // VISUAL STYLES SETUP.
if (!config_update_value('date_format', (string) get_parameter('date_format'))) { if (!config_update_value('date_format', (string) get_parameter('date_format'))) {
$error_update[] = __('Date format string'); $error_update[] = __('Date format string');
} }
@ -1064,12 +1080,12 @@ function config_update_config()
$error_update[] = __('Display text when proc modules have state critical'); $error_update[] = __('Display text when proc modules have state critical');
} }
// Daniel maya 02/06/2016 Display menu with click --INI // Daniel maya 02/06/2016 Display menu with click --INI.
if (!config_update_value('click_display', (bool) get_parameter('click_display', false))) { if (!config_update_value('click_display', (bool) get_parameter('click_display', false))) {
$error_update[] = __('Display lateral menus with left click'); $error_update[] = __('Display lateral menus with left click');
} }
// Daniel maya 02/06/2016 Display menu with click --END // Daniel maya 02/06/2016 Display menu with click --END.
if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) {
if (!config_update_value('service_label_font_size', get_parameter('service_label_font_size', false))) { if (!config_update_value('service_label_font_size', get_parameter('service_label_font_size', false))) {
$error_update[] = __('Service label font size'); $error_update[] = __('Service label font size');
@ -1140,7 +1156,7 @@ function config_update_config()
// -------------------------------------------------- // --------------------------------------------------
$interval_values = get_parameter('interval_values'); $interval_values = get_parameter('interval_values');
// Add new interval value if is provided // Add new interval value if is provided.
$interval_value = (float) get_parameter('interval_value', 0); $interval_value = (float) get_parameter('interval_value', 0);
if ($interval_value > 0) { if ($interval_value > 0) {
@ -1158,7 +1174,7 @@ function config_update_config()
} }
} }
// Delete interval value if is required // Delete interval value if is required.
$interval_to_delete = (float) get_parameter('interval_to_delete'); $interval_to_delete = (float) get_parameter('interval_to_delete');
if ($interval_to_delete > 0) { if ($interval_to_delete > 0) {
$interval_values_array = explode(',', $interval_values); $interval_values_array = explode(',', $interval_values);
@ -1180,7 +1196,7 @@ function config_update_config()
$error_update[] = __('Custom report info'); $error_update[] = __('Custom report info');
} }
// Juanma (06/05/2014) New feature: Custom front page for reports // Juanma (06/05/2014) New feature: Custom front page for reports.
if (!config_update_value('custom_report_front', get_parameter('custom_report_front'))) { if (!config_update_value('custom_report_front', get_parameter('custom_report_front'))) {
$error_update[] = __('Custom report front'); $error_update[] = __('Custom report front');
} }
@ -1341,7 +1357,15 @@ function config_update_config()
$error_update[] = __('eHorus id custom field'); $error_update[] = __('eHorus id custom field');
} }
break; break;
default:
// Ignore.
break;
} }
default:
// Ignore.
break;
} }
if (count($error_update) > 0) { if (count($error_update) > 0) {
@ -1363,7 +1387,9 @@ function config_update_config()
/** /**
* Process config variables * Process config variables.
*
* @return void
*/ */
function config_process_config() function config_process_config()
{ {
@ -1381,7 +1407,7 @@ function config_process_config()
$is_windows = true; $is_windows = true;
} }
// Compatibility fix // Compatibility fix.
foreach ($configs as $c) { foreach ($configs as $c) {
$config[$c['token']] = $c['value']; $config[$c['token']] = $c['value'];
} }
@ -1438,18 +1464,18 @@ function config_process_config()
if (!isset($config['prominent_time'])) { if (!isset($config['prominent_time'])) {
// Prominent time tells us what to show prominently when a timestamp is // Prominent time tells us what to show prominently when a timestamp is
// displayed. The comparation (... days ago) or the timestamp (full date) // displayed. The comparation (... days ago) or the timestamp (full date).
config_update_value('prominent_time', 'comparation'); config_update_value('prominent_time', 'comparation');
} }
if (!isset($config['timesource'])) { if (!isset($config['timesource'])) {
// Timesource says where time comes from (system or mysql) // Timesource says where time comes from (system or mysql).
config_update_value('timesource', 'system'); config_update_value('timesource', 'system');
} }
if (!isset($config['https'])) { if (!isset($config['https'])) {
// Sets whether or not we want to enforce https. We don't want to go to a // Sets whether or not we want to enforce https. We don't want to go to a
// potentially unexisting config by default // potentially unexisting config by default.
config_update_value('https', false); config_update_value('https', false);
} }
@ -1458,7 +1484,7 @@ function config_process_config()
} }
if (!isset($config['cert_path'])) { if (!isset($config['cert_path'])) {
// Sets name and path of ssl path for use in application // Sets name and path of ssl path for use in application.
config_update_value('cert_path', '/etc/ssl/certs/pandorafms.pem'); config_update_value('cert_path', '/etc/ssl/certs/pandorafms.pem');
} }
@ -1470,7 +1496,7 @@ function config_process_config()
config_update_value('status_images_set', 'default'); config_update_value('status_images_set', 'default');
} }
// Load user session // Load user session.
if (isset($_SESSION['id_usuario'])) { if (isset($_SESSION['id_usuario'])) {
$config['id_user'] = $_SESSION['id_usuario']; $config['id_user'] = $_SESSION['id_usuario'];
} }
@ -1678,7 +1704,7 @@ function config_process_config()
} }
/* /*
*Parse the ACL IP list for access API * Parse the ACL IP list for access API
*/ */
$temp_list_ACL_IPs_for_API = []; $temp_list_ACL_IPs_for_API = [];
if (isset($config['list_ACL_IPs_for_API'])) { if (isset($config['list_ACL_IPs_for_API'])) {
@ -1695,7 +1721,7 @@ function config_process_config()
// the first time make a conenction and disable itself // the first time make a conenction and disable itself
// Not Managed here ! // Not Managed here !
// if (!isset ($config["autoupdate"])) { // if (!isset ($config["autoupdate"])) {
// config_update_value ('autoupdate', true); // config_update_value ('autoupdate', true);.
// } // }
include_once $config['homedir'].'/include/auth/mysql.php'; include_once $config['homedir'].'/include/auth/mysql.php';
include_once $config['homedir'].'/include/functions_io.php'; include_once $config['homedir'].'/include/functions_io.php';
@ -2295,7 +2321,7 @@ function config_process_config()
} }
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
// Customizable sections (Metaconsole) // Customizable sections (Metaconsole).
enterprise_include_once('include/functions_enterprise.php'); enterprise_include_once('include/functions_enterprise.php');
$customizable_sections = enterprise_hook('enterprise_get_customizable_sections'); $customizable_sections = enterprise_hook('enterprise_get_customizable_sections');
@ -2317,15 +2343,15 @@ function config_process_config()
) { ) {
$isFunctionSkins = enterprise_include_once('include/functions_skins.php'); $isFunctionSkins = enterprise_include_once('include/functions_skins.php');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
// Try to update user table in order to refresh skin inmediatly // Try to update user table in order to refresh skin inmediatly.
$is_user_updating = get_parameter('sec2', ''); $is_user_updating = get_parameter('sec2', '');
if ($is_user_updating == 'operation/users/user_edit') { if ($is_user_updating == 'operation/users/user_edit') {
$id = get_parameter_get('id', $config['id_user']); $id = get_parameter_get('id', $config['id_user']);
// ID given as parameter // ID given as parameter.
$user_info = get_user_info($id); $user_info = get_user_info($id);
// If current user is editing himself or if the user has UM (User Management) rights on any groups the user is part of AND the authorization scheme allows for users/admins to update info // If current user is editing himself or if the user has UM (User Management) rights on any groups the user is part of AND the authorization scheme allows for users/admins to update info.
if (($config['id_user'] == $id || check_acl($config['id_user'], users_get_groups($id), 'UM')) && $config['user_can_update_info']) { if (($config['id_user'] == $id || check_acl($config['id_user'], users_get_groups($id), 'UM')) && $config['user_can_update_info']) {
$view_mode = false; $view_mode = false;
} else { } else {
@ -2339,7 +2365,7 @@ function config_process_config()
} }
if (!is_metaconsole()) { if (!is_metaconsole()) {
// Skins are available only in console mode // Skins are available only in console mode.
if (isset($config['id_user'])) { if (isset($config['id_user'])) {
$relative_path = enterprise_hook('skins_set_image_skin_path', [$config['id_user']]); $relative_path = enterprise_hook('skins_set_image_skin_path', [$config['id_user']]);
} else { } else {
@ -2469,12 +2495,12 @@ function config_process_config()
config_update_value('render_proc_fail', __('Fail')); config_update_value('render_proc_fail', __('Fail'));
} }
// Daniel maya 02/06/2016 Display menu with click --INI // Daniel maya 02/06/2016 Display menu with click --INI.
if (!isset($config['click_display'])) { if (!isset($config['click_display'])) {
config_update_value('click_display', 1); config_update_value('click_display', 1);
} }
// Daniel maya 02/06/2016 Display menu with click --END // Daniel maya 02/06/2016 Display menu with click --END.
if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) {
if (!isset($config['service_label_font_size'])) { if (!isset($config['service_label_font_size'])) {
config_update_value('service_label_font_size', 20); config_update_value('service_label_font_size', 20);
@ -2501,7 +2527,7 @@ function config_process_config()
config_update_value('custom_report_info', 1); config_update_value('custom_report_info', 1);
} }
// Juanma (06/05/2014) New feature: Custom front page for reports // Juanma (06/05/2014) New feature: Custom front page for reports.
if (!isset($config['custom_report_front'])) { if (!isset($config['custom_report_front'])) {
config_update_value('custom_report_front', 0); config_update_value('custom_report_front', 0);
} }
@ -2611,7 +2637,7 @@ function config_process_config()
config_update_value('instance_registered', 0); config_update_value('instance_registered', 0);
} }
// eHorus // Ehorus.
if (!isset($config['ehorus_enabled'])) { if (!isset($config['ehorus_enabled'])) {
config_update_value('ehorus_enabled', 0); config_update_value('ehorus_enabled', 0);
} }
@ -2646,285 +2672,77 @@ function config_process_config()
} }
} }
// Finally, check if any value was overwritten in a form // Finally, check if any value was overwritten in a form.
config_update_config(); config_update_config();
} }
/**
* Start supervisor.
*
* @return void
*/
function config_check() function config_check()
{ {
global $config; global $config;
// At this first version I'm passing errors using session variables, because the error management include_once __DIR__.'/class/ConsoleSupervisor.php';
// is done by an AJAX request. Better solutions could be implemented in the future :-)
if (license_free() && users_is_admin($config['id_user'])) { // Enterprise customers launch supervisor using discovery task.
$login = get_parameter('login', false); if (enterprise_installed() === false) {
// Registration advice $supervisor = new ConsoleSupervisor(false);
if ((!isset($config['instance_registered']) || ($config['instance_registered'] != 1)) && ($login === false)) { $supervisor->run();
set_pandora_error_for_header( } else if ($config['cron_last_run'] == 0
__('Click <a style="font-weight:bold; text-decoration:underline" href="javascript: force_run_register();"> here</a> to start the registration process'), || (get_system_time() - $config['cron_last_run']) > 3600
__('This instance is not registered in the Update manager') ) {
); $supervisor = new ConsoleSupervisor(false);
$supervisor->runBasic();
} }
// Newsletter advice
$newsletter = db_get_value('middlename', 'tusuario', 'id_user', $config['id_user']);
if ($newsletter != 1 && $login === false) {
set_pandora_error_for_header(
__('Click <a style="font-weight:bold; text-decoration:underline" href="javascript: force_run_newsletter();"> here</a> to start the newsletter subscription process'),
__('Not subscribed to the newsletter')
);
}
}
// Check default password for "admin"
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
if ($is_admin) {
$hashpass = db_get_sql(
"SELECT password
FROM tusuario WHERE id_user = 'admin'"
);
if ($hashpass == '1da7ee7d45b96d0e1f45ee4ee23da560') {
set_pandora_error_for_header(
__('Default password for "Admin" user has not been changed.'),
__('Please change the default password because is a common vulnerability reported.')
);
}
}
if (isset($config['license_expired'])) {
set_pandora_error_for_header(
__('You can not get updates until you renew the license.'),
__('This license has expired.')
);
}
if (!is_writable('attachment')) {
set_pandora_error_for_header(
__('Please check that the web server has write rights on the {HOMEDIR}/attachment directory'),
__('Attachment directory is not writable by HTTP Server')
);
}
// Get remote file dir.
$remote_config = io_safe_output(
db_get_value_filter(
'value',
'tconfig',
['token' => 'remote_config']
)
);
if (enterprise_installed()) {
if (!is_readable($remote_config)) {
set_pandora_error_for_header(
__('Remote configuration directory is not readble for the console').' - '.$remote_config
);
}
$remote_config_conf = $remote_config.'/conf';
if (!is_writable($remote_config_conf)) {
set_pandora_error_for_header(
__('Remote configuration directory is not writtable for the console').' - '.$remote_config.'/conf'
);
}
$remote_config_col = $remote_config.'/collections';
if (!is_writable($remote_config_col)) {
set_pandora_error_for_header(
__('Remote configuration directory is not writtable for the console').' - '.$remote_config.'/collections'
);
}
}
// Check attachment directory (too much files?)
$filecount = count(glob($config['homedir'].'/attachment/*'));
// N temporal files of trash should be enough for most people.
if ($filecount > $config['num_files_attachment']) {
set_pandora_error_for_header(
__('There are too much files in attachment directory. This is not fatal, but you should consider cleaning up your attachment directory manually')." ( $filecount ".__('files').' )',
__('Too much files in your tempora/attachment directory')
);
}
// Check database maintance
$db_maintance = db_get_value_filter(
'value',
'tconfig',
['token' => 'db_maintance']
);
// If never was executed, it means we are in the first Pandora FMS execution. Set current timestamp
if (empty($db_maintance)) {
config_update_value('db_maintance', date('U'));
}
$last_maintance = (date('U') - $db_maintance);
// ~ about 50 hr
if ($last_maintance > 190000) {
set_pandora_error_for_header(
__('Your database is not maintained correctly. It seems that more than 48hrs have passed without proper maintenance. Please review documents of %s on how to perform this maintenance process (DB Tool) and enable it as soon as possible.', get_product_name()),
__('Database maintance problem')
);
}
$fontpath = io_safe_output(db_get_value_filter('value', 'tconfig', ['token' => 'fontpath']));
if (($fontpath == '') or (!file_exists($fontpath))) {
set_pandora_error_for_header(
__('Your defined font doesnt exist or is not defined. Please check font parameters in your config'),
__('Default font doesnt exist')
);
}
if ($config['event_storm_protection']) {
set_pandora_error_for_header(
__('You need to restart server after altering this configuration setting.'),
__('Event storm protection is activated. No events will be generated during this mode.')
);
}
global $develop_bypass;
if ($develop_bypass == 1) {
set_pandora_error_for_header(
__('Your %s has the "develop_bypass" mode enabled. This is a developer mode and should be disabled in a production system. This value is written in the main index.php file', get_product_name()),
__('Developer mode is enabled')
);
}
if (isset($_SESSION['new_update'])) {
if (!empty($_SESSION['return_installation_open'])) {
if (!$_SESSION['return_installation_open']['return']) {
foreach ($_SESSION['return_installation_open']['text'] as $message) {
set_pandora_error_for_header(
$message,
__('Error first setup Open update')
);
}
}
}
if ($_SESSION['new_update'] == 'new') {
set_pandora_error_for_header(
__('There is a new update available. Please<a style="font-weight:bold;" href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online"> go to Administration:Setup:Update Manager</a> for more details.'),
__('New %s Console update', get_product_name())
);
}
}
// PHP configuration values
$PHPupload_max_filesize = config_return_in_bytes(ini_get('upload_max_filesize'));
$PHPmax_input_time = ini_get('max_input_time');
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
$PHPmax_execution_time = ini_get('max_execution_time');
$PHPsafe_mode = ini_get('safe_mode');
$PHPdisable_functions = ini_get('disable_functions');
if ($PHPsafe_mode === '1') {
set_pandora_error_for_header(
__('To disable, change it on your PHP configuration file (php.ini) and put safe_mode = Off (Dont forget restart apache process after changes)'),
sprintf(__('PHP safe mode is enabled. Some features may not properly work.'))
);
}
if ($PHPmax_input_time !== '-1') {
set_pandora_error_for_header(
sprintf(__('Recommended value is %s'), '-1 ('.__('Unlimited').')').'<br><br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'),
sprintf(__("Not recommended '%s' value in PHP configuration"), 'max_input_time')
);
}
if ($PHPmax_execution_time !== '0') {
set_pandora_error_for_header(
sprintf(__('Recommended value is: %s'), '0 ('.__('Unlimited').')').'<br><br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'),
sprintf(__("Not recommended '%s' value in PHP configuration"), 'max_execution_time')
);
}
$PHPupload_max_filesize_min = config_return_in_bytes('800M');
if ($PHPupload_max_filesize < $PHPupload_max_filesize_min) {
set_pandora_error_for_header(
sprintf(__('Recommended value is: %s'), sprintf(__('%s or greater'), '800M')).'<br><br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'),
sprintf(__("Not recommended '%s' value in PHP configuration"), 'upload_max_filesize')
);
}
$PHPmemory_limit_min = config_return_in_bytes('500M');
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
set_pandora_error_for_header(
sprintf(__('Recommended value is: %s'), sprintf(__('%s or greater'), '500M')).'<br><br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator'),
sprintf(__("Not recommended '%s' value in PHP configuration"), 'memory_limit')
);
}
if (preg_match('/system/', $PHPdisable_functions) or preg_match('/exec/', $PHPdisable_functions)) {
set_pandora_error_for_header(
__('Variable disable_functions containts functions system() or exec(), in PHP configuration file (php.ini)').'<br /><br />'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'),
__('Problems with disable functions in PHP.INI')
);
}
$result_ejecution = exec('"'.io_safe_output($config['phantomjs_bin']).'/phantomjs" --version');
if (!isset($result_ejecution) || $result_ejecution == '') {
if ($config['language'] == 'es') {
set_pandora_error_for_header(
__('To be able to create images of the graphs for PDFs, please install the phantom.js extension. For that, it is necessary to follow these steps:').'<a target="blank" href="https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Configuracion#Phantomjs">Click here</a>',
__('phantomjs is not installed')
);
} else {
set_pandora_error_for_header(
__('To be able to create images of the graphs for PDFs, please install the phantom.js extension. For that, it is necessary to follow these steps:').'<a target="blank" href="https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Configuration#Phantomjs">Click here</a>',
__('phantomjs is not installed')
);
}
}
$php_version = phpversion();
$php_version_array = explode('.', $php_version);
if ($php_version_array[0] < 7) {
if ($config['language'] == 'es') {
$url_help = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Instalaci%C3%B3n_y_actualizaci%C3%B3n_PHP_7';
} else {
$url_help = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:_PHP_7';
}
set_pandora_error_for_header(
__('For a correct operation of PandoraFMS, PHP must be updated to version 7.0 or higher.').'<br>'.__('Otherwise, functionalities will be lost.').'<br>'."<ol><li style='color: #676767'>".__('Report download in PDF format').'</li>'."<li style='color: #676767'>".__('Emails Sending').'</li>'."<li style='color: #676767'>".__('Metaconsole Collections').'</li>'."<li style='color: #676767'>".'...'.'</li>'.'</ol>'.'<a target="blank" href="'.$url_help.'">'.__('Access Help').'</a>',
__('PHP UPDATE REQUIRED')
);
}
} }
/**
* Return in bytes
*
* @param string $val Value to convert.
*
* @return integer
*/
function config_return_in_bytes($val) function config_return_in_bytes($val)
{ {
$val = trim($val); $val = trim($val);
$last = strtolower($val[(strlen($val) - 1)]); $last = strtolower($val[(strlen($val) - 1)]);
switch ($last) { switch ($last) {
// The 'G' modifier is available since PHP 5.1.0 // The 'G' modifier is available since PHP 5.1.0.
case 'g': case 'g':
$val *= 1024; $val *= 1024;
case 'm': case 'm':
$val *= 1024; $val *= 1024;
case 'k': case 'k':
$val *= 1024; $val *= 1024;
default:
// Ignore.
break;
} }
return $val; return $val;
} }
/**
* Undocumented function
*
* @return void
*/
function config_user_set_custom_config() function config_user_set_custom_config()
{ {
global $config; global $config;
$userinfo = get_user_info($config['id_user']); $userinfo = get_user_info($config['id_user']);
// Refresh the last_connect info in the user table // Refresh the last_connect info in the user table.
// if last update was more than 5 minutes ago // if last update was more than 5 minutes ago.
if ($userinfo['last_connect'] < (time() - SECONDS_1MINUTE)) { if ($userinfo['last_connect'] < (time() - SECONDS_1MINUTE)) {
update_user($config['id_user'], ['last_connect' => time()]); update_user($config['id_user'], ['last_connect' => time()]);
} }
@ -2933,7 +2751,7 @@ function config_user_set_custom_config()
$config['block_size'] = $userinfo['block_size']; $config['block_size'] = $userinfo['block_size'];
} }
// Each user could have it's own timezone) // Each user could have it's own timezone).
if (isset($userinfo['timezone'])) { if (isset($userinfo['timezone'])) {
if ($userinfo['timezone'] != '') { if ($userinfo['timezone'] != '') {
date_default_timezone_set($userinfo['timezone']); date_default_timezone_set($userinfo['timezone']);
@ -2946,6 +2764,11 @@ function config_user_set_custom_config()
} }
/**
* Undocumented function
*
* @return void
*/
function config_prepare_session() function config_prepare_session()
{ {
global $config; global $config;
@ -2958,10 +2781,10 @@ function config_prepare_session()
} }
if ($user_sesion_time == 0) { if ($user_sesion_time == 0) {
// Change the session timeout value to session_timeout minutes // 8*60*60 = 8 hours // Change the session timeout value to session_timeout minutes // 8*60*60 = 8 hours.
$sessionCookieExpireTime = $config['session_timeout']; $sessionCookieExpireTime = $config['session_timeout'];
} else { } else {
// Change the session timeout value to session_timeout minutes // 8*60*60 = 8 hours // Change the session timeout value to session_timeout minutes // 8*60*60 = 8 hours.
$sessionCookieExpireTime = $user_sesion_time; $sessionCookieExpireTime = $user_sesion_time;
} }
@ -2971,7 +2794,7 @@ function config_prepare_session()
$sessionCookieExpireTime *= 60; $sessionCookieExpireTime *= 60;
} }
// Reset the expiration time upon page load //session_name() is default name of session PHPSESSID // Reset the expiration time upon page load //session_name() is default name of session PHPSESSID.
if (isset($_COOKIE[session_name()])) { if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), $_COOKIE[session_name()], (time() + $sessionCookieExpireTime), '/'); setcookie(session_name(), $_COOKIE[session_name()], (time() + $sessionCookieExpireTime), '/');
} }

View File

@ -737,12 +737,12 @@ function menu_calculate_top($level1, $level2, $level3=false)
// Positionate in the middle // Positionate in the middle
if ($total > 12 && (($total < 18) || (($level1 - $comp) <= 4))) { if ($total > 12 && (($total < 18) || (($level1 - $comp) <= 4))) {
return - ( floor($comp / 2) * 35); return - ( floor($comp / 2) * 39);
} }
// Positionate in the bottom // Positionate in the bottom
if ($total >= 18) { if ($total >= 18) {
return (- $comp * 35); return (- $comp * 39);
} }
// return 0 by default // return 0 by default

View File

@ -70,7 +70,7 @@ li:hover ul {
z-index: 999; z-index: 999;
/*left: 44px;*/ /*left: 44px;*/
min-height: 35px; min-height: 35px;
height: 35px; /*height: 35px;*/
width: 180px; width: 180px;
} }
@ -82,7 +82,7 @@ li:hover ul {
.sub_subMenu { .sub_subMenu {
min-height: 35px !important; min-height: 35px !important;
height: 35px; /*height: 35px;*/
width: 180px; width: 180px;
font-weight: normal !important; font-weight: normal !important;
background-color: #202020; background-color: #202020;
@ -187,6 +187,9 @@ li.sub_subMenu.selected {
} }
/* Godmode images */ /* Godmode images */
#icon_god-discovery {
background: url(../../images/gm_discovery.menu.png) no-repeat 50% 50%;
}
#icon_god-resources { #icon_god-resources {
background: url(../../images/gm_resources.menu_gray.png) no-repeat; background: url(../../images/gm_resources.menu_gray.png) no-repeat;
} }
@ -454,24 +457,24 @@ ul li a:hover {
} }
#menu_full { #menu_full {
/*height: 100%; Lo he quitado para que no ocupe todo el alto y fixed */ /*height: 100%; /*Lo he quitado para que no ocupe todo el alto y fixed */
width: 60px; /* It is changed for classic menu (215px)*/ width: 60px; /* It is changed for classic menu (215px)*/
position: absolute; /*Fixed: Lo he quitado para que no ocupe todo el alto y fixed */ position: fixed; /*Fixed: Lo he quitado para que no ocupe todo el alto y fixed */ /*absolute*/
z-index: 1; z-index: 1;
top: 0; top: 0;
left: 0; left: 0;
background-color: #343434; background-color: #343434;
border-bottom: solid 5px #343434; border-bottom: solid 3px #343434;
min-height: 943px; /*min-height: 943px;*/
/* padding-bottom: 40px; Lo he quitado para que no ocupe todo el alto y fixed */ padding-bottom: 40px; /*Lo he quitado para que no ocupe todo el alto y fixed */
/*overflow-x: hidden;*/ /*overflow-x: hidden;*/
} }
.button_collapse { .button_collapse {
height: 55px; height: 55px;
background-color: #4d4d4d; background-color: #4d4d4d;
/* bottom: 0; Lo he quitado para que no ocupe todo el alto y fixed /*bottom: 0; /* Lo he quitado para que no ocupe todo el alto y fixed*/
position: fixed;*/ /*position: fixed; /*coemntar tb*/
width: 60px; /* It is changed for classic menu (215px)*/ width: 60px; /* It is changed for classic menu (215px)*/
text-align: center; text-align: center;
color: #fff; color: #fff;
@ -497,8 +500,8 @@ ul li a:hover {
.operation > li.menu_icon, .operation > li.menu_icon,
.godmode > li.menu_icon { .godmode > li.menu_icon {
padding-top: 3px; padding-top: 2px; /* 3px */
padding-bottom: 3px; padding-bottom: 2px;
} }
.operation div, .operation div,
@ -511,14 +514,21 @@ ul li a:hover {
.menu_full_classic, .menu_full_classic,
.button_classic { .button_classic {
width: 215px !important; width: 215px !important;
background-image: url(../../images/button_collapse_menu.png);
background-repeat: no-repeat;
background-position: center;
} }
.menu_full_collapsed, .menu_full_collapsed,
.button_collapsed { .button_collapsed {
width: 60px !important; width: 60px !important;
}
.button_classic {
width: 215px !important;
background-image: url(../../images/button_collapse_menu.png);
background-repeat: no-repeat;
background-position: center;
}
.button_collapsed {
background-image: url(../../images/button_classic_menu.png); background-image: url(../../images/button_classic_menu.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
@ -547,7 +557,7 @@ ul li a:hover {
/* border: 2px solid #fff;*/ /* border: 2px solid #fff;*/
} }
@media screen and (max-height: 845px) { @media screen and (max-height: 600px) {
.operation > li.menu_icon, .operation > li.menu_icon,
.godmode > li.menu_icon { .godmode > li.menu_icon {
padding-top: 1px; padding-top: 1px;
@ -558,5 +568,61 @@ ul li a:hover {
} }
.button_collapse { .button_collapse {
margin-top: 10px; margin-top: 10px;
background-color: green;
}
.menu li,
.menu .li.not_selected {
min-height: 25px !important;
}
.button_collapse {
height: 45px;
}
.submenu_text {
/* padding: 7.5px;*/
}
}
@media screen and (min-height: 601px) and (max-height: 700px) {
.operation > li.menu_icon,
.godmode > li.menu_icon {
padding-top: 1px;
padding-bottom: 2px;
}
.operation {
padding-top: 10px !important;
}
.button_collapse {
margin-top: 10px;
background-color: red;
}
.menu li,
.menu .li.not_selected {
min-height: 25px !important;
}
.button_collapse {
height: 48px;
}
.submenu_text {
/*padding: 7.5px;*/
}
}
@media screen and (min-height: 701px) and (max-height: 845px) {
.operation {
padding-top: 10px !important;
}
.button_collapse {
margin-top: 10px;
background-color: blue;
}
.menu li,
.menu .li.not_selected {
min-height: 28px !important;
}
.button_collapse {
height: 50px;
}
.submenu_text {
/*padding: 7.5px;*/
} }
} }

View File

@ -678,7 +678,7 @@ div#menu {
width: 45px; width: 45px;
float: left; float: left;
z-index: 2000; z-index: 2000;
/*position: absolute; Lo he quitado para que no ocupe todo el alto y fixed */ position: absolute; /*Lo he quitado para que no ocupe todo el alto y fixed */
} }
div#head { div#head {
@ -978,6 +978,14 @@ input.group_item_min[disabled] {
center !important; center !important;
} }
input.color_cloud_min {
background: #fefefe url(../../images/color_cloud_item.png) no-repeat center !important;
}
input.color_cloud_min[disabled] {
background: #fefefe url(../../images/color_cloud_item.disabled.png) no-repeat
center !important;
}
div#cont { div#cont {
position: fixed; position: fixed;
max-height: 320px; max-height: 320px;
@ -1549,7 +1557,8 @@ table.databox {
} }
.databox > thead > tr > th, .databox > thead > tr > th,
.databox > tbody > tr > th { .databox > tbody > tr > th,
.databox > thead > tr > th a {
padding: 9px 7px; padding: 9px 7px;
font-weight: normal; font-weight: normal;
color: #fff; color: #fff;
@ -4422,7 +4431,177 @@ div#dialog_messages table th:last-child {
text-align: right; text-align: right;
} }
/* checkbox type toogle switch */ /*
* ---------------------------------------------------------------------
* - Notifications
* ---------------------------------------------------------------------
*/
.notification-ball {
border: white solid 2px;
border-radius: 50px;
width: 18px;
height: 18px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
.notification-ball-no-messages {
background-color: #82b92e;
cursor: pointer;
}
.notification-ball-new-messages {
background-color: #fc4444;
}
#notification-wrapper {
background: white;
border: #a5a5a5 solid 1px;
z-index: 900000;
position: absolute;
width: 400px;
margin-top: -5px;
border-radius: 5px;
}
#notification-wrapper::before {
content: "";
display: block;
position: absolute;
width: 0px;
height: 0;
border-color: transparent;
border-width: 12px;
border-style: solid;
bottom: 100%;
left: 78%;
left: calc(78% - 2px);
margin-left: -12px;
border-bottom-color: white;
}
#notification-wrapper-inner {
max-height: 400px;
overflow: auto;
}
#notification-wrapper-shadow {
height: 100%;
width: 100%;
background: #111;
position: fixed;
z-index: 9009;
top: 0;
opacity: 0.3;
}
.notification-item {
background: whitesmoke;
height: 100px;
margin: 7px;
border: #e4e4e4 solid 1px;
display: flex;
flex-flow: row nowrap;
align-items: center;
padding: 5px;
}
.notification-item:hover {
border: #ccc solid 1px;
}
.notification-item > * {
padding-left: 15px;
pointer-events: none;
}
.notification-item:hover {
text-decoration: none;
}
.notification-info {
width: 87%;
display: flex;
flex-flow: column nowrap;
overflow: hidden;
max-height: 83px;
line-height: 1.4em;
}
.notification-item img {
max-width: 100%;
max-height: 100%;
}
.notification-title {
margin: 0;
}
.notification-subtitle {
margin: 0;
color: #373737;
}
.global-config-notification-title {
display: flex;
flex-direction: row;
align-items: center;
}
.global-config-notification-title h2 {
margin-left: 10px;
}
.global-config-notification-checkboxes :first-child {
font-weight: bold;
}
.global-config-notification-selectors {
display: flex;
flex-direction: row;
margin-bottom: 10px;
}
.global-config-notification-selectors h4 {
margin: 0;
}
.global-config-notification-single-selector,
.global_config_notifications_dialog_add select {
display: flex;
width: 100%;
padding: 0 10px;
}
.global-config-notification-single-selector :first-child,
.global-config-notification-single-selector :first-child select {
width: 99%;
}
.global-config-notification-single-selector :last-child,
.global_config_notifications_dialog_add_wrapper {
flex-direction: column;
display: flex;
justify-content: flex-end;
}
.global_config_notifications_dialog_add {
display: flex;
flex-direction: row;
margin: 8px;
}
.global_config_notifications_two_ways_form_arrows {
display: flex;
flex-flow: column;
justify-content: center;
margin: 0 5px;
}
.global_config_notifications_two_ways_form_arrows img {
margin: 15px 0;
}
/* jQuery dialog */
.no-close .ui-dialog-titlebar-close {
display: none;
}
/* jQuery dialog */
/* --- SWITCH --- */
.toogle_switch { .toogle_switch {
position: relative; position: relative;
display: inline-block; display: inline-block;
@ -4477,11 +4656,147 @@ input:checked + .slider:before {
background-color: rgb(197, 235, 192); background-color: rgb(197, 235, 192);
} }
/* jQuery dialog */ .p-switch {
.no-close .ui-dialog-titlebar-close { position: relative;
display: none; display: inline-block;
width: 30px;
height: 17px;
} }
/* jQuery dialog */
.p-switch input {
opacity: 0;
width: 0;
height: 0;
}
.p-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: 0.4s;
transition: 0.4s;
border-radius: 34px;
}
.p-slider:before {
position: absolute;
content: "";
height: 13px;
width: 13px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: 0.4s;
transition: 0.4s;
border-radius: 50%;
}
input:checked + .p-slider {
background-color: #82b92e;
}
input:focus + .p-slider {
box-shadow: 0 0 1px #82b92e;
}
input:checked + .p-slider:before {
-webkit-transform: translateX(13px);
-ms-transform: translateX(13px);
transform: translateX(13px);
}
/* --- END SWITCH --- */
/* --- TOAST --- */
#notifications-toasts-wrapper {
position: fixed;
right: 20px;
top: 70px;
width: 270px;
height: 100%;
z-index: 6;
pointer-events: none;
}
.snackbar {
max-width: 270px;
background-color: #333;
color: #fff;
text-align: center;
/* border-radius: 2px; */
padding: 16px;
margin: 10px;
border-radius: 4px;
visibility: hidden;
pointer-events: all;
}
.snackbar.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 7.5s;
animation: fadein 0.5s, fadeout 0.5s 7.5s;
}
.snackbar p,
.snackbar h3 {
text-align: left;
margin: 0;
pointer-events: none;
}
.snackbar h3 {
color: white;
margin-bottom: 10px;
}
@-webkit-keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
to {
bottom: 30px;
opacity: 1;
}
}
@keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
to {
bottom: 30px;
opacity: 1;
}
}
@-webkit-keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
to {
bottom: 0;
opacity: 0;
}
}
@keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
to {
bottom: 0;
opacity: 0;
}
}
/* --- END TOAST --- */
/* /*
* --------------------------------------------------------------------- * ---------------------------------------------------------------------