當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BETWEEN函數代碼示例

本文整理匯總了PHP中BETWEEN函數的典型用法代碼示例。如果您正苦於以下問題:PHP BETWEEN函數的具體用法?PHP BETWEEN怎麽用?PHP BETWEEN使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BETWEEN函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dirname

** 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/graphs.inc.php';
require_once dirname(__FILE__) . '/include/screens.inc.php';
require_once dirname(__FILE__) . '/include/blocks.inc.php';
$page['title'] = _('Custom slides');
$page['file'] = 'slides.php';
$page['scripts'] = ['class.pmaster.js', 'class.calendar.js', 'gtlc.js', 'flickerfreescreen.js'];
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
define('ZBX_PAGE_DO_JS_REFRESH', 1);
ob_start();
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = ['groupid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null], 'hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null], 'elementid' => [T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null], 'step' => [T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null], 'period' => [T_ZBX_INT, O_OPT, P_SYS, null, null], 'stime' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'reset' => [T_ZBX_STR, O_OPT, P_SYS, IN('"reset"'), null], 'fullscreen' => [T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null], 'widgetRefresh' => [T_ZBX_STR, O_OPT, null, null, null], 'widgetRefreshRate' => [T_ZBX_STR, O_OPT, P_ACT, null, null], 'favobj' => [T_ZBX_STR, O_OPT, P_ACT, null, null], 'favid' => [T_ZBX_INT, O_OPT, P_ACT, null, null], 'upd_counter' => [T_ZBX_INT, O_OPT, P_ACT, null, null]];
check_fields($fields);
/*
 * Permissions
 */
$data = [];
if (getRequest('groupid') && !API::HostGroup()->isReadable([getRequest('groupid')]) || getRequest('hostid') && !API::Host()->isReadable([getRequest('hostid')])) {
    access_deny();
}
if (hasRequest('elementid')) {
    $data['screen'] = get_slideshow_by_slideshowid(getRequest('elementid'), PERM_READ);
    if (!$data['screen']) {
        access_deny();
    }
} else {
    $data['screen'] = [];
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:slides.php

示例2: dirname

** 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/config.inc.php';
require_once dirname(__FILE__) . '/include/maps.inc.php';
$page['title'] = _('Logo');
$page['file'] = 'zbxe-customer-logo.php';
$page['type'] = detect_page_type(PAGE_TYPE_IMAGE);
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION		EXCEPTION
$fields = array('sysmapid' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 'selements' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, null), 'links' => array(T_ZBX_STR, O_OPT, P_SYS, DB_ID, null), 'noselements' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'nolinks' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'nocalculations' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'expand_macros' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'show_triggers' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1,2,3'), null), 'severity_min' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2,3,4,5'), null), 'grid' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 500), null), 'base64image' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null));
check_fields($fields);
$maps = API::Map()->get(array('sysmapids' => $_REQUEST['sysmapid'], 'selectSelements' => API_OUTPUT_EXTEND, 'selectLinks' => API_OUTPUT_EXTEND, 'output' => API_OUTPUT_EXTEND, 'preservekeys' => true));
$map = reset($maps);
if (empty($map)) {
    access_deny();
}
$mapPainter = new CMapPainter($map, array('map' => array('drawAreas' => !isset($_REQUEST['selements']) && !isset($_REQUEST['noselements'])), 'grid' => array('size' => get_request('grid', 0))));
$im = $mapPainter->paint();
$colors['Red'] = imagecolorallocate($im, 255, 0, 0);
$colors['Dark Red'] = imagecolorallocate($im, 150, 0, 0);
$colors['Green'] = imagecolorallocate($im, 0, 255, 0);
$colors['Dark Green'] = imagecolorallocate($im, 0, 150, 0);
$colors['Blue'] = imagecolorallocate($im, 0, 0, 255);
$colors['Dark Blue'] = imagecolorallocate($im, 0, 0, 150);
$colors['Yellow'] = imagecolorallocate($im, 255, 255, 0);
開發者ID:zubayr,項目名稱:zabbix-extras,代碼行數:31,代碼來源:zbxe-customer-logo.php

示例3: dirname

