Source
$data['warnings'][] = _("The host being cloned belongs to a host group you don't have write permissions to. Non-writable group has been removed from the new host.");
<?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.
**/
require_once dirname(__FILE__).'/../../include/forms.inc.php';
/**
* Configuration host edit controller for full-page form.
*/
class CControllerHostEdit extends CController {
/**
* Edited host.
*
* @var ?array
*/
protected $host;
protected function init() {
$this->disableSIDValidation();
}
protected function checkInput(): bool {
$fields = [
'hostid' => 'db hosts.hostid',
'groupids' => 'array_db hosts_groups.groupid',
'clone' => 'in 1',
'full_clone' => 'in 1',
'host' => 'db hosts.host',
'visiblename' => 'db hosts.name',
'description' => 'db hosts.description',
'status' => 'db hosts.status|in '.implode(',', [HOST_STATUS_MONITORED,
HOST_STATUS_NOT_MONITORED
]),
'proxy_hostid' => 'db hosts.proxy_hostid',
'interfaces' => 'array',
'mainInterfaces' => 'array',
'groups' => 'array',
'tags' => 'array',
'templates' => 'array_db hosts.hostid',
'add_templates' => 'array_db hosts.hostid',
'ipmi_authtype' => 'in '.implode(',', [IPMI_AUTHTYPE_DEFAULT, IPMI_AUTHTYPE_NONE, IPMI_AUTHTYPE_MD2,
IPMI_AUTHTYPE_MD5, IPMI_AUTHTYPE_STRAIGHT, IPMI_AUTHTYPE_OEM,
IPMI_AUTHTYPE_RMCP_PLUS
]),
'ipmi_privilege' => 'in '.implode(',', [IPMI_PRIVILEGE_CALLBACK, IPMI_PRIVILEGE_USER,