Merge branch 'ent-7161-Cambiar-opciones-de-skin-en-usuarios-y-grupos' into 'develop'

Ent 7161 cambiar opciones de skin en usuarios y grupos

See merge request artica/pandorafms!3972
This commit is contained in:
Daniel Rodriguez 2021-04-13 09:26:50 +00:00
commit 751d7ec3cf
5 changed files with 39 additions and 8 deletions

View File

@ -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 `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; COMMIT;

View File

@ -565,6 +565,9 @@ CREATE TABLE IF NOT EXISTS `tskin` (
PRIMARY KEY (id) PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) 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` -- Table `tpolicy_queue`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------

View File

@ -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); $table->data[$i][1] = html_print_textarea('other', 4, 40, $other, "class='min-height-0px'", true);
$i++; $i++;
$isFunctionSkins = enterprise_include_once('include/functions_skins.php'); // $isFunctionSkins = enterprise_include_once('include/functions_skins.php');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) { // if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) {
$table->data[9][0] = __('Skin'); // $table->data[10][0] = __('Skin');
$table->data[9][1] = skins_print_select($config['id_user'], 'skin', $skin, '', __('None'), 0, true); // $table->data[10][1] = skins_print_select($config['id_user'], 'skin', $skin, '', __('None'), 0, true);
} // }
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$sec = 'advanced'; $sec = 'advanced';
} else { } else {

View File

@ -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')) { if (defined('METACONSOLE')) {
$config['metaconsole_access'] = $userinfo['metaconsole_access']; $config['metaconsole_access'] = $userinfo['metaconsole_access'];
} }

View File

@ -1199,8 +1199,8 @@ INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key
-- --
-- Dumping data for table `tskin` -- 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 (1,'Default theme', 'pandora.css', 'Default skin for Pandora FMS web console', 0);
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 (2,'Black theme', 'pandora_black.css', 'Black theme', 0);
-- --
-- Dumping data for table `tcollection` -- Dumping data for table `tcollection`