** 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/config.inc.php';
require_once dirname(__FILE__) . '/include/graphs.inc.php';
$page['file'] = 'chart3.php';
$page['type'] = PAGE_TYPE_IMAGE;
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'stime' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'httptestid' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'http_item_type' => array(T_ZBX_INT, O_OPT, null, null, null), 'name' => array(T_ZBX_STR, O_OPT, null, null, null), 'width' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null), 'height' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null), 'ymin_type' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), null), 'ymax_type' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), null), 'ymin_itemid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'ymax_itemid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'legend' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'showworkperiod' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'showtriggers' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'graphtype' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'yaxismin' => array(T_ZBX_DBL, O_OPT, null, null, null), 'yaxismax' => array(T_ZBX_DBL, O_OPT, null, null, null), 'percent_left' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(0, 100), null), 'percent_right' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(0, 100), null), 'items' => array(T_ZBX_STR, O_OPT, null, null, null));
$isDataValid = check_fields($fields);
if ($httptestid = get_request('httptestid', false)) {
    $color = array('current' => 0, 0 => array('next' => '1'), 1 => array('color' => 'Red', 'next' => '2'), 2 => array('color' => 'Dark Green', 'next' => '3'), 3 => array('color' => 'Blue', 'next' => '4'), 4 => array('color' => 'Dark Yellow', 'next' => '5'), 5 => array('color' => 'Cyan', 'next' => '6'), 6 => array('color' => 'Gray', 'next' => '7'), 7 => array('color' => 'Dark Red', 'next' => '8'), 8 => array('color' => 'Green', 'next' => '9'), 9 => array('color' => 'Dark Blue', 'next' => '10'), 10 => array('color' => 'Yellow', 'next' => '11'), 11 => array('color' => 'Black', 'next' => '1'));
    $items = array();
    $dbItems = DBselect('SELECT i.itemid' . ' FROM httpstepitem hi,items i,httpstep hs' . ' WHERE i.itemid=hi.itemid' . ' AND hs.httptestid=' . $httptestid . ' AND hs.httpstepid=hi.httpstepid' . ' AND hi.type=' . get_request('http_item_type', HTTPSTEP_ITEM_TYPE_TIME) . ' ORDER BY hs.no DESC');
    while ($item = DBfetch($dbItems)) {
        $itemColor = $color[$color['current'] = $color[$color['current']]['next']]['color'];
        $items[] = array('itemid' => $item['itemid'], 'color' => $itemColor);
    }
    $httptest = get_httptest_by_httptestid($httptestid);
    $name = $httptest['name'];
} else {
    $items = get_request('items', array());
    asort_by_key($items, 'sortorder');
    $dbItems = API::Item()->get(array('webitems' => true, 'itemids' => zbx_objectValues($items, 'itemid'), 'nodeids' => get_current_nodeid(true), 'output' => API_OUTPUT_SHORTEN, 'preservekeys' => true, 'filter' => array('flags' => null)));
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:31,代碼來源:chart3.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/audit.inc.php';
require_once dirname(__FILE__) . '/include/actions.inc.php';
require_once dirname(__FILE__) . '/include/users.inc.php';
$page['title'] = _('Audit logs');
$page['file'] = 'auditlogs.php';
$page['hist_arg'] = array();
$page['scripts'] = array('class.calendar.js', 'gtlc.js');
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
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 | P_NZERO, DB_ID, null), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, 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, 31), null), 'filter_rst' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), 'filter_set' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'alias' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'period' => array(T_ZBX_INT, O_OPT, null, null, null), 'dec' => array(T_ZBX_INT, O_OPT, null, null, null), 'inc' => array(T_ZBX_INT, O_OPT, null, null, null), 'left' => array(T_ZBX_INT, O_OPT, null, null, null), 'right' => array(T_ZBX_INT, O_OPT, null, null, null), 'stime' => array(T_ZBX_STR, 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})&&("filter"=={favobj})'), 'favstate' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})&&("filter"=={favobj})'), 'favid' => array(T_ZBX_INT, O_OPT, P_ACT, null, null));
check_fields($fields);
/*
 * Ajax
 */
if (isset($_REQUEST['favobj'])) {
    if ($_REQUEST['favobj'] == 'filter') {
        CProfile::update('web.auditlogs.filter.state', $_REQUEST['favstate'], PROFILE_TYPE_INT);
    }
    // saving fixed/dynamic setting to profile
    if ($_REQUEST['favobj'] == 'timelinefixedperiod') {
        if (isset($_REQUEST['favid'])) {
            CProfile::update('web.auditlogs.timelinefixed', $_REQUEST['favid'], PROFILE_TYPE_INT);
        }
    }
}
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:31,代碼來源:auditlogs.php

示例5: array

