当前位置: 首页>>代码示例>>PHP>>正文


PHP hasRequest函数代码示例

本文整理汇总了PHP中hasRequest函数的典型用法代码示例。如果您正苦于以下问题:PHP hasRequest函数的具体用法?PHP hasRequest怎么用?PHP hasRequest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了hasRequest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DBstart

        DBstart();
        $result = deleteHistoryByHttpTestIds($httpTestIds);
        $result = $result && DBexecute('UPDATE httptest SET nextcheck=0 WHERE ' . dbConditionInt('httptestid', $httpTestIds));
        if ($result) {
            foreach ($httpTests as $httpTest) {
                $host = reset($httpTest['hosts']);
                add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_SCENARIO, 'Scenario [' . $httpTest['name'] . '] [' . $httpTest['httptestid'] . '] ' . 'Host [' . $host['name'] . '] history cleared');
            }
        }
        $result = DBend($result);
        if ($result) {
            uncheckTableRows(getRequest('hostid'));
        }
    }
    show_messages($result, _('History cleared'), _('Cannot clear history'));
} elseif (hasRequest('action') && getRequest('action') === 'httptest.massdelete' && hasRequest('group_httptestid') && is_array(getRequest('group_httptestid'))) {
    $result = API::HttpTest()->delete(getRequest('group_httptestid'));
    if ($result) {
        uncheckTableRows(getRequest('hostid'));
    }
    show_messages($result, _('Web scenario deleted'), _('Cannot delete web scenario'));
}
show_messages();
/*
 * Display
 */
if (isset($_REQUEST['form'])) {
    $data = array('hostid' => getRequest('hostid', 0), 'httptestid' => getRequest('httptestid'), 'form' => getRequest('form'), 'form_refresh' => getRequest('form_refresh'), 'templates' => array());
    $host = API::Host()->get(array('output' => array('status'), 'hostids' => $data['hostid'], 'templated_hosts' => true));
    $data['host'] = reset($host);
    if (isset($data['httptestid'])) {
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:httpconf.php

示例2: array

$page['file'] = 'screens.php';
$page['hist_arg'] = array('elementid');
$page['scripts'] = array('effects.js', 'dragdrop.js', 'class.calendar.js', 'gtlc.js', 'flickerfreescreen.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
define('ZBX_PAGE_DO_JS_REFRESH', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'tr_groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'tr_hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'screenid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null), 'step' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null), 'period' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'reset' => array(T_ZBX_STR, O_OPT, P_SYS, IN('"reset"'), null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'filterState' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null), 'favaction' => array(T_ZBX_STR, O_OPT, P_ACT, IN('"add","remove"'), null));
check_fields($fields);
/*
 * Ajax
 */
if (hasRequest('filterState')) {
    CProfile::update('web.hostscreen.filter.state', getRequest('filterState'), PROFILE_TYPE_INT);
}
if (getRequest('favobj') === 'timeline' && hasRequest('elementid') && hasRequest('period')) {
    navigation_bar_calc('web.hostscreen', getRequest('elementid'), true);
}
if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) {
    require_once dirname(__FILE__) . '/include/page_footer.php';
    exit;
}
/*
 * Display
 */
$data = array('hostid' => getRequest('hostid', 0), 'fullscreen' => $_REQUEST['fullscreen'], 'screenid' => getRequest('screenid', CProfile::get('web.hostscreen.screenid', null)), 'period' => getRequest('period'), 'stime' => getRequest('stime'));
CProfile::update('web.hostscreen.screenid', $data['screenid'], PROFILE_TYPE_ID);
// get screen list
$data['screens'] = API::TemplateScreen()->get(array('hostids' => $data['hostid'], 'output' => API_OUTPUT_EXTEND));
$data['screens'] = zbx_toHash($data['screens'], 'screenid');
order_result($data['screens'], 'name');
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:host_screen.php

示例3: dirname

            CProfile::update('web.auditlogs.timelinefixed', $_REQUEST['favid'], PROFILE_TYPE_INT);
        }
    }
}
if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) {
    require_once dirname(__FILE__) . '/include/page_footer.php';
    exit;
}
/*
 * Filter
 */
