Source
xxxxxxxxxx
$filter_tab['filter_src']['filter_view_data'] = $this->getAdditionalData($filter_tab['filter_src']);
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
class CControllerHostView extends CControllerHost {
protected function init(): void {
$this->disableCsrfValidation();
}
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;
}
}
}
// Validate severity checkbox filter.