Source
xxxxxxxxxx
array_push($where, 'h.status in ('.HOST_STATUS_MONITORED.','.HOST_STATUS_NOT_MONITORED.','.HOST_STATUS_TEMPLATE.')');
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 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 permission label.
*
* @param int $permission
*
* @return string
*/
function permission2str($permission) {
$permissions = [
PERM_READ_WRITE => _('Read-write'),
PERM_READ => _('Read only'),
PERM_DENY => _('Deny')
];
return $permissions[$permission];
}
/**
* Get authentication label.
*
* @param int $type
*
* @return string
*/
function authentication2str($type) {
$authentications = [
ZBX_AUTH_INTERNAL => _('Zabbix internal authentication'),
ZBX_AUTH_LDAP => _('LDAP authentication')
];
return $authentications[$type];
}
/***********************************************
CHECK USER ACCESS TO SYSTEM STATUS
************************************************/
/* Function: check_perm2system()
*
* Description:
* Checking user permissions to access system (affects server side: no notification will be sent)
*
* Comments:
* return true if permission is positive
*/
function check_perm2system($userid) {
$sql = 'SELECT g.usrgrpid'.
' FROM usrgrp g,users_groups ug'.
' WHERE ug.userid='.zbx_dbstr($userid).
' AND g.usrgrpid=ug.usrgrpid'.
' AND g.users_status='.GROUP_STATUS_DISABLED;
if ($res = DBfetch(DBselect($sql, 1))) {
return false;
}
return true;
}
/**
* Checking user permissions to login in frontend.
*
* @param string $userId
*
* @return bool
*/
function check_perm2login($userId) {
return (getUserGuiAccess($userId) != GROUP_GUI_ACCESS_DISABLED);
}
/**
* Get user gui access.
*