** 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., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
require_once 'include/graphs.inc.php';
$page['file'] = 'chart7.php';
$page['title'] = "S_CHART";
$page['type'] = PAGE_TYPE_IMAGE;
include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'from' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'stime' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'border' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'name' => array(T_ZBX_STR, O_OPT, NULL, null, null), 'width' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'height' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'graphtype' => array(T_ZBX_INT, O_OPT, NULL, IN('2,3'), null), 'graph3d' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'legend' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'items' => array(T_ZBX_STR, O_OPT, NULL, null, null));
check_fields($fields);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true));
$items = get_request('items', array());
asort_by_key($items, 'sortorder');
foreach ($items as $gitem) {
    if (!($host = DBfetch(DBselect('SELECT h.* FROM hosts h,items i WHERE h.hostid=i.hostid AND i.itemid=' . $gitem['itemid'])))) {
        fatal_error(S_NO_ITEM_DEFINED);
    }
    if (!isset($available_hosts[$host['hostid']])) {
        access_deny();
    }
}
$effectiveperiod = navigation_bar_calc();
if (count($items) == 1) {
    $_REQUEST['period'] = get_request('period', get_profile('web.item.graph.period', ZBX_PERIOD_DEFAULT, null, $items['itemid']));
開發者ID:phedders,項目名稱:zabbix,代碼行數:31,代碼來源:chart7.php

示例6: dirname

** (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/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
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:adm.triggerdisplayoptions.php

示例7: dirname

**
** 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/config.inc.php';
$page['file'] = 'chart.php';
$page['type'] = PAGE_TYPE_IMAGE;
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('itemid' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 'screenid' => array(T_ZBX_STR, O_OPT, null, null, null), 'period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'profileIdx' => array(T_ZBX_STR, O_OPT, null, null, null), 'profileIdx2' => array(T_ZBX_STR, O_OPT, null, null, null), 'updateProfile' => array(T_ZBX_STR, O_OPT, null, null, null), 'from' => array(T_ZBX_INT, O_OPT, null, '{}>=0', null), 'width' => array(T_ZBX_INT, O_OPT, null, '{}>0', null), 'height' => array(T_ZBX_INT, O_OPT, null, '{}>0', null), 'border' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null));
check_fields($fields);
/*
 * Permissions
 */
if (!DBfetch(DBselect('SELECT i.itemid FROM items i WHERE i.itemid=' . $_REQUEST['itemid']))) {
    show_error_message(_('No items defined.'));
}
$dbItems = API::Item()->get(array('itemids' => $_REQUEST['itemid'], 'webitems' => true, 'nodeids' => get_current_nodeid(true), 'filter' => array('flags' => null)));
if (empty($dbItems)) {
    access_deny();
}
/*
 * Display
 */
$timeline = CScreenBase::calculateTime(array('profileIdx' => get_request('profileIdx', 'web.screens'), 'profileIdx2' => get_request('profileIdx2'), 'updateProfile' => get_request('updateProfile', true), 'period' => get_request('period'), 'stime' => get_request('stime')));
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:31,代碼來源:chart.php

示例8: array

require_once 'include/forms.inc.php';
$page['title'] = 'S_MAINTENANCE';
$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();
            }
開發者ID:phedders,項目名稱:zabbix,代碼行數:31,代碼來源:maintenance.php

示例9: get_request

**
** 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/triggers.inc.php';
require_once 'include/js.inc.php';
$dstfrm = get_request('dstfrm', 0);
// destination form
$page['title'] = "S_GRAPH_ITEM";
$page['file'] = 'popup_bitem.php';
define('ZBX_PAGE_NO_MENU', 1);
include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('dstfrm' => array(T_ZBX_STR, O_MAND, P_SYS, NOT_EMPTY, null), 'config' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1,2,3'), NULL), 'gid' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null), 'list_name' => array(T_ZBX_STR, O_OPT, P_SYS, NOT_EMPTY, 'isset({save})&&isset({gid})'), 'caption' => array(T_ZBX_STR, O_OPT, null, null, null), 'itemid' => array(T_ZBX_INT, O_OPT, null, DB_ID . '({}!=0)', 'isset({save})'), 'color' => array(T_ZBX_CLR, O_OPT, null, null, 'isset({save})'), 'calc_fnc' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2,4,7,9'), 'isset({save})'), 'axisside' => array(T_ZBX_INT, O_OPT, null, IN(GRAPH_YAXIS_SIDE_LEFT . ',' . GRAPH_YAXIS_SIDE_RIGHT), null), 'add' => 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), '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);
$_REQUEST['caption'] = get_request('caption', '');
$_REQUEST['axisside'] = get_request('axisside', GRAPH_YAXIS_SIDE_LEFT);
if (zbx_empty($_REQUEST['caption']) && isset($_REQUEST['itemid']) && $_REQUEST['itemid'] > 0) {
    $_REQUEST['caption'] = item_description(get_item_by_itemid($_REQUEST['itemid']));
}
insert_js_function('add_bitem');
insert_js_function('update_bitem');
if (isset($_REQUEST['save']) && !isset($_REQUEST['gid'])) {
    insert_js("add_bitem('" . $_REQUEST['dstfrm'] . "'," . zbx_jsvalue($_REQUEST['caption']) . ",'" . $_REQUEST['itemid'] . "','" . $_REQUEST['color'] . "'," . $_REQUEST['calc_fnc'] . "," . $_REQUEST['axisside'] . ");\n");
}
if (isset($_REQUEST['save']) && isset($_REQUEST['gid'])) {
    insert_js("update_bitem('" . $_REQUEST['dstfrm'] . "','" . $_REQUEST['list_name'] . "','" . $_REQUEST['gid'] . "'," . zbx_jsvalue($_REQUEST['caption']) . ",'" . $_REQUEST['itemid'] . "','" . $_REQUEST['color'] . "'," . $_REQUEST['calc_fnc'] . "," . $_REQUEST['axisside'] . ");\n");
} else {
    echo SBR;
開發者ID:rennhak,項目名稱:zabbix,代碼行數:31,代碼來源:popup_bitem.php

示例10: dirname

** 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/config.inc.php';
$page['title'] = _('Configuration of housekeeping');
$page['file'] = 'adm.housekeeper.php';
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('hk_events_mode' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'hk_events_trigger' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(1, 99999), null, _('Trigger event and alert data storage period')), 'hk_events_internal' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(1, 99999), null, _('Internal event and alert data storage period')), 'hk_events_discovery' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(1, 99999), null, _('Network discovery event and alert data storage period')), 'hk_events_autoreg' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(1, 99999), null, _('Auto-registration event and alert data storage period')), 'hk_services_mode' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'hk_services' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(1, 99999), null, _('IT service data storage period')), 'hk_audit_mode' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'hk_audit' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(1, 99999), null, _('Audit data storage period')), 'hk_sessions_mode' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'hk_sessions' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(1, 99999), null, _('User session data storage period')), 'hk_history_mode' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'hk_history_global' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'hk_history' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(0, 99999), null, _('History data storage period')), 'hk_trends_mode' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'hk_trends_global' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'hk_trends' => array(T_ZBX_DBL, O_OPT, null, BETWEEN(0, 99999), null, _('Trend data storage period')), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null));
check_fields($fields);
$data['config'] = select_config();
/*
 * Actions
 */
