Source
'item_type' => 'in '.implode(',', [ITEM_TYPE_ZABBIX, ITEM_TYPE_TRAPPER, ITEM_TYPE_SIMPLE, ITEM_TYPE_INTERNAL, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_HTTPTEST, ITEM_TYPE_EXTERNAL, ITEM_TYPE_DB_MONITOR, ITEM_TYPE_IPMI, ITEM_TYPE_SSH, ITEM_TYPE_TELNET, ITEM_TYPE_CALCULATED, ITEM_TYPE_JMX, ITEM_TYPE_SNMPTRAP, ITEM_TYPE_DEPENDENT, ITEM_TYPE_HTTPAGENT, ITEM_TYPE_SNMP, ITEM_TYPE_SCRIPT, ITEM_TYPE_BROWSER]),
<?php
/*
** 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/>.
**/
/**
* Controller to perform preprocessing test or 'get item value from host' test or both.
*/
class CControllerPopupItemTestSend extends CControllerPopupItemTest {
/**
* Show final result in item test dialog.
*
* @var bool
*/
protected $show_final_result;
/**
* Use previous value for preprocessing test.
*
* @var bool
*/
protected $use_prev_value;
/**
* Retrieve value from host.
*
* @var bool
*/
protected $get_value_from_host;
private const SUPPORTED_STATE = 0;
private const NOT_SUPPORTED_STATE = 1;
/**
* Time suffixes supported by Zabbix server.
*
* @var array
*/
protected static $supported_time_suffixes = ['w', 'd', 'h', 'm', 's'];
protected function checkInput() {
$fields = [
'authtype' => 'in '.implode(',', [ZBX_HTTP_AUTH_NONE, ZBX_HTTP_AUTH_BASIC, ZBX_HTTP_AUTH_NTLM, ZBX_HTTP_AUTH_KERBEROS, ZBX_HTTP_AUTH_DIGEST, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]),
'get_value' => 'in 0,1',
'eol' => 'in '.implode(',', [ZBX_EOL_LF, ZBX_EOL_CRLF]),
'headers' => 'array',
'test_with' => 'in '.implode(',', [self::TEST_WITH_SERVER, self::TEST_WITH_PROXY]),
'proxyid' => 'id',
'hostid' => 'db hosts.hostid',
'http_authtype' => 'in '.implode(',', [ZBX_HTTP_AUTH_NONE, ZBX_HTTP_AUTH_BASIC, ZBX_HTTP_AUTH_NTLM, ZBX_HTTP_AUTH_KERBEROS, ZBX_HTTP_AUTH_DIGEST, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]),
'http_password' => 'string',