Source
* @param array $parent_templates The list of the templates, prepared by getHostPrototypeParentTemplates() function.
<?php
/*
** Zabbix
** 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 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.
**/
/**
* Get ipmi auth type label by it's number.
*
* @param null|int $type
*
* @return array|string
*/
function ipmiAuthTypes($type = null) {
$types = [
IPMI_AUTHTYPE_DEFAULT => _('Default'),
IPMI_AUTHTYPE_NONE => _('None'),
IPMI_AUTHTYPE_MD2 => _('MD2'),
IPMI_AUTHTYPE_MD5 => 'MD5',
IPMI_AUTHTYPE_STRAIGHT => _('Straight'),
IPMI_AUTHTYPE_OEM => _('OEM'),
IPMI_AUTHTYPE_RMCP_PLUS => _('RMCP+')
];
if (is_null($type)) {
return $types;
}
elseif (isset($types[$type])) {
return $types[$type];
}
else {
return _('Unknown');
}
}
/**
* Get ipmi auth privilege label by it's number.
*
* @param null|int $type
*
* @return array|string
*/
function ipmiPrivileges($type = null) {
$types = [
IPMI_PRIVILEGE_CALLBACK => _('Callback'),
IPMI_PRIVILEGE_USER => _('User'),
IPMI_PRIVILEGE_OPERATOR => _('Operator'),
IPMI_PRIVILEGE_ADMIN => _('Admin'),