if (hasRequest('filter_set')) {
    CProfile::update('web.auditlogs.filter.alias', getRequest('alias', ''), PROFILE_TYPE_STR);
    CProfile::update('web.auditlogs.filter.action', getRequest('action', -1), PROFILE_TYPE_INT);
    CProfile::update('web.auditlogs.filter.resourcetype', getRequest('resourcetype', -1), PROFILE_TYPE_INT);
} elseif (hasRequest('filter_rst')) {
    DBStart();
    CProfile::delete('web.auditlogs.filter.alias');
    CProfile::delete('web.auditlogs.filter.action');
    CProfile::delete('web.auditlogs.filter.resourcetype');
    DBend();
}
/*
 * Display
 */
$effectivePeriod = navigation_bar_calc('web.auditlogs.timeline', 0, true);
$data = ['stime' => getRequest('stime'), 'actions' => [], 'action' => CProfile::get('web.auditlogs.filter.action', -1), 'resourcetype' => CProfile::get('web.auditlogs.filter.resourcetype', -1), 'alias' => CProfile::get('web.auditlogs.filter.alias', '')];
$from = zbxDateToTime($data['stime']);
$till = $from + $effectivePeriod;
// get audit
$config = select_config();
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:auditlogs.php

示例4: show_messages

    show_messages($result, $messageSuccess, $messageFailed);
} elseif (hasRequest('action') && getRequest('action') == 'itemprototype.massdelete' && hasRequest('group_itemid')) {
    DBstart();
    $result = API::Itemprototype()->delete(getRequest('group_itemid'));
    $result = DBend($result);
    if ($result) {
        uncheckTableRows(getRequest('parent_discoveryid'));
    }
    show_messages($result, _('Item prototypes deleted'), _('Cannot delete item prototypes'));
}
/*
 * Display
 */
if (isset($_REQUEST['form'])) {
    $itemPrototype = [];
    if (hasRequest('itemid')) {
        $itemPrototype = API::ItemPrototype()->get(['itemids' => getRequest('itemid'), 'output' => ['itemid', 'type', 'snmp_community', 'snmp_oid', 'hostid', 'name', 'key_', 'delay', 'history', 'trends', 'status', 'value_type', 'trapper_hosts', 'units', 'multiplier', 'delta', 'snmpv3_securityname', 'snmpv3_securitylevel', 'snmpv3_authpassphrase', 'snmpv3_privpassphrase', 'formula', 'logtimefmt', 'templateid', 'valuemapid', 'delay_flex', 'params', 'ipmi_sensor', 'data_type', 'authtype', 'username', 'password', 'publickey', 'privatekey', 'interfaceid', 'port', 'description', 'snmpv3_authprotocol', 'snmpv3_privprotocol', 'snmpv3_contextname']]);
        $itemPrototype = reset($itemPrototype);
    }
    $data = getItemFormData($itemPrototype);
    $data['config'] = select_config();
    // render view
    $itemView = new CView('configuration.item.prototype.edit', $data);
    $itemView->render();
    $itemView->show();
} else {
    $sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'name'));
    $sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
    CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
    CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
    $config = select_config();
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:disc_prototypes.php

示例5: dirname

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Configuration of trigger displaying options');
$page['file'] = 'adm.triggerdisplayoptions.php';
require_once dirname(__FILE__) . '/include/page_header.php';
$fields = ['problem_unack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Unacknowledged PROBLEM events')], 'problem_ack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Acknowledged PROBLEM events')], 'ok_unack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Unacknowledged OK events')], 'ok_ack_color' => [T_ZBX_CLR, O_OPT, null, null, 'isset({update})', _('Acknowledged OK events')], 'problem_unack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'problem_ack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_unack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_ack_style' => [T_ZBX_INT, O_OPT, null, IN('1'), null, _('Blinking')], 'ok_period' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 999999), 'isset({update})', _('Display OK triggers for')], 'blink_period' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 999999), 'isset({update})', _('On status change triggers blink for')], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null]];
check_fields($fields);
/*
 * Actions
 */
