This commit is contained in:
Daniel Maya 2017-07-11 10:10:48 +02:00
parent ef22945b80
commit 57f6ad097a
2 changed files with 31 additions and 1 deletions

View File

@ -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);
}

View File

@ -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,