if (isset($_REQUEST['save'])) {
    DBstart();
    $configs = array('hk_events_mode' => getRequest('hk_events_mode', 0), 'hk_events_trigger' => getRequest('hk_events_trigger'), 'hk_events_internal' => getRequest('hk_events_internal'), 'hk_events_discovery' => getRequest('hk_events_discovery'), 'hk_events_autoreg' => getRequest('hk_events_autoreg'), 'hk_services_mode' => getRequest('hk_services_mode', 0), 'hk_services' => getRequest('hk_services'), 'hk_audit_mode' => getRequest('hk_audit_mode', 0), 'hk_audit' => getRequest('hk_audit'), 'hk_sessions_mode' => getRequest('hk_sessions_mode', 0), 'hk_sessions' => getRequest('hk_sessions'), 'hk_history_mode' => getRequest('hk_history_mode', 0), 'hk_history_global' => getRequest('hk_history_global', 0), 'hk_history' => getRequest('hk_history'), 'hk_trends_mode' => getRequest('hk_trends_mode', 0), 'hk_trends_global' => getRequest('hk_trends_global', 0), 'hk_trends' => getRequest('hk_trends'));
    $result = update_config($configs);
    show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
    if ($result) {
        $msg = array();
        $msg[] = _s('Trigger event and alert data storage period (in days) "%1$s".', getRequest('hk_events_trigger'));
        $msg[] = _s('Internal event and alert data storage period (in days) "%1$s".', getRequest('hk_events_internal'));
        $msg[] = _s('Network discovery event and alert data storage period (in days) "%1$s".', getRequest('hk_events_discovery'));
開發者ID:itnihao,項目名稱:Zabbix_,代碼行數:31,代碼來源:adm.housekeeper.php

示例11: define

** (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., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
define('ZBX_PAGE_NO_AUTHERIZATION', 1);
require_once "include/config.inc.php";
$page['file'] = 'vtext.php';
$page['type'] = PAGE_TYPE_IMAGE;
include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("text" => array(T_ZBX_STR, O_OPT, P_SYS, null, null), "font" => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, 5), null));
check_fields($fields);
$text = get_request("text", ' ');
$font = get_request("font", 3);
$width = ImageFontWidth($font) * strlen($text);
$height = ImageFontHeight($font);
$im = imagecreate($height, $width);
$backgroud_color = ImageColorAllocate($im, 255, 255, 255);
$text_color = ImageColorAllocate($im, 0, 0, 0);
ImageStringUp($im, $font, 0, $width - 1, $text, $text_color);
imagecolortransparent($im, $backgroud_color);
ImageOut($im);
ImageDestroy($im);
include_once "include/page_footer.php";
開發者ID:phedders,項目名稱:zabbix,代碼行數:31,代碼來源:vtext.php

示例12: dirname

** 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';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Configuration of discovery rules');
$page['file'] = 'host_discovery.php';
$page['scripts'] = ['class.cviewswitcher.js', 'items.js'];
require_once dirname(__FILE__) . '/include/page_header.php';
$paramsFieldName = getParamFieldNameByType(getRequest('type', 0));
// supported eval types
$evalTypes = [CONDITION_EVAL_TYPE_AND_OR, CONDITION_EVAL_TYPE_AND, CONDITION_EVAL_TYPE_OR, CONDITION_EVAL_TYPE_EXPRESSION];
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = ['hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, '!isset({form})'], 'itemid' => [T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({form}) && ({form} == "update"))'], 'interfaceid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null, _('Interface')], 'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')], 'description' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'], 'key' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Key')], 'delay' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, SEC_PER_DAY), '(isset({add}) || isset({update})) && isset({type}) && {type} != ' . ITEM_TYPE_TRAPPER . ' && {type} != ' . ITEM_TYPE_SNMPTRAP, _('Update interval (in sec)')], 'delay_flex' => [T_ZBX_STR, O_OPT, null, null, null], 'status' => [T_ZBX_INT, O_OPT, null, IN(ITEM_STATUS_ACTIVE), null], 'type' => [T_ZBX_INT, O_OPT, null, IN([-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({add}) || isset({update})'], 'authtype' => [T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHTYPE_PASSWORD . ',' . ITEM_AUTHTYPE_PUBLICKEY), '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SSH], 'username' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type'), _('User name')], 'password' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type')], 'publickey' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SSH . ' && {authtype} == ' . ITEM_AUTHTYPE_PUBLICKEY], 'privatekey' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SSH . ' && {authtype} == ' . ITEM_AUTHTYPE_PUBLICKEY], $paramsFieldName => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_DB_MONITOR . ',' . ITEM_TYPE_TELNET . ',' . ITEM_TYPE_CALCULATED, 'type'), getParamFieldLabelByType(getRequest('type', 0))], 'snmp_community' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C, 'type'), _('SNMP community')], 'snmp_oid' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('SNMP OID')], 'port' => [T_ZBX_STR, O_OPT, null, BETWEEN(0, 65535), '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('Port')], 'snmpv3_contextname' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SNMPV3], 'snmpv3_securitylevel' => [T_ZBX_INT, O_OPT, null, IN('0,1,2'), '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SNMPV3], 'snmpv3_securityname' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SNMPV3], 'snmpv3_authprotocol' => [T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHPROTOCOL_MD5 . ',' . ITEM_AUTHPROTOCOL_SHA), '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SNMPV3 . ' && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . ' || {snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . ')'], 'snmpv3_authpassphrase' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SNMPV3 . ' && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . ' || {snmpv3_securitylevel}==' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . ')'], 'snmpv3_privprotocol' => [T_ZBX_INT, O_OPT, null, IN(ITEM_PRIVPROTOCOL_DES . ',' . ITEM_PRIVPROTOCOL_AES), '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SNMPV3 . ' && {snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV], 'snmpv3_privpassphrase' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_SNMPV3 . ' && {snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV], 'ipmi_sensor' => [T_ZBX_STR, O_OPT, P_NO_TRIM, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && {type} == ' . ITEM_TYPE_IPMI, _('IPMI sensor')], 'trapper_hosts' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && {type} == 2'], 'lifetime' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'], 'evaltype' => [T_ZBX_INT, O_OPT, null, IN($evalTypes), 'isset({add}) || isset({update})'], 'formula' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'], 'conditions' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'action' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, IN('"discoveryrule.massdelete","discoveryrule.massdisable","discoveryrule.massenable"'), null], 'g_hostdruleid' => [T_ZBX_INT, O_OPT, null, DB_ID, null], 'add' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'clone' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'delete' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'cancel' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'form' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null], 'sort' => [T_ZBX_STR, O_OPT, P_SYS, IN('"delay","key_","name","status","type"'), null], 'sortorder' => [T_ZBX_STR, O_OPT, P_SYS, IN('"' . ZBX_SORT_DOWN . '","' . ZBX_SORT_UP . '"'), null]];
check_fields($fields);
$_REQUEST['params'] = getRequest($paramsFieldName, '');
unset($_REQUEST[$paramsFieldName]);
/*
 * Permissions
 */
