Source
xxxxxxxxxx
$filter_tab['filter_src']['filter_view_data'] = $this->getAdditionalData($filter_tab['filter_src']);
<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
class CControllerHostView extends CControllerHost {
protected function init(): void {
$this->disableSIDValidation();
}
protected function checkInput(): bool {
$fields = [
'name' => 'string',
'groupids' => 'array_db hosts_groups.groupid',
'ip' => 'string',
'dns' => 'string',
'port' => 'string',
'status' => 'in -1,'.HOST_STATUS_MONITORED.','.HOST_STATUS_NOT_MONITORED,
'evaltype' => 'in '.TAG_EVAL_TYPE_AND_OR.','.TAG_EVAL_TYPE_OR,
'tags' => 'array',
'severities' => 'array',
'show_suppressed' => 'in '.ZBX_PROBLEM_SUPPRESSED_FALSE.','.ZBX_PROBLEM_SUPPRESSED_TRUE,
'maintenance_status' => 'in '.HOST_MAINTENANCE_STATUS_OFF.','.HOST_MAINTENANCE_STATUS_ON,
'sort' => 'in name,status',
'sortorder' => 'in '.ZBX_SORT_UP.','.ZBX_SORT_DOWN,
'page' => 'ge 1',
'filter_name' => 'string',
'filter_custom_time' => 'in 1,0',
'filter_show_counter' => 'in 1,0',
'filter_counters' => 'in 1',
'filter_reset' => 'in 1',
'counter_index' => 'ge 0'
];
$ret = $this->validateInput($fields);
// Validate tags filter.
if ($ret && $this->hasInput('tags')) {
foreach ($this->getInput('tags') as $filter_tag) {
if (!is_array($filter_tag)
|| count($filter_tag) != 3
|| !array_key_exists('tag', $filter_tag) || !is_string($filter_tag['tag'])
|| !array_key_exists('value', $filter_tag) || !is_string($filter_tag['value'])
|| !array_key_exists('operator', $filter_tag) || !is_string($filter_tag['operator'])) {
$ret = false;
break;