if (hasRequest('update')) {
    DBstart();
    $result = update_config(['problem_unack_color' => getRequest('problem_unack_color'), 'problem_ack_color' => getRequest('problem_ack_color'), 'ok_unack_color' => getRequest('ok_unack_color'), 'ok_ack_color' => getRequest('ok_ack_color'), 'problem_unack_style' => getRequest('problem_unack_style', 0), 'problem_ack_style' => getRequest('problem_ack_style', 0), 'ok_unack_style' => getRequest('ok_unack_style', 0), 'ok_ack_style' => getRequest('ok_ack_style', 0), 'ok_period' => getRequest('ok_period'), 'blink_period' => getRequest('blink_period')]);
    $result = DBend($result);
    show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
}
/*
 * Display
 */
$config = select_config();
// form has been submitted
if (hasRequest('form_refresh')) {
    $data = ['problem_unack_color' => getRequest('problem_unack_color', $config['problem_unack_color']), 'problem_ack_color' => getRequest('problem_ack_color', $config['problem_ack_color']), 'ok_unack_color' => getRequest('ok_unack_color', $config['ok_unack_color']), 'ok_ack_color' => getRequest('ok_ack_color', $config['ok_ack_color']), 'problem_unack_style' => getRequest('problem_unack_style', 0), 'problem_ack_style' => getRequest('problem_ack_style', 0), 'ok_unack_style' => getRequest('ok_unack_style', 0), 'ok_ack_style' => getRequest('ok_ack_style', 0), 'ok_period' => getRequest('ok_period', $config['ok_period']), 'blink_period' => getRequest('blink_period', $config['blink_period'])];
} else {
    $data = ['problem_unack_color' => $config['problem_unack_color'], 'problem_ack_color' => $config['problem_ack_color'], 'ok_unack_color' => $config['ok_unack_color'], 'ok_ack_color' => $config['ok_ack_color'], 'problem_unack_style' => $config['problem_unack_style'], 'problem_ack_style' => $config['problem_ack_style'], 'ok_unack_style' => $config['ok_unack_style'], 'ok_ack_style' => $config['ok_ack_style'], 'ok_period' => $config['ok_period'], 'blink_period' => $config['blink_period']];
}
$view = new CView('administration.general.trigger.options.edit', $data);
$view->render();
$view->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:adm.triggerdisplayoptions.php

示例6: 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/triggers.inc.php';
$page['file'] = 'chart4.php';
$page['type'] = PAGE_TYPE_IMAGE;
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('triggerid' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null));
check_fields($fields);
/*
 * Permissions
 */
if (!hasRequest('triggerid')) {
    fatal_error(_('No triggers defined.'));
}
$dbTrigger = API::Trigger()->get(array('triggerids' => getRequest('triggerid'), 'output' => API_OUTPUT_EXTEND, 'expandDescription' => true));
if (!$dbTrigger) {
    access_deny();
} else {
    $dbTrigger = reset($dbTrigger);
}
/*
 * Display
 */
$startTime = microtime(true);
$sizeX = 900;
$sizeY = 300;
$shiftX = 12;
开发者ID:unix1986,项目名称:zabbix,代码行数:31,代码来源:chart4.php

示例7: getItemFormData

/**
 * Get data for item edit page.
 *
 * @param array	$item							item, item prototype or LLD rule to take the data from
 * @param bool $options['is_discovery_rule']
 *
 * @return array
 */
