本文整理汇总了PHP中validate_sort_and_sortorder函数的典型用法代码示例。如果您正苦于以下问题:PHP validate_sort_and_sortorder函数的具体用法?PHP validate_sort_and_sortorder怎么用?PHP validate_sort_and_sortorder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了validate_sort_and_sortorder函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: array
$page['hist_arg'] = array('groupid', 'hostid');
define('ZBX_PAGE_DO_REFRESH', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null));
check_fields($fields);
/*
* Permissions
*/
if (get_request('groupid') && !API::HostGroup()->isReadable(array($_REQUEST['groupid']))) {
access_deny();
}
if (get_request('hostid') && !API::Host()->isReadable(array($_REQUEST['hostid']))) {
access_deny();
}
validate_sort_and_sortorder('name', ZBX_SORT_DOWN);
$options = array('groups' => array('real_hosts' => true, 'with_httptests' => true), 'hosts' => array('with_monitored_items' => true, 'with_httptests' => true), 'hostid' => get_request('hostid', null), 'groupid' => get_request('groupid', null));
$pageFilter = new CPageFilter($options);
$_REQUEST['groupid'] = $pageFilter->groupid;
$_REQUEST['hostid'] = $pageFilter->hostid;
$displayNodes = is_array(get_current_nodeid()) && $pageFilter->groupid == 0 && $pageFilter->hostid == 0;
$r_form = new CForm('get');
$r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
$r_form->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB(true)));
$r_form->addItem(array(SPACE . _('Host') . SPACE, $pageFilter->getHostsCB(true)));
$httpmon_wdgt = new CWidget();
$httpmon_wdgt->addPageHeader(_('STATUS OF WEB MONITORING'), get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen'])));
$httpmon_wdgt->addHeader(_('Web scenarios'), $r_form);
$httpmon_wdgt->addHeaderRowNumber();
// TABLE
$table = new CTableInfo(_('No web scenarios found.'));
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:httpmon.php
示例2: array
** 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., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once "include/config.inc.php";
require_once "include/media.inc.php";
require_once "include/forms.inc.php";
$page["title"] = "S_MEDIA_TYPES";
$page["file"] = "media_types.php";
$page['hist_arg'] = array('form', 'mediatypeid');
include_once "include/page_header.php";
$fields = array("mediatypeid" => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({form})&&({form}=="update"))'), "type" => array(T_ZBX_INT, O_OPT, NULL, IN(implode(',', array(MEDIA_TYPE_EMAIL, MEDIA_TYPE_EXEC, MEDIA_TYPE_SMS, MEDIA_TYPE_JABBER))), '(isset({save}))'), "description" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '(isset({save}))'), "smtp_server" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "smtp_helo" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "smtp_email" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "exec_path" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EXEC . ')&&isset({save})'), "gsm_modem" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_SMS . ')&&isset({save})'), "username" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '(isset({type})&&{type}==' . MEDIA_TYPE_JABBER . ')&&isset({save})'), "password" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_JABBER . ')&&isset({save})'), "save" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "delete" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "cancel" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "form" => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), "form_refresh" => array(T_ZBX_INT, O_OPT, NULL, NULL, NULL));
check_fields($fields);
validate_sort_and_sortorder('mt.description', ZBX_SORT_UP);
/* MEDIATYPE ACTIONS */
$result = 0;
if (isset($_REQUEST["save"])) {
if (isset($_REQUEST["mediatypeid"])) {
/* UPDATE */
/* $action = AUDIT_ACTION_UPDATE;*/
$result = update_mediatype($_REQUEST["mediatypeid"], $_REQUEST["type"], $_REQUEST["description"], get_request("smtp_server"), get_request("smtp_helo"), get_request("smtp_email"), get_request("exec_path"), get_request("gsm_modem"), get_request('username'), get_request('password'));
show_messages($result, S_MEDIA_TYPE_UPDATED, S_MEDIA_TYPE_WAS_NOT_UPDATED);
} else {
/* ADD */
/* $action = AUDIT_ACTION_ADD;*/
$result = add_mediatype($_REQUEST["type"], $_REQUEST["description"], get_request("smtp_server"), get_request("smtp_helo"), get_request("smtp_email"), get_request("exec_path"), get_request("gsm_modem"), get_request('username'), get_request('password'));
show_messages($result, S_ADDED_NEW_MEDIA_TYPE, S_NEW_MEDIA_TYPE_WAS_NOT_ADDED);
}
if ($result) {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:media_types.php
示例3: dirname
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/items.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Configuration of discovery rules');
$page['file'] = 'host_discovery.php';
$page['scripts'] = array('class.cviewswitcher.js');
$page['hist_arg'] = array('hostid');
require_once dirname(__FILE__) . '/include/page_header.php';
$paramsFieldName = getParamFieldNameByType(get_request('type', 0));
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, '!isset({form})'), 'itemid' => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({form})&&({form}=="update"))'), 'interfaceid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null, _('Interface')), 'name' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})', _('Name')), 'description' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'filter_macro' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'filter_value' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'key' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})', _('Key')), 'delay' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, SEC_PER_DAY), 'isset({save})&&(isset({type})&&({type}!=' . ITEM_TYPE_TRAPPER . '&&{type}!=' . ITEM_TYPE_SNMPTRAP . '))', _('Update interval (in sec)')), 'delay_flex' => array(T_ZBX_STR, O_OPT, null, '', null), 'add_delay_flex' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'new_delay_flex' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add_delay_flex})&&(isset({type})&&({type}!=2))', _('New flexible interval')), 'status' => array(T_ZBX_INT, O_OPT, null, IN(ITEM_STATUS_ACTIVE), null), 'type' => array(T_ZBX_INT, O_OPT, null, IN(array(-1, ITEM_TYPE_ZABBIX, ITEM_TYPE_SNMPV1, ITEM_TYPE_TRAPPER, ITEM_TYPE_SIMPLE, ITEM_TYPE_SNMPV2C, ITEM_TYPE_INTERNAL, ITEM_TYPE_SNMPV3, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_EXTERNAL, ITEM_TYPE_DB_MONITOR, ITEM_TYPE_IPMI, ITEM_TYPE_SSH, ITEM_TYPE_TELNET, ITEM_TYPE_JMX)), 'isset({save})'), 'authtype' => array(T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHTYPE_PASSWORD . ',' . ITEM_AUTHTYPE_PUBLICKEY), 'isset({save})&&isset({type})&&({type}==' . ITEM_TYPE_SSH . ')'), 'username' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type'), _('User name')), 'password' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type')), 'publickey' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({type})&&({type})==' . ITEM_TYPE_SSH . '&&({authtype})==' . ITEM_AUTHTYPE_PUBLICKEY), 'privatekey' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({type})&&({type})==' . ITEM_TYPE_SSH . '&&({authtype})==' . ITEM_AUTHTYPE_PUBLICKEY), $paramsFieldName => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_DB_MONITOR . ',' . ITEM_TYPE_TELNET . ',' . ITEM_TYPE_CALCULATED, 'type'), getParamFieldLabelByType(get_request('type', 0))), 'snmp_community' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C, 'type'), _('SNMP community')), 'snmp_oid' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('SNMP OID')), 'port' => array(T_ZBX_STR, O_OPT, null, BETWEEN(0, 65535), 'isset({save})&&isset({type})&&' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('Port')), 'snmpv3_contextname' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . '))'), 'snmpv3_securitylevel' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . '))'), 'snmpv3_securityname' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . '))'), 'snmpv3_authprotocol' => array(T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHPROTOCOL_MD5 . ',' . ITEM_AUTHPROTOCOL_SHA), 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . ')&&({snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '||{snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . '))'), 'snmpv3_authpassphrase' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . ')&&({snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '||{snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . '))'), 'snmpv3_privprotocol' => array(T_ZBX_INT, O_OPT, null, IN(ITEM_PRIVPROTOCOL_DES . ',' . ITEM_PRIVPROTOCOL_AES), 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . ')&&({snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '))'), 'snmpv3_privpassphrase' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_SNMPV3 . ')&&({snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '))'), 'ipmi_sensor' => array(T_ZBX_STR, O_OPT, NO_TRIM, NOT_EMPTY, 'isset({save})&&(isset({type})&&({type}==' . ITEM_TYPE_IPMI . '))', _('IPMI sensor')), 'trapper_hosts' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({type})&&({type}==2)'), 'lifetime' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'go' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'g_hostdruleid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'clone' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'update' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'delete' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favref' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'favstate' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})&&("filter"=={favobj})'));
check_fields($fields);
validate_sort_and_sortorder('name', ZBX_SORT_UP);
$_REQUEST['go'] = get_request('go', 'none');
$_REQUEST['params'] = get_request($paramsFieldName, '');
unset($_REQUEST[$paramsFieldName]);
/*
* Permissions
*/
if (get_request('itemid', false)) {
$item = API::DiscoveryRule()->get(array('itemids' => $_REQUEST['itemid'], 'output' => API_OUTPUT_EXTEND, 'selectHosts' => array('status', 'flags'), 'editable' => true));
$item = reset($item);
if (!$item) {
access_deny();
}
$_REQUEST['hostid'] = $item['hostid'];
$host = reset($item['hosts']);
} else {
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:host_discovery.php
示例4: dirname
**
** 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/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Host inventory overview');
$page['file'] = 'hostinventoriesoverview.php';
$page['hist_arg'] = array('groupid', 'hostid');
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groupby' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, NULL));
check_fields($fields);
validate_sort_and_sortorder('host_count', ZBX_SORT_DOWN);
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
require_once dirname(__FILE__) . '/include/page_footer.php';
exit;
}
$options = array('groups' => array('real_hosts' => 1), 'groupid' => get_request('groupid', null));
$pageFilter = new CPageFilter($options);
$_REQUEST['groupid'] = $pageFilter->groupid;
$_REQUEST['groupby'] = get_request('groupby', '');
$groupFieldTitle = '';
$hostinvent_wdgt = new CWidget();
$hostinvent_wdgt->addPageHeader(_('HOST INVENTORY OVERVIEW'));
// getting inventory fields to make a drop down
$inventoryFields = getHostInventories(true);
// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('groupby', $_REQUEST['groupby'], 'submit()');
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:hostinventoriesoverview.php
示例5: validate_sort_and_sortorder
//--
if (isset($_REQUEST['filter_set']) || isset($_REQUEST['filter_rst'])) {
CProfile::update('web.tr_status.filter.show_details', $_REQUEST['show_details'], PROFILE_TYPE_INT);
CProfile::update('web.tr_status.filter.show_events', $_REQUEST['show_events'], PROFILE_TYPE_INT);
CProfile::update('web.tr_status.filter.ack_status', $_REQUEST['ack_status'], PROFILE_TYPE_INT);
CProfile::update('web.tr_status.filter.show_severity', $_REQUEST['show_severity'], PROFILE_TYPE_INT);
CProfile::update('web.tr_status.filter.txt_select', $_REQUEST['txt_select'], PROFILE_TYPE_STR);
CProfile::update('web.tr_status.filter.status_change', $_REQUEST['status_change'], PROFILE_TYPE_INT);
CProfile::update('web.tr_status.filter.status_change_days', $_REQUEST['status_change_days'], PROFILE_TYPE_INT);
}
$show_triggers = $_REQUEST['show_triggers'];
$show_events = $_REQUEST['show_events'];
$show_severity = $_REQUEST['show_severity'];
$ack_status = $_REQUEST['ack_status'];
// --------------
validate_sort_and_sortorder('lastchange', ZBX_SORT_DOWN);
$mute = CProfile::get('web.tr_status.mute', 0);
if (isset($audio) && !$mute) {
play_sound($audio);
}
$trigg_wdgt = new CWidget();
$r_form = new CForm(null, 'get');
$r_form->addItem(array(S_GROUP . SPACE, $pageFilter->getGroupsCB(true)));
$r_form->addItem(array(SPACE . S_HOST . SPACE, $pageFilter->getHostsCB(true)));
$r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
$fs_icon = get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen']));
$trigg_wdgt->addPageHeader(S_STATUS_OF_TRIGGERS_BIG . ' [' . date(S_DATE_FORMAT_YMDHMS) . ']', array($fs_icon));
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$trigg_wdgt->addHeader(S_TRIGGERS_BIG, $r_form);
$trigg_wdgt->addHeader($numrows);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_status.php
示例6: array
require_once 'include/triggers.inc.php';
require_once 'include/media.inc.php';
require_once 'include/users.inc.php';
require_once 'include/forms.inc.php';
require_once 'include/js.inc.php';
$page['title'] = 'S_USERS';
$page['file'] = 'users.php';
$page['hist_arg'] = array('config');
$page['scripts'] = array('menu_scripts.js');
include_once 'include/page_header.php';
$_REQUEST['config'] = get_request('config', get_profile('web.users.config', 0));
update_profile('web.users.config', $_REQUEST['config'], PROFILE_TYPE_INT);
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('config' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'perm_details' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'userid' => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({config})&&({config}==0))&&(isset({form})&&({form}=="update"))'), 'group_userid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'filter_usrgrpid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'alias' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({config})&&({config}==0))&&isset({save})'), 'name' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({config})&&({config}==0))&&isset({save})'), 'surname' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({config})&&({config}==0))&&isset({save})'), 'password1' => array(T_ZBX_STR, O_OPT, null, null, '(isset({config})&&({config}==0))&&isset({save})&&(isset({form})&&({form}!="update"))&&isset({change_password})'), "password2" => array(T_ZBX_STR, O_OPT, null, null, '(isset({config})&&({config}==0))&&isset({save})&&(isset({form})&&({form}!="update"))&&isset({change_password})'), 'user_type' => array(T_ZBX_INT, O_OPT, null, IN('1,2,3'), '(isset({config})&&({config}==0))&&isset({save})'), 'user_groups' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, null), 'user_groups_to_del' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'user_medias' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, null), 'user_medias_to_del' => array(T_ZBX_STR, O_OPT, null, DB_ID, null), 'new_group' => array(T_ZBX_STR, O_OPT, null, null, null), 'new_media' => array(T_ZBX_STR, O_OPT, null, null, null), 'enable_media' => array(T_ZBX_INT, O_OPT, null, null, null), 'disable_media' => array(T_ZBX_INT, O_OPT, null, null, null), 'lang' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({config})&&({config}==0))&&isset({save})'), 'theme' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({config})&&({config}==0))&&isset({save})'), 'autologin' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'autologout' => array(T_ZBX_INT, O_OPT, null, BETWEEN(90, 10000), null), 'url' => array(T_ZBX_STR, O_OPT, null, null, '(isset({config})&&({config}==0))&&isset({save})'), 'refresh' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 3600), '(isset({config})&&({config}==0))&&isset({save})'), 'right' => array(T_ZBX_STR, O_NO, null, NOT_EMPTY, '(isset({register})&&({register}=="add permission"))&&isset({userid})'), 'permission' => array(T_ZBX_STR, O_NO, null, NOT_EMPTY, '(isset({register})&&({register}=="add permission"))&&isset({userid})'), 'id' => array(T_ZBX_INT, O_NO, null, DB_ID, '(isset({register})&&({register}=="add permission"))&&isset({userid})'), 'rightid' => array(T_ZBX_INT, O_NO, null, DB_ID, '(isset({register})&&({register}=="delete permission"))&&isset({userid})'), 'grpaction' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'usrgrpid' => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({config})&&(({config}==1) || isset({grpaction})))&&(isset({form})&&({form}=="update"))'), 'group_groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'selusrgrp' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'gname' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({config})&&({config}==1))&&isset({save})'), 'users' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'users_status' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), '(isset({config})&&({config}==1))&&isset({save})'), 'gui_access' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), '(isset({config})&&({config}==1))&&isset({save})'), 'new_right' => array(T_ZBX_STR, O_OPT, null, null, null), 'right_to_del' => array(T_ZBX_STR, O_OPT, null, null, null), 'group_users_to_del' => array(T_ZBX_STR, O_OPT, null, null, null), 'group_users' => array(T_ZBX_STR, O_OPT, null, null, null), 'group_rights' => array(T_ZBX_STR, O_OPT, null, null, null), 'set_users_status' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'set_gui_access' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), null), 'register' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, IN('"add permission","delete permission"'), null), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'delete' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'delete_selected' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'del_user_group' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'del_user_media' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'del_read_only' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'del_read_write' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'del_deny' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'del_group_user' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'add_read_only' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'add_read_write' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'add_deny' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'change_password' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_STR, O_OPT, null, null, null));
check_fields($fields);
validate_sort_and_sortorder('u.alias', ZBX_SORT_UP);
if ($_REQUEST['config'] == 0) {
if (isset($_REQUEST['new_group'])) {
$_REQUEST['user_groups'] = get_request('user_groups', array());
foreach ($_REQUEST['new_group'] as $id => $val) {
$_REQUEST['user_groups'][$id] = $val;
}
} else {
if (isset($_REQUEST['new_media'])) {
$_REQUEST['user_medias'] = get_request('user_medias', array());
array_push($_REQUEST['user_medias'], $_REQUEST['new_media']);
} else {
if (isset($_REQUEST['user_medias']) && isset($_REQUEST['enable_media'])) {
if (isset($_REQUEST['user_medias'][$_REQUEST['enable_media']])) {
$_REQUEST['user_medias'][$_REQUEST['enable_media']]['active'] = 0;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:users.php
示例7: array
* Display
*/
if (isset($_REQUEST['form'])) {
$data = array('nodeid' => get_request('nodeid'), 'masterNode' => DBfetch(DBselect('SELECT n.name FROM nodes n WHERE n.masterid IS NULL AND n.nodetype=' . ZBX_NODE_MASTER)));
if (get_request('nodeid') && !isset($_REQUEST['form_refresh'])) {
$data['new_nodeid'] = $node['nodeid'];
$data['name'] = $node['name'];
$data['ip'] = $node['ip'];
$data['port'] = $node['port'];
$data['masterid'] = $node['masterid'];
$data['nodetype'] = $node['nodetype'];
} else {
$data['new_nodeid'] = get_request('new_nodeid');
$data['name'] = get_request('name', '');
$data['ip'] = get_request('ip', '127.0.0.1');
$data['port'] = get_request('port', 10051);
$data['nodetype'] = get_request('nodetype', ZBX_NODE_CHILD);
$data['masterid'] = get_request('masterid', get_current_nodeid(false));
}
$nodeView = new CView('administration.node.edit', $data);
} else {
validate_sort_and_sortorder();
$data = array();
if (ZBX_DISTRIBUTED) {
$data['nodes'] = DBselect('SELECT n.* FROM nodes n ' . order_by('n.nodeid,n.name,n.ip', 'n.masterid'));
}
$nodeView = new CView('administration.node.list', $data);
}
$nodeView->render();
$nodeView->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:nodes.php
示例8: array
$page['file'] = 'maintenance.php';
$page['hist_arg'] = array('groupid', 'hostid');
$page['scripts'] = array('menu_scripts.js', 'calendar.js');
include_once 'include/page_header.php';
$available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_WRITE);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_WRITE);
if (isset($_REQUEST['groupid']) && $_REQUEST['groupid'] > 0 && !isset($available_groups[$_REQUEST['groupid']])) {
access_deny();
}
if (isset($_REQUEST['hostid']) && $_REQUEST['hostid'] > 0 && !isset($available_hosts[$_REQUEST['hostid']])) {
access_deny();
}
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('hosts' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groups' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'hostids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groupids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'maintenanceid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form})&&({form}=="update")'), 'maintenanceids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'mname' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({save})'), 'maintenance_type' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'description' => array(T_ZBX_STR, O_OPT, NULL, null, 'isset({save})'), 'active_since' => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, time() * 2), 'isset({save})'), 'active_till' => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, time() * 2), 'isset({save})'), 'new_timeperiod' => array(T_ZBX_STR, O_OPT, null, null, 'isset({add_timeperiod})'), 'timeperiods' => array(T_ZBX_STR, O_OPT, null, null, null), 'g_timeperiodid' => array(null, O_OPT, null, null, null), 'edit_timeperiodid' => array(null, O_OPT, P_ACT, DB_ID, null), 'go' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'add_timeperiod' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'del_timeperiod' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel_new_timeperiod' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'clone' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'delete' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'form_refresh' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL));
check_fields($fields);
validate_sort_and_sortorder('h.host', ZBX_SORT_UP);
$_REQUEST['go'] = get_request('go', 'none');
/************ MAINTENANCE ****************/
if (inarr_isset(array('clone', 'maintenanceid'))) {
unset($_REQUEST['maintenanceid']);
$_REQUEST['form'] = 'clone';
} else {
if (isset($_REQUEST['cancel_new_timeperiod'])) {
unset($_REQUEST['new_timeperiod']);
} else {
if (isset($_REQUEST['save'])) {
if (!count(get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_WRITE, PERM_RES_IDS_ARRAY))) {
access_deny();
}
$maintenance = array('name' => $_REQUEST['mname'], 'maintenance_type' => $_REQUEST['maintenance_type'], 'description' => $_REQUEST['description'], 'active_since' => $_REQUEST['active_since'], 'active_till' => zbx_empty($_REQUEST['active_till']) ? 0 : $_REQUEST['active_till']);
$timeperiods = get_request('timeperiods', array());
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:maintenance.php
示例9: dirname
* ** 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/config.inc.php';
require_once dirname(__FILE__) . '/include/hosts.inc.php';
require_once dirname(__FILE__) . '/include/items.inc.php';
$page['title'] = _('Sort hosts by itemvalues');
$page['file'] = 'sort.php';
$page['hist_arg'] = array('group', 'item');
$page['scripts'] = array('class.cswitcher.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
if ($page['type'] == PAGE_TYPE_HTML) {
define('ZBX_PAGE_DO_REFRESH', 1);
}
validate_sort_and_sortorder('lastvalue', ZBX_SORT_DOWN);
$sortfield = getPageSortField('lastvalue');
$sortorder = getPageSortOrder();
require_once dirname(__FILE__) . '/include/page_header.php';
$fields = array('group' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'item' => array(T_ZBX_STR, O_OPT, P_SYS, null, null));
check_fields($fields);
$_REQUEST['group'] = get_request('group');
$_REQUEST['item'] = get_request('item');
if (get_request('group') && !API::HostGroup()->isReadable(array($_REQUEST['group']))) {
access_deny();
}
$sortWidget = new CWidget();
$groups = API::HostGroup()->get(array('output' => API_OUTPUT_EXTEND));
order_result($groups, 'name');
$group_combo = new CComboBox('group', $_REQUEST['group'], 'javascript: submit();');
foreach ($groups as $group) {
开发者ID:PenGCanNtFly,项目名称:Zabbix-Plugin-Sort,代码行数:31,代码来源:sort.php
示例10: array
** 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., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
require_once 'include/discovery.inc.php';
$page['hist_arg'] = array('druleid');
$page['file'] = 'discovery.php';
$page['title'] = 'S_STATUS_OF_DISCOVERY';
include_once 'include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('druleid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, NULL, NULL), 'favref' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'));
check_fields($fields);
validate_sort_and_sortorder('ip', ZBX_SORT_UP);
/* AJAX */
if (isset($_REQUEST['favobj'])) {
if ('hat' == $_REQUEST['favobj']) {
CProfile::update('web.discovery.hats.' . $_REQUEST['favref'] . '.state', $_REQUEST['state'], PROFILE_TYPE_INT);
}
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
include_once 'include/page_footer.php';
exit;
}
//--------
$dscvry_wdgt = new CWidget('hat_discovery');
// HEADER
$r_form = new CForm();
$r_form->setMethod('get');
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:discovery.php
示例11: array
require_once 'include/actions.inc.php';
require_once 'include/users.inc.php';
$page['title'] = "S_AUDIT";
$page['file'] = 'audit.php';
$page['hist_arg'] = array('prev', 'next');
$page['scripts'] = array('calendar.js', 'scriptaculous.js?load=effects');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
if (PAGE_TYPE_HTML == $page['type']) {
define('ZBX_PAGE_DO_REFRESH', 1);
}
$_REQUEST['config'] = get_request('config', get_profile('web.audit.config', 0));
include_once 'include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array('config' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), NULL), 'groupid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, NULL), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, NULL), 'next_page' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'prev_page' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'prev_clock' => array(T_ZBX_INT, O_OPT, P_SYS, null, NULL), 'curr_clock' => array(T_ZBX_INT, O_OPT, P_SYS, null, NULL), 'next_clock' => array(T_ZBX_INT, O_OPT, P_SYS, null, NULL), 'action' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(-1, 6), NULL), 'resourcetype' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(-1, 28), NULL), 'filter_rst' => array(T_ZBX_INT, O_OPT, P_SYS, IN(array(0, 1)), NULL), 'filter_set' => array(T_ZBX_STR, O_OPT, P_SYS, null, NULL), 'userid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'nav_time' => array(T_ZBX_INT, O_OPT, P_UNSET_EMPTY, null, NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, NULL, NULL), 'favid' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj}) && ("filter"=={favobj})'));
check_fields($fields);
validate_sort_and_sortorder('a.clock', ZBX_SORT_DOWN);
/* AJAX */
if (isset($_REQUEST['favobj'])) {
if ('filter' == $_REQUEST['favobj']) {
update_profile('web.audit.filter.state', $_REQUEST['state'], PROFILE_TYPE_INT);
}
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
exit;
}
//--------
/* FILTER */
if (isset($_REQUEST['filter_rst'])) {
$_REQUEST['userid'] = 0;
$_REQUEST['action'] = -1;
$_REQUEST['resourcetype'] = -1;
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:audit.php
示例12: get_history_of_actions
function get_history_of_actions($limit, &$last_clock = null, $sql_cond = '')
{
validate_sort_and_sortorder('clock', ZBX_SORT_DOWN);
$available_triggers = get_accessible_triggers(PERM_READ_ONLY, array());
$alerts = array();
$clock = array();
$table = new CTableInfo(S_NO_ACTIONS_FOUND);
$table->setHeader(array(is_show_all_nodes() ? make_sorting_header(S_NODES, 'a.alertid') : null, make_sorting_header(S_TIME, 'clock'), make_sorting_header(S_TYPE, 'description'), make_sorting_header(S_STATUS, 'status'), make_sorting_header(S_RETRIES_LEFT, 'retries'), make_sorting_header(S_RECIPIENTS, 'sendto'), S_MESSAGE, S_ERROR));
$sql = 'SELECT a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,a.status,a.retries,a.error ' . ' FROM events e, alerts a ' . ' LEFT JOIN media_type mt ON mt.mediatypeid=a.mediatypeid ' . ' WHERE e.eventid = a.eventid ' . ' AND alerttype IN (' . ALERT_TYPE_MESSAGE . ') ' . $sql_cond . ' AND ' . DBcondition('e.objectid', $available_triggers) . ' AND ' . DBin_node('a.alertid') . ' ORDER BY a.clock DESC';
$result = DBselect($sql, $limit);
while ($row = DBfetch($result)) {
$alerts[] = $row;
$clock[] = $row['clock'];
}
$last_clock = !empty($clock) ? min($clock) : null;
$sortfield = getPageSortField('clock');
$sortorder = getPageSortOrder();
order_result($alerts, $sortfield, $sortorder);
foreach ($alerts as $num => $row) {
$time = zbx_date2str(S_HISTORY_OF_ACTIONS_DATE_FORMAT, $row['clock']);
if ($row['status'] == ALERT_STATUS_SENT) {
$status = new CSpan(S_SENT, 'green');
$retries = new CSpan(SPACE, 'green');
} else {
if ($row['status'] == ALERT_STATUS_NOT_SENT) {
$status = new CSpan(S_IN_PROGRESS, 'orange');
$retries = new CSpan(ALERT_MAX_RETRIES - $row['retries'], 'orange');
} else {
$status = new CSpan(S_NOT_SENT, 'red');
$retries = new CSpan(0, 'red');
}
}
$sendto = $row['sendto'];
$message = array(bold(S_SUBJECT . ': '), br(), $row['subject'], br(), br(), bold(S_MESSAGE . ': '), br(), $row['message']);
if (empty($row['error'])) {
$error = new CSpan(SPACE, 'off');
} else {
$error = new CSpan($row['error'], 'on');
}
$table->addRow(array(get_node_name_by_elid($row['alertid']), new CCol($time, 'top'), new CCol($row['description'], 'top'), new CCol($status, 'top'), new CCol($retries, 'top'), new CCol($sendto, 'top'), new CCol($message, 'top'), new CCol($error, 'wraptext top')));
}
return $table;
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:43,代码来源:actions.inc.php
注:本文中的validate_sort_and_sortorder函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论