0) { $group = db_get_row('tgrupo', 'id_grupo', $id_group); if ($group !== false) { $icon = $group['icon']; $name = $group['nombre']; $id_parent = $group['parent']; $group_pass = io_safe_output($group['password']); $alerts_disabled = $group['disabled']; $custom_id = $group['custom_id']; $propagate = $group['propagate']; $skin = $group['id_skin']; $contact = $group['contact']; $other = $group['other']; $description = $group['description']; $max_agents = $group['max_agents']; } else { db_pandora_audit( AUDIT_LOG_SYSTEM, 'There was a problem loading group in configure agent group.' ); include 'general/noaccess.php'; exit; } } else { // Set default values. $icon = ''; $name = ''; $id_parent = 0; $group_pass = ''; $alerts_disabled = 0; $custom_id = ''; $propagate = 0; $skin = 0; $contact = ''; $other = ''; $description = ''; $max_agents = 0; } // Header. if (is_metaconsole() === true) { agents_meta_print_header(); $sec = 'advanced'; } else { $title_in_header = ($id_group > 0) ? __('Update group') : __('Create group'); // Header. ui_print_standard_header( $title_in_header, 'images/group.png', false, '', false, [], [ [ 'link' => '', 'label' => __('Profiles'), ], [ 'link' => '', 'label' => __('Manage agents group'), ], ] ); $sec = 'gagente'; } // Data before table. $files = list_files(((is_metaconsole() === true) ? '../../' : '').'images/', '@groups.svg', 1, 0); $files_old = list_files('images/groups_small/', 'png', 1, 0); foreach ($files_old as $key => $f) { // Remove from the list the non-desired .png files. if (strpos($f, '.bad.png') !== false || strpos($f, '.default.png') !== false || strpos($f, '.ok.png') !== false || strpos($f, '.warning.png') !== false) { unset($files_old[$key]); } } $files = array_merge($files, $files_old); $table = new stdClass(); $table->width = '100%'; $table->class = 'databox filter-table-adv'; $table->size = []; $table->size[0] = '50%'; $table->size[1] = '50%'; $table->data = []; $table->data[0][0] = html_print_label_input_block( __('Name'), html_print_input_text('name', $name, '', 35, 100, true) ); $extension = pathinfo($icon, PATHINFO_EXTENSION); if (empty($extension) === true) { $icon .= '.png'; } $input_icon = html_print_select($files, 'icon', $icon, '', 'None', '', true, false, true, '', false, 'width: 100%;'); $input_icon .= ' '; if (empty($icon) === false) { if (empty($extension) === true || $extension === 'png') { $input_icon .= html_print_image('images/groups_small/'.$icon, true); } else { $input_icon .= html_print_image('images/'.$icon, true); } } $input_icon .= ''; $table->data[0][1] = html_print_label_input_block( __('Icon'), html_print_div( [ 'class' => 'flex-content-left ', 'content' => $input_icon, ], true ) ); if ($id_group > 0) { // The user can access to the parent, but she want to edit the group. if ((bool) check_acl($config['id_user'], $id_parent, 'AR') === false) { $acl_parent = false; $input_parent = __('You have not access to the parent.').html_print_input_hidden('id_parent', $id_parent, true); } else { $input_parent = '