function getItemFormData(array $item = array(), array $options = array())
{
    $data = array('form' => getRequest('form'), 'form_refresh' => getRequest('form_refresh'), 'is_discovery_rule' => !empty($options['is_discovery_rule']), 'parent_discoveryid' => getRequest('parent_discoveryid', !empty($options['is_discovery_rule']) ? getRequest('itemid') : null), 'itemid' => getRequest('itemid'), 'limited' => false, 'interfaceid' => getRequest('interfaceid', 0), 'name' => getRequest('name', ''), 'description' => getRequest('description', ''), 'key' => getRequest('key', ''), 'hostname' => getRequest('hostname'), 'delay' => getRequest('delay', ZBX_ITEM_DELAY_DEFAULT), 'history' => getRequest('history', 90), 'status' => getRequest('status', isset($_REQUEST['form_refresh']) ? 1 : 0), 'type' => getRequest('type', 0), 'snmp_community' => getRequest('snmp_community', 'public'), 'snmp_oid' => getRequest('snmp_oid', 'interfaces.ifTable.ifEntry.ifInOctets.1'), 'port' => getRequest('port', ''), 'value_type' => getRequest('value_type', ITEM_VALUE_TYPE_UINT64), 'data_type' => getRequest('data_type', ITEM_DATA_TYPE_DECIMAL), 'trapper_hosts' => getRequest('trapper_hosts', ''), 'units' => getRequest('units', ''), 'valuemapid' => getRequest('valuemapid', 0), 'params' => getRequest('params', ''), 'multiplier' => getRequest('multiplier', 0), 'delta' => getRequest('delta', 0), 'trends' => getRequest('trends', DAY_IN_YEAR), 'new_application' => getRequest('new_application', ''), 'applications' => getRequest('applications', array()), 'delay_flex' => getRequest('delay_flex', array()), 'new_delay_flex' => getRequest('new_delay_flex', array('delay' => 50, 'period' => ZBX_DEFAULT_INTERVAL)), 'snmpv3_contextname' => getRequest('snmpv3_contextname', ''), 'snmpv3_securityname' => getRequest('snmpv3_securityname', ''), 'snmpv3_securitylevel' => getRequest('snmpv3_securitylevel', 0), 'snmpv3_authprotocol' => getRequest('snmpv3_authprotocol', ITEM_AUTHPROTOCOL_MD5), 'snmpv3_authpassphrase' => getRequest('snmpv3_authpassphrase', ''), 'snmpv3_privprotocol' => getRequest('snmpv3_privprotocol', ITEM_PRIVPROTOCOL_DES), 'snmpv3_privpassphrase' => getRequest('snmpv3_privpassphrase', ''), 'ipmi_sensor' => getRequest('ipmi_sensor', ''), 'authtype' => getRequest('authtype', 0), 'username' => getRequest('username', ''), 'password' => getRequest('password', ''), 'publickey' => getRequest('publickey', ''), 'privatekey' => getRequest('privatekey', ''), 'formula' => getRequest('formula', 1), 'logtimefmt' => getRequest('logtimefmt', ''), 'add_groupid' => getRequest('add_groupid', getRequest('groupid', 0)), 'valuemaps' => null, 'possibleHostInventories' => null, 'alreadyPopulated' => null, 'initial_item_type' => null, 'templates' => array());
    // hostid
    if (!empty($data['parent_discoveryid'])) {
        $discoveryRule = API::DiscoveryRule()->get(array('itemids' => $data['parent_discoveryid'], 'output' => API_OUTPUT_EXTEND, 'editable' => true));
        $discoveryRule = reset($discoveryRule);
        $data['hostid'] = $discoveryRule['hostid'];
    } else {
        $data['hostid'] = getRequest('hostid', 0);
    }
    // types, http items only for internal processes
    $data['types'] = item_type2str();
    unset($data['types'][ITEM_TYPE_HTTPTEST]);
    if (!empty($options['is_discovery_rule'])) {
        unset($data['types'][ITEM_TYPE_AGGREGATE], $data['types'][ITEM_TYPE_CALCULATED], $data['types'][ITEM_TYPE_SNMPTRAP]);
    }
    // item
    if ($item) {
        $data['item'] = $item;
        $data['hostid'] = !empty($data['hostid']) ? $data['hostid'] : $data['item']['hostid'];
        $data['limited'] = $data['item']['templateid'] != 0;
        // get templates
        $itemid = $item['itemid'];
        do {
            $params = array('itemids' => $itemid, 'output' => array('itemid', 'templateid'), 'selectHosts' => array('name'));
            if ($data['is_discovery_rule']) {
                $item = API::DiscoveryRule()->get($params);
            } else {
                $params['selectDiscoveryRule'] = array('itemid');
                $params['filter'] = array('flags' => null);
                $item = API::Item()->get($params);
            }
            $item = reset($item);
            if (!empty($item)) {
                $host = reset($item['hosts']);
                if (!empty($item['hosts'])) {
                    $host['name'] = CHtml::encode($host['name']);
                    if (bccomp($data['itemid'], $itemid) == 0) {
                    } elseif ($data['is_discovery_rule']) {
                        $data['templates'][] = new CLink($host['name'], 'host_discovery.php?form=update&itemid=' . $item['itemid'], 'highlight underline weight_normal');
                        $data['templates'][] = SPACE . '⇒' . SPACE;
                    } elseif ($item['discoveryRule']) {
                        $data['templates'][] = new CLink($host['name'], 'disc_prototypes.php?form=update&itemid=' . $item['itemid'] . '&parent_discoveryid=' . $item['discoveryRule']['itemid'], 'highlight underline weight_normal');
                        $data['templates'][] = SPACE . '⇒' . SPACE;
                    } else {
                        $data['templates'][] = new CLink($host['name'], 'items.php?form=update&itemid=' . $item['itemid'], 'highlight underline weight_normal');
                        $data['templates'][] = SPACE . '⇒' . SPACE;
                    }
                }
                $itemid = $item['templateid'];
            } else {
                break;
            }
        } while ($itemid != 0);
        $data['templates'] = array_reverse($data['templates']);
        array_shift($data['templates']);
    }
    // caption
    if (!empty($data['is_discovery_rule'])) {
        $data['caption'] = _('Discovery rule');
    } else {
        $data['caption'] = !empty($data['parent_discoveryid']) ? _('Item prototype') : _('Item');
    }
    // hostname
    if (empty($data['is_discovery_rule']) && empty($data['hostname'])) {
        if (!empty($data['hostid'])) {
            $hostInfo = API::Host()->get(array('hostids' => $data['hostid'], 'output' => array('name'), 'templated_hosts' => true));
            $hostInfo = reset($hostInfo);
            $data['hostname'] = $hostInfo['name'];
        } else {
            $data['hostname'] = _('not selected');
        }
    }
    // fill data from item
    if (!hasRequest('form_refresh') && ($item || $data['limited'])) {
        $data['name'] = $data['item']['name'];
        $data['description'] = $data['item']['description'];
        $data['key'] = $data['item']['key_'];
        $data['interfaceid'] = $data['item']['interfaceid'];
        $data['type'] = $data['item']['type'];
        $data['snmp_community'] = $data['item']['snmp_community'];
        $data['snmp_oid'] = $data['item']['snmp_oid'];
        $data['port'] = $data['item']['port'];
        $data['value_type'] = $data['item']['value_type'];
        $data['data_type'] = $data['item']['data_type'];
        $data['trapper_hosts'] = $data['item']['trapper_hosts'];
        $data['units'] = $data['item']['units'];
        $data['valuemapid'] = $data['item']['valuemapid'];
        $data['multiplier'] = $data['item']['multiplier'];
        $data['hostid'] = $data['item']['hostid'];
        $data['params'] = $data['item']['params'];
//.........这里部分代码省略.........
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:101,代码来源:forms.inc.php

示例8: count

    }
    $updated = count($update);
    $messageSuccess = $enable ? _n('Trigger prototype enabled', 'Trigger prototypes enabled', $updated) : _n('Trigger prototype disabled', 'Trigger prototypes disabled', $updated);
    $messageFailed = $enable ? _n('Cannot enable trigger prototype', 'Cannot enable trigger prototypes', $updated) : _n('Cannot disable trigger prototype', 'Cannot disable trigger prototypes', $updated);
    show_messages($result, $messageSuccess, $messageFailed);
} elseif (hasRequest('action') && getRequest('action') == 'triggerprototype.massdelete' && hasRequest('g_triggerid')) {
    $result = API::TriggerPrototype()->delete(getRequest('g_triggerid'));
    if ($result) {
        uncheckTableRows(getRequest('parent_discoveryid'));
    }
    show_messages($result, _('Trigger prototypes deleted'), _('Cannot delete trigger prototypes'));
}
/*
 * Display
 */
