From 57f6ad097a6c6d5b17571706932e849022c4ef66 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 11 Jul 2017 10:10:48 +0200 Subject: [PATCH] update --- pandora_console/include/functions_html.php | 17 ++++++++++++++++- pandora_console/pandoradb.sql | 15 +++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index d868f68f48..797660534c 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -385,13 +385,28 @@ function html_print_select_groups($id_user = false, $privilege = "AR", $nothing = '', $nothing_value = 0, $return = false, $multiple = false, $sort = true, $class = '', $disabled = false, $style = false, $option_style = false, $id_group = false, - $keys_field = 'id_grupo', $strict_user = false) { + $keys_field = 'id_grupo', $strict_user = false, $delete_groups = false , $include_groups = false) { global $config; $fields = users_get_groups_for_select($id_user, $privilege, $returnAllGroup, true, $id_group, $keys_field); + + if ($delete_groups && is_array($delete_groups)){ + foreach ($delete_groups as $value) { + unset($fields[$value]); + } + } + + if (is_array($include_groups)){ + $field = array(); + foreach ($include_groups as $value) { + $field[$value] = $fields[$value]; + } + $fields = $field; + } + if ($strict_user) { $fields = users_get_strict_mode_groups($config['id_user'], $returnAllGroup); } diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 1ef3c1f7e8..471b64e048 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2167,6 +2167,20 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` ( UNIQUE (`id_policy`, `id_agent`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- ----------------------------------------------------- +-- Table `tpolicy_groups` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tpolicy_groups` ( + `id` int(10) unsigned NOT NULL auto_increment, + `id_policy` int(10) unsigned default '0', + `id_group` int(10) unsigned default '0', + `policy_applied` tinyint(1) unsigned default '0', + `pending_delete` tinyint(1) unsigned default '0', + `last_apply_utimestamp` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`id`), + UNIQUE (`id_policy`, `id_group`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- --------------------------------------------------------------------- -- Table `tdashboard` -- --------------------------------------------------------------------- @@ -2468,6 +2482,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_queue` ( `id` int(10) unsigned NOT NULL auto_increment, `id_policy` int(10) unsigned NOT NULL default '0', `id_agent` int(10) unsigned NOT NULL default '0', + `id_group` int(10) unsigned NOT NULL default '0', `operation` varchar(15) default '', `progress` int(10) unsigned NOT NULL default '0', `end_utimestamp` int(10) unsigned NOT NULL default 0,