if (getRequest('itemid', false)) {
    $item = API::DiscoveryRule()->get(['itemids' => $_REQUEST['itemid'], 'output' => API_OUTPUT_EXTEND, 'selectHosts' => ['status', 'flags'], 'selectFilter' => ['formula', 'evaltype', 'conditions'], 'editable' => true]);
    $item = reset($item);
    if (!$item) {
        access_deny();
    }
    $_REQUEST['hostid'] = $item['hostid'];
    $host = reset($item['hosts']);
} else {
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:host_discovery.php

示例13: 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/forms.inc.php';
require_once dirname(__FILE__) . '/include/actions.inc.php';
require_once dirname(__FILE__) . '/include/triggers.inc.php';
$page['title'] = _('Configuration of actions');
$page['file'] = 'actionconf.php';
$page['scripts'] = array('multiselect.js');
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('actionid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form})&&{form}=="update"'), 'name' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})', _('Name')), 'eventsource' => array(T_ZBX_INT, O_OPT, null, IN(array(EVENT_SOURCE_TRIGGERS, EVENT_SOURCE_DISCOVERY, EVENT_SOURCE_AUTO_REGISTRATION, EVENT_SOURCE_INTERNAL)), null), 'evaltype' => array(T_ZBX_INT, O_OPT, null, IN(array(ACTION_EVAL_TYPE_AND_OR, ACTION_EVAL_TYPE_AND, ACTION_EVAL_TYPE_OR)), 'isset({save})'), 'esc_period' => array(T_ZBX_INT, O_OPT, null, BETWEEN(60, 999999), null, _('Default operation step duration')), 'status' => array(T_ZBX_INT, O_OPT, null, IN(array(ACTION_STATUS_ENABLED, ACTION_STATUS_DISABLED)), null), 'def_shortdata' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'def_longdata' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'recovery_msg' => array(T_ZBX_INT, O_OPT, null, null, null), 'r_shortdata' => array(T_ZBX_STR, O_OPT, null, null, 'isset({recovery_msg})&&isset({save})', _('Recovery subject')), 'r_longdata' => array(T_ZBX_STR, O_OPT, null, null, 'isset({recovery_msg})&&isset({save})', _('Recovery message')), 'g_actionid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'conditions' => array(null, O_OPT, null, null, null), 'new_condition' => array(null, O_OPT, null, null, 'isset({add_condition})'), 'operations' => array(null, O_OPT, null, null, 'isset({save})'), 'edit_operationid' => array(T_ZBX_STR, O_OPT, P_ACT, null, null), 'new_operation' => array(null, O_OPT, null, null, 'isset({add_operation})'), 'opconditions' => array(null, O_OPT, null, null, null), 'new_opcondition' => array(null, O_OPT, null, null, 'isset({add_opcondition})'), 'go' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'add_condition' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel_new_condition' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'add_operation' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel_new_operation' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'add_opcondition' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel_new_opcondition' => 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_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}'));
$dataValid = check_fields($fields);
if ($dataValid && hasRequest('eventsource') && !hasRequest('form')) {
    CProfile::update('web.actionconf.eventsource', getRequest('eventsource'), PROFILE_TYPE_INT);
}
validate_sort_and_sortorder('name', ZBX_SORT_UP);
$_REQUEST['go'] = getRequest('go', 'none');
/*
 * Ajax
 */
