diff --git a/pandora_console/extras/mr/46.sql b/pandora_console/extras/mr/46.sql index 0e20f2af03..717b459590 100644 --- a/pandora_console/extras/mr/46.sql +++ b/pandora_console/extras/mr/46.sql @@ -6,4 +6,7 @@ ALTER TABLE `treport_content_template` MODIFY `external_source` MEDIUMTEXT; UPDATE `talert_commands` SET `fields_descriptions` = '[\"Event name\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event severity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"\",\"\"]' WHERE `name` = "Monitoring Event"; +UPDATE `tskin` SET `name` = 'Default theme' , `relative_path` = 'pandora.css' WHERE `id` = 1; +UPDATE `tskin` SET `name` = 'Black theme' , `relative_path` = 'Black theme' , `description` = 'Black theme' WHERE `id` = 2; + COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index e5841cc7e6..c124721019 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -565,6 +565,9 @@ CREATE TABLE IF NOT EXISTS `tskin` ( PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +UPDATE `tskin` SET `name` = 'Default theme' , `relative_path` = 'pandora.css' WHERE `id` = 1; +UPDATE `tskin` SET `name` = 'Black theme' , `relative_path` = 'Black theme' , `description` = 'Black theme' WHERE `id` = 2; + -- --------------------------------------------------------------------- -- Table `tpolicy_queue` -- --------------------------------------------------------------------- diff --git a/pandora_console/godmode/groups/configure_group.php b/pandora_console/godmode/groups/configure_group.php index 08e2c2e9f3..0d45f381e4 100644 --- a/pandora_console/godmode/groups/configure_group.php +++ b/pandora_console/godmode/groups/configure_group.php @@ -219,12 +219,11 @@ $table->data[$i][0] = __('Other').ui_print_help_tip(__('Information accessible t $table->data[$i][1] = html_print_textarea('other', 4, 40, $other, "class='min-height-0px'", true); $i++; -$isFunctionSkins = enterprise_include_once('include/functions_skins.php'); -if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) { - $table->data[9][0] = __('Skin'); - $table->data[9][1] = skins_print_select($config['id_user'], 'skin', $skin, '', __('None'), 0, true); -} - +// $isFunctionSkins = enterprise_include_once('include/functions_skins.php'); +// if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) { +// $table->data[10][0] = __('Skin'); +// $table->data[10][1] = skins_print_select($config['id_user'], 'skin', $skin, '', __('None'), 0, true); +// } if (defined('METACONSOLE')) { $sec = 'advanced'; } else { diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 322e630485..d2bed417b4 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -3358,6 +3358,32 @@ function config_user_set_custom_config() } } + if ((isset($userinfo['id_skin']) && $userinfo['id_skin'] !== 0)) { + if ((int) $userinfo['id_skin'] === 1) { + $config['style'] = 'pandora'; + } + + if ((int) $userinfo['id_skin'] === 2) { + $config['style'] = 'pandora_black'; + } + } + + $skin = get_parameter('skin', false); + $sec2_aux = get_parameter('sec2'); + + if ($sec2_aux != 'godmode/groups/group_list' && $skin !== false) { + $id_user_aux = get_parameter('id'); + if ($id_user_aux == $config['id_user']) { + if ((int) $skin === 1 || (int) $skin === 0) { + $config['style'] = 'pandora'; + } + + if ((int) $skin === 2) { + $config['style'] = 'pandora_black'; + } + } + } + if (defined('METACONSOLE')) { $config['metaconsole_access'] = $userinfo['metaconsole_access']; } diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index fce3eaf402..de448f7dd9 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1199,8 +1199,8 @@ INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key -- -- Dumping data for table `tskin` -- -INSERT INTO `tskin` VALUES (1,'skin default', 'skin_default', 'Default skin for Pandora FMS web console', 1); -INSERT INTO `tskin` VALUES (2,'Legacy', 'legacy', 'Skin of the visual style of Pandora FMS 4.x and previous versions', 1); +INSERT INTO `tskin` VALUES (1,'Default theme', 'pandora.css', 'Default skin for Pandora FMS web console', 0); +INSERT INTO `tskin` VALUES (2,'Black theme', 'pandora_black.css', 'Black theme', 0); -- -- Dumping data for table `tcollection`