if (hasRequest('action') && getRequest('action') == 'triggerprototype.massupdateform' && hasRequest('g_triggerid')) {
    $data = getTriggerMassupdateFormData();
    $data['action'] = 'triggerprototype.massupdate';
    $triggersView = new CView('configuration.triggers.massupdate', $data);
    $triggersView->render();
    $triggersView->show();
} elseif (isset($_REQUEST['form'])) {
    $triggersView = new CView('configuration.triggers.edit', getTriggerFormData($exprAction));
    $triggersView->render();
    $triggersView->show();
} else {
    $sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'description'));
    $sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
    CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
    CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
    $data = array('parent_discoveryid' => getRequest('parent_discoveryid'), 'showInfoColumn' => false, 'discovery_rule' => $discovery_rule, 'hostid' => getRequest('hostid'), 'showdisabled' => getRequest('showdisabled', 1), 'triggers' => array(), 'sort' => $sortField, 'sortorder' => $sortOrder);
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:trigger_prototypes.php

示例9: update_config

    $result = update_config($configs);
    show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
    if ($result) {
        $audit = array(_s('Refresh unsupported items (in sec) "%1$s".', get_request('refresh_unsupported')));
        if (hasRequest('discovery_groupid')) {
            $hostGroup = API::HostGroup()->get(array('groupids' => get_request('discovery_groupid'), 'editable' => true, 'output' => array('groupid', 'name')));
            if ($hostGroup) {
                $hostGroup = reset($hostGroup);
                $audit[] = _s('Group for discovered hosts "%1$s".', $hostGroup['name']);
                if (bccomp($hostGroup['groupid'], $orig_config['discovery_groupid']) != 0) {
                    setHostGroupInternal($orig_config['discovery_groupid'], ZBX_NOT_INTERNAL_GROUP);
                    setHostGroupInternal($hostGroup['groupid'], ZBX_INTERNAL_GROUP);
                }
            }
        }
        if (hasRequest('alert_usrgrpid')) {
            $userGroupId = get_request('alert_usrgrpid');
            if ($userGroupId) {
                $userGroupName = DBfetch(DBselect('SELECT u.name FROM usrgrp u WHERE u.usrgrpid=' . zbx_dbstr($userGroupId)));
                $userGroupName = reset($userGroupName);
            } else {
                $userGroupName = _('None');
            }
            $audit[] = _s('User group for database down message "%1$s".', $userGroupName);
        }
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ZABBIX_CONFIG, implode('; ', $audit));
    }
    DBend($result);
}
/*
 * Display
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:adm.other.php

示例10: DBstart

if (isset($_REQUEST['delete']) && isset($_REQUEST['serviceid'])) {
    DBstart();
    $result = API::Service()->delete(array($service['serviceid']));
    if ($result) {
        add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_IT_SERVICE, 'Name [' . $service['name'] . '] id [' . $service['serviceid'] . ']');
        unset($_REQUEST['form']);
    }
    unset($service);
    $result = DBend($result);
    show_messages($result, _('Service deleted'), _('Cannot delete service'));
}
if (isset($_REQUEST['form'])) {
    $_REQUEST['showsla'] = getRequest('showsla', 0);
    $result = false;
    // save
    if (hasRequest('add') || hasRequest('update')) {
        DBstart();
        $children = getRequest('children', array());
        $dependencies = array();
        foreach ($children as $child) {
            $dependencies[] = array('dependsOnServiceid' => $child['serviceid'], 'soft' => isset($child['soft']) ? $child['soft'] : 0);
        }
        $serviceRequest = array('name' => getRequest('name'), 'triggerid' => getRequest('triggerid'), 'algorithm' => getRequest('algorithm'), 'showsla' => getRequest('showsla', 0), 'goodsla' => getRequest('goodsla'), 'sortorder' => getRequest('sortorder'), 'times' => getRequest('times', array()), 'parentid' => getRequest('parentid'), 'dependencies' => $dependencies);
        if (isset($service['serviceid'])) {
            $serviceRequest['serviceid'] = $service['serviceid'];
            $result = API::Service()->update($serviceRequest);
            $messageSuccess = _('Service updated');
            $messageFailed = _('Cannot update service');
            $auditAction = AUDIT_ACTION_UPDATE;
        } else {
            $result = API::Service()->create($serviceRequest);
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:services.php

示例11: get_request

$newgroup = get_request('newgroup', '');
$templateIds = get_request('templates', array());
$clear_templates = get_request('clear_templates', array());
$macros = get_request('macros', array());
$frm_title = _('Template');
if ($templateid > 0) {
    $frm_title .= SPACE . ' [' . $this->data['dbTemplate']['name'] . ']';
}
$frmHost = new CForm();
$frmHost->setName('tpl_for');
$frmHost->addVar('form', get_request('form', 1));
$frmHost->addVar('groupid', $_REQUEST['groupid']);
if ($templateid) {
    $frmHost->addVar('templateid', $templateid);
}
if ($templateid > 0 && !hasRequest('form_refresh')) {
    $host = $this->data['dbTemplate']['host'];
    $visiblename = $this->data['dbTemplate']['name'];
    // display empty visible name if equal to host name
    if ($visiblename === $host) {
        $visiblename = '';
    }
    // get template groups from db
    $groups = $this->data['dbTemplate']['groups'];
    $groups = zbx_objectValues($groups, 'groupid');
    $macros = order_macros($this->data['dbTemplate']['macros'], 'macro');
    // get template hosts from db
    $hosts_linked_to = API::Host()->get(array('output' => array('hostid'), 'templateids' => $templateid, 'templated_hosts' => true));
    $hosts_linked_to = zbx_objectValues($hosts_linked_to, 'hostid');
    $hosts_linked_to = zbx_toHash($hosts_linked_to, 'hostid');
    $templateIds = $this->data['original_templates'];
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.template.edit.php

示例12: getRequest

    $groupUserId = getRequest('group_userid');
    DBstart();
    $result = unblock_user_login($groupUserId);
    if ($result) {
        $users = API::User()->get(array('userids' => $groupUserId, 'output' => API_OUTPUT_EXTEND));
        foreach ($users as $user) {
            info('User ' . $user['alias'] . ' unblocked');
            add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_USER, 'Unblocked user alias [' . $user['alias'] . '] name [' . $user['name'] . '] surname [' . $user['surname'] . ']');
        }
    }
    $result = DBend($result);
    if ($result) {
        uncheckTableRows();
    }
    show_messages($result, _('Users unblocked'), _('Cannot unblock users'));
} elseif (hasRequest('action') && getRequest('action') == 'user.massdelete' && hasRequest('group_userid')) {
    $result = false;
    $groupUserId = getRequest('group_userid');
    $dbUsers = API::User()->get(array('userids' => $groupUserId, 'output' => API_OUTPUT_EXTEND));
    $dbUsers = zbx_toHash($dbUsers, 'userid');
    DBstart();
    foreach ($groupUserId as $userId) {
        if (!isset($dbUsers[$userId])) {
            continue;
        }
        $result |= (bool) API::User()->delete(array($userId));
        if ($result) {
            $userData = $dbUsers[$userId];
            add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_USER, 'User alias [' . $userData['alias'] . '] name [' . $userData['name'] . '] surname [' . $userData['surname'] . ']');
        }
    }
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:users.php

示例13: array

        $templateWidget->addItem(get_header_host_table('', $templateId));
    }
    $data = array();
    if ($templateId) {
        $dbTemplates = API::Template()->get(array('templateids' => $templateId, 'selectGroups' => API_OUTPUT_EXTEND, 'selectParentTemplates' => array('templateid', 'name'), 'selectMacros' => API_OUTPUT_EXTEND, 'output' => API_OUTPUT_EXTEND));
        $data['dbTemplate'] = reset($dbTemplates);
        $data['original_templates'] = array();
        foreach ($data['dbTemplate']['parentTemplates'] as $parentTemplate) {
            $data['original_templates'][$parentTemplate['templateid']] = $parentTemplate['templateid'];
        }
    } else {
        $data['original_templates'] = array();
    }
    // description
    $data['description'] = $templateId && !hasRequest('form_refresh') ? $data['dbTemplate']['description'] : getRequest('description');
    $templateIds = getRequest('templates', hasRequest('form_refresh') ? array() : $data['original_templates']);
    // linked templates
    $data['linkedTemplates'] = API::Template()->get(array('templateids' => $templateIds, 'output' => array('templateid', 'name')));
    CArrayHelper::sort($data['linkedTemplates'], array('name'));
    $templateForm = new CView('configuration.template.edit', $data);
    $templateWidget->addItem($templateForm->render());
} else {
    $sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'name'));
    $sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
    CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
    CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
    $frmForm = new CForm();
    $frmForm->cleanItems();
    $frmForm->addItem(new CDiv(array(new CSubmit('form', _('Create template')), new CButton('form', _('Import'), 'redirect("conf.import.php?rules_preset=template")'))));
    $frmForm->addItem(new CVar('groupid', $_REQUEST['groupid'], 'filter_groupid_id'));
    $templateWidget->addPageHeader(_('CONFIGURATION OF TEMPLATES'), $frmForm);
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:templates.php

示例14: getRequest

    $mediaTypeIds = getRequest('mediatypeids');
    $enable = getRequest('action') == 'mediatype.massenable';
    $status = $enable ? MEDIA_TYPE_STATUS_ACTIVE : MEDIA_TYPE_STATUS_DISABLED;
    $update = array();
    foreach ($mediaTypeIds as $mediaTypeId) {
        $update[] = array('mediatypeid' => $mediaTypeId, 'status' => $status);
    }
    $result = API::Mediatype()->update($update);
    if ($result) {
        uncheckTableRows();
    }
    $updated = count($update);
    $messageSuccess = $enable ? _n('Media type enabled', 'Media types enabled', $updated) : _n('Media type disabled', 'Media types disabled', $updated);
    $messageFailed = $enable ? _n('Cannot enable media type', 'Cannot enable media types', $updated) : _n('Cannot disable media type', 'Cannot disable media types', $updated);
    show_messages($result, $messageSuccess, $messageFailed);
} elseif (hasRequest('action') && getRequest('action') == 'mediatype.massdelete' && hasRequest('mediatypeids')) {
    $result = API::Mediatype()->delete(getRequest('mediatypeids'));
    if ($result) {
        uncheckTableRows();
    }
    show_messages($result, _('Media type deleted'), _('Cannot delete media type'));
}
/*
 * Display
 */
if (!empty($_REQUEST['form'])) {
    $data = array('form' => getRequest('form'), 'form_refresh' => getRequest('form_refresh', 0), 'mediatypeid' => $mediaTypeId);
    if (isset($data['mediatypeid']) && empty($_REQUEST['form_refresh'])) {
        $mediaType = reset($mediaTypes);
        $data['type'] = $mediaType['type'];
        $data['description'] = $mediaType['description'];
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:media_types.php

示例15: getRequest

/**
 * Check request, if exist request - return request value, else return default value.
 *
 * @param string	$name
 * @param mixed		$def
 *
 * @return mixed
 */
function getRequest($name, $def = null)
{
    return hasRequest($name) ? $_REQUEST[$name] : $def;
}
开发者ID:itnihao,项目名称:Zabbix_,代码行数:12,代码来源:func.inc.php


注:本文中的hasRequest函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。