if (isset($_REQUEST['favobj'])) {
    if ($_REQUEST['favobj'] == 'filter') {
        CProfile::update('web.audit.filter.state', $_REQUEST['favstate'], PROFILE_TYPE_INT);
    }
}
if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) {
開發者ID:hujingguang,項目名稱:work,代碼行數:31,代碼來源:actionconf.php

示例14: dirname

** 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/config.inc.php';
$page['title'] = _('Other configuration parameters');
$page['file'] = 'adm.other.php';
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('refresh_unsupported' => array(T_ZBX_INT, O_NO, null, BETWEEN(0, 65535), 'isset({update})', _('Refresh unsupported items (in sec)')), 'alert_usrgrpid' => array(T_ZBX_INT, O_NO, null, DB_ID, 'isset({update})'), 'discovery_groupid' => array(T_ZBX_INT, O_NO, null, DB_ID, 'isset({update})'), 'snmptrap_logging' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'update' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null));
check_fields($fields);
/*
 * Actions
 */
if (hasRequest('update')) {
    DBstart();
    $orig_config = select_config(false);
    $configs = array('refresh_unsupported' => getRequest('refresh_unsupported'), 'alert_usrgrpid' => getRequest('alert_usrgrpid'), 'discovery_groupid' => getRequest('discovery_groupid'), 'snmptrap_logging' => getRequest('snmptrap_logging') ? 1 : 0);
    $result = update_config($configs);
    if ($result) {
        $audit = array(_s('Refresh unsupported items (in sec) "%1$s".', getRequest('refresh_unsupported')));
        if (hasRequest('discovery_groupid')) {
            $hostGroup = API::HostGroup()->get(array('groupids' => getRequest('discovery_groupid'), 'editable' => true, 'output' => array('groupid', 'name')));
            if ($hostGroup) {
                $hostGroup = reset($hostGroup);
開發者ID:omidmt,項目名稱:zabbix-greenplum,代碼行數:31,代碼來源:adm.other.php

示例15: 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';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('Configuration of item prototypes');
$page['file'] = 'disc_prototypes.php';
$page['scripts'] = ['effects.js', 'class.cviewswitcher.js', 'items.js'];
require_once dirname(__FILE__) . '/include/page_header.php';
$paramsFieldName = getParamFieldNameByType(getRequest('type', 0));
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = ['parent_discoveryid' => [T_ZBX_INT, O_MAND, P_SYS, DB_ID, null], 'itemid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, '(isset({form}) && ({form} == "update"))'], 'interfaceid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null, _('Interface')], 'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')], 'description' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'], 'key' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Key')], 'delay' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, SEC_PER_DAY), '(isset({add}) || isset({update}))' . ' && (isset({type}) && ({type} != ' . ITEM_TYPE_TRAPPER . ' && {type} != ' . ITEM_TYPE_SNMPTRAP . '))', _('Update interval (in sec)')], 'delay_flex' => [T_ZBX_STR, O_OPT, null, null, null], 'status' => [T_ZBX_INT, O_OPT, null, IN(ITEM_STATUS_ACTIVE), null], 'type' => [T_ZBX_INT, O_OPT, null, IN([-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_AGGREGATE, ITEM_TYPE_EXTERNAL, ITEM_TYPE_DB_MONITOR, ITEM_TYPE_IPMI, ITEM_TYPE_SSH, ITEM_TYPE_TELNET, ITEM_TYPE_JMX, ITEM_TYPE_CALCULATED, ITEM_TYPE_SNMPTRAP]), 'isset({add}) || isset({update})'], 'value_type' => [T_ZBX_INT, O_OPT, null, IN('0,1,2,3,4'), 'isset({add}) || isset({update})'], 'data_type' => [T_ZBX_INT, O_OPT, null, IN(ITEM_DATA_TYPE_DECIMAL . ',' . ITEM_DATA_TYPE_OCTAL . ',' . ITEM_DATA_TYPE_HEXADECIMAL . ',' . ITEM_DATA_TYPE_BOOLEAN), '(isset({add}) || isset({update})) && (isset({value_type}) && ({value_type} == ' . ITEM_VALUE_TYPE_UINT64 . '))'], 'valuemapid' => [T_ZBX_INT, O_OPT, null, DB_ID, '(isset({add}) || isset({update})) && isset({value_type})' . ' && ' . IN(ITEM_VALUE_TYPE_FLOAT . ',' . ITEM_VALUE_TYPE_UINT64, 'value_type')], 'authtype' => [T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHTYPE_PASSWORD . ',' . ITEM_AUTHTYPE_PUBLICKEY), '(isset({add}) || isset({update})) && isset({type}) && ({type} == ' . ITEM_TYPE_SSH . ')'], 'username' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type'), _('User name')], 'password' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_TELNET, 'type')], 'publickey' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type})' . ' && ({type}) == ' . ITEM_TYPE_SSH . ' && ({authtype}) == ' . ITEM_AUTHTYPE_PUBLICKEY], 'privatekey' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type})' . ' && ({type}) == ' . ITEM_TYPE_SSH . ' && ({authtype}) == ' . ITEM_AUTHTYPE_PUBLICKEY], $paramsFieldName => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type})' . ' && ' . IN(ITEM_TYPE_SSH . ',' . ITEM_TYPE_DB_MONITOR . ',' . ITEM_TYPE_TELNET . ',' . ITEM_TYPE_CALCULATED, 'type'), getParamFieldLabelByType(getRequest('type', 0))], 'snmp_community' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type}) && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C, 'type'), _('SNMP community')], 'snmp_oid' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, '(isset({add}) || isset({update})) && isset({type})' . ' && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('SNMP OID')], 'port' => [T_ZBX_STR, O_OPT, null, BETWEEN(0, 65535), '(isset({add}) || isset({update})) && isset({type})' . ' && ' . IN(ITEM_TYPE_SNMPV1 . ',' . ITEM_TYPE_SNMPV2C . ',' . ITEM_TYPE_SNMPV3, 'type'), _('Port')], 'snmpv3_securitylevel' => [T_ZBX_INT, O_OPT, null, IN('0,1,2'), '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . '))'], 'snmpv3_contextname' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . '))'], 'snmpv3_securityname' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . '))'], 'snmpv3_authprotocol' => [T_ZBX_INT, O_OPT, null, IN(ITEM_AUTHPROTOCOL_MD5 . ',' . ITEM_AUTHPROTOCOL_SHA), '(isset({add}) || isset({update})) && (isset({type})' . ' && ({type} == ' . ITEM_TYPE_SNMPV3 . ') && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . ' || {snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . '))'], 'snmpv3_authpassphrase' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({type})' . ' && ({type} == ' . ITEM_TYPE_SNMPV3 . ') && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . ' || {snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV . '))'], 'snmpv3_privprotocol' => [T_ZBX_INT, O_OPT, null, IN(ITEM_PRIVPROTOCOL_DES . ',' . ITEM_PRIVPROTOCOL_AES), '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . ')' . ' && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '))'], 'snmpv3_privpassphrase' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_SNMPV3 . ')' . ' && ({snmpv3_securitylevel} == ' . ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV . '))'], 'ipmi_sensor' => [T_ZBX_STR, O_OPT, P_NO_TRIM, NOT_EMPTY, '(isset({add}) || isset({update})) && (isset({type}) && ({type} == ' . ITEM_TYPE_IPMI . '))', _('IPMI sensor')], 'trapper_hosts' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({type}) && ({type} == 2)'], 'units' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && isset({value_type})' . ' && ' . IN('0,3', 'value_type') . ' (isset({data_type}) && ({data_type} != ' . ITEM_DATA_TYPE_BOOLEAN . '))'], 'multiplier' => [T_ZBX_INT, O_OPT, null, null, null], 'delta' => [T_ZBX_INT, O_OPT, null, IN('0,1,2'), '(isset({add}) || isset({update})) && isset({value_type})' . ' && ' . IN('0,3', 'value_type') . ' (isset({data_type}) && ({data_type} != ' . ITEM_DATA_TYPE_BOOLEAN . '))'], 'formula' => [T_ZBX_DBL_STR, O_OPT, null, '({value_type} == 0 && {} != 0) || ({value_type} == 3 && {} > 0)', '(isset({add}) || isset({update})) && isset({multiplier}) && {multiplier} == 1', _('Custom multiplier')], 'logtimefmt' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update})) && (isset({value_type}) && ({value_type} == 2))'], 'group_itemid' => [T_ZBX_INT, O_OPT, null, DB_ID, null], 'new_application' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'], 'applications' => [T_ZBX_INT, O_OPT, null, DB_ID, null], 'new_application_prototype' => [T_ZBX_STR, O_OPT, null, null, 'isset({parent_discoveryid}) && (isset({add}) || isset({update}))'], 'application_prototypes' => [T_ZBX_STR, O_OPT, null, null, null], 'history' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({add}) || isset({update})', _('History storage period')], 'trends' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), '(isset({add}) || isset({update})) && isset({value_type})' . ' && ' . IN(ITEM_VALUE_TYPE_FLOAT . ',' . ITEM_VALUE_TYPE_UINT64, 'value_type'), _('Trend storage period')], 'action' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, IN('"itemprototype.massdelete","itemprototype.massdisable","itemprototype.massenable"'), null], 'add' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'update' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'clone' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'delete' => [T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null], 'cancel' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'form' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null], 'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'sort' => [T_ZBX_STR, O_OPT, P_SYS, IN('"delay","history","key_","name","status","trends","type"'), null], 'sortorder' => [T_ZBX_STR, O_OPT, P_SYS, IN('"' . ZBX_SORT_DOWN . '","' . ZBX_SORT_UP . '"'), null]];
check_fields($fields);
$_REQUEST['params'] = getRequest($paramsFieldName, '');
unset($_REQUEST[$paramsFieldName]);
// permissions
$discoveryRule = API::DiscoveryRule()->get(['output' => ['hostid'], 'itemids' => getRequest('parent_discoveryid'), 'editable' => true]);
$discoveryRule = reset($discoveryRule);
if (!$discoveryRule) {
    access_deny();
}
$itemPrototypeId = getRequest('itemid');
if ($itemPrototypeId && !API::ItemPrototype()->isWritable([$itemPrototypeId])) {
    access_deny();
}
/*
 * Actions
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:31,代碼來源:disc_prototypes.php


注:本文中的BETWEEN函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。