コード例 #1
0
ファイル: users.php プロジェクト: rennhak/zabbix
    while ($usrgrp = DBfetch($result)) {
        $cmbUGrp->AddItem($usrgrp['usrgrpid'], $usrgrp['name']);
    }
    $frmForm->AddItem(array(SPACE . SPACE, S_USER_GROUP, $cmbUGrp));
}
$frmForm->AddItem(SPACE . '|' . SPACE);
$frmForm->AddItem($btnNew = new CButton('form', $_REQUEST['config'] == 0 ? S_CREATE_USER : S_CREATE_GROUP));
show_table_header(S_CONFIGURATION_OF_USERS_AND_USER_GROUPS, $frmForm);
echo SBR;
$row_count = 0;
if ($_REQUEST['config'] == 0) {
    if (isset($_REQUEST['form'])) {
        insert_user_form(get_request('userid', null));
    } else {
        $form = new CForm(null, 'post');
        $form->SetName('users');
        $numrows = new CSpan(null, 'info');
        $numrows->addOption('name', 'numrows');
        $header = get_table_header(array(S_USERS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
        show_table_header($header);
        $table = new CTableInfo(S_NO_USERS_DEFINED);
        $table->setHeader(array(array(new CCheckBox('all_users', NULL, "CheckAll('" . $form->GetName() . "','all_users','group_userid');"), make_sorting_link(S_ALIAS, 'u.alias')), make_sorting_link(S_NAME, 'u.name'), make_sorting_link(S_SURNAME, 'u.surname'), make_sorting_link(S_USER_TYPE, 'u.type'), S_GROUPS, S_IS_ONLINE_Q, S_GUI_ACCESS, S_STATUS, S_ACTIONS));
        $cond_from = '';
        $cond_where = '';
        if ($_REQUEST['filter_usrgrpid'] > 0) {
            $cond_from = ', users_groups ug, usrgrp ugrp ';
            $cond_where = ' AND ug.userid = u.userid ' . ' AND ug.usrgrpid=' . $_REQUEST['filter_usrgrpid'];
        }
        $users = array();
        $userids = array();
        $db_users = DBselect('SELECT DISTINCT u.userid,u.alias,u.name,u.surname,u.type,u.autologout ' . ' FROM users u ' . $cond_from . ' WHERE ' . DBin_node('u.userid') . $cond_where . order_by('u.alias,u.name,u.surname,u.type', 'u.userid'));
コード例 #2
0
ファイル: actionconf.php プロジェクト: rennhak/zabbix
} else {
    $form = new CForm();
    $form->SetMethod('get');
    $cmbSource = new CComboBox('eventsource', $_REQUEST['eventsource'], 'submit()');
    $cmbSource->addItem(EVENT_SOURCE_TRIGGERS, S_TRIGGERS);
    $cmbSource->addItem(EVENT_SOURCE_DISCOVERY, S_DISCOVERY);
    $form->addItem(array(S_EVENT_SOURCE, SPACE, $cmbSource));
    $row_count = 0;
    $numrows = new CSpan(null, 'info');
    $numrows->addOption('name', 'numrows');
    $header = get_table_header(array(S_ACTIONS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
    show_table_header($header, $form);
    unset($form, $cmbSource);
    /* table */
    $form = new CForm();
    $form->SetName('actions');
    $tblActions = new CTableInfo(S_NO_ACTIONS_DEFINED);
    $tblActions->SetHeader(array(array(new CCheckBox('all_items', null, 'CheckAll("' . $form->GetName() . '","all_items");'), make_sorting_link(S_NAME, 'a.name')), S_CONDITIONS, S_OPERATIONS, make_sorting_link(S_STATUS, 'a.status')));
    $db_actions = DBselect('SELECT a.* ' . ' FROM actions a' . ' WHERE a.eventsource=' . $_REQUEST['eventsource'] . ' AND ' . DBin_node('actionid') . order_by('a.name,a.status', 'a.actionid'));
    while ($action_data = DBfetch($db_actions)) {
        if (!action_accessible($action_data['actionid'], PERM_READ_WRITE)) {
            continue;
        }
        $conditions = array();
        $db_conditions = DBselect('select * from conditions where actionid=' . $action_data['actionid'] . ' order by conditiontype,conditionid');
        while ($condition_data = DBfetch($db_conditions)) {
            array_push($conditions, array(get_condition_desc($condition_data['conditiontype'], $condition_data['operator'], $condition_data['value']), BR()));
        }
        unset($db_conditions, $condition_data);
        $operations = array();
        $db_operations = DBselect('select * from operations where actionid=' . $action_data['actionid'] . ' order by operationtype,operationid');
コード例 #3
0
ファイル: discoveryconf.php プロジェクト: rennhak/zabbix
/* header */
$form = new CForm();
$form->SetMethod('get');
if (!isset($_REQUEST["form"])) {
    $form->AddItem(new CButton('form', S_CREATE_RULE));
}
show_table_header(S_CONFIGURATION_OF_DISCOVERY_BIG, $form);
echo SBR;
if (isset($_REQUEST["form"])) {
    /* form */
    insert_drule_form();
} else {
    show_table_header(S_DISCOVERY_BIG);
    /* table */
    $form = new CForm();
    $form->SetName('frmdrules');
    $tblDiscovery = new CTableInfo(S_NO_DISCOVERY_RULES_DEFINED);
    $tblDiscovery->SetHeader(array(array(new CCheckBox('all_drules', null, "CheckAll('" . $form->GetName() . "','all_drules');"), make_sorting_link(S_NAME, 'd.name')), make_sorting_link(S_IP_RANGE, 'd.iprange'), make_sorting_link(S_DELAY, 'd.delay'), S_CHECKS, S_STATUS));
    $db_rules = DBselect('SELECT d.* ' . ' FROM drules d' . ' WHERE ' . DBin_node('druleid') . order_by('d.name,d.iprange,d.delay', 'd.druleid'));
    while ($rule_data = DBfetch($db_rules)) {
        $cheks = array();
        $db_checks = DBselect("select * from dchecks where druleid=" . $rule_data["druleid"] . " order by type,druleid");
        while ($check_data = DBfetch($db_checks)) {
            $cheks[] = discovery_check_type2str($check_data['type']);
        }
        $status = new CCol(new CLink(discovery_status2str($rule_data["status"]), '?g_druleid%5B%5D=' . $rule_data['druleid'] . ($rule_data["status"] == DRULE_STATUS_ACTIVE ? '&group_disable=1' : '&group_enable=1'), discovery_status2style($rule_data["status"])));
        $description = array();
        if ($rule_data["proxy_hostid"]) {
            $proxy = get_host_by_hostid($rule_data["proxy_hostid"]);
            array_push($description, $proxy["host"], ":");
        }
コード例 #4
0
ファイル: exp_imp.php プロジェクト: rennhak/zabbix
     $form = new CForm(null, 'post');
     $form->setName('hosts');
     $form->addVar("config", $config);
     $form->addVar('update', true);
     $form->addVar('hosts', $hosts);
     $form->addVar('templates', $templates);
     $form->addVar('items', $items);
     $form->addVar('graphs', $graphs);
     $form->addVar('triggers', $triggers);
     $form->addItem(array(new CButton('back', S_BACK), new CButton('preview', S_REFRESH), new CButton('export', S_EXPORT)));
     $table->setFooter(new CCol($form));
     $table->showEnd();
 } else {
     /* table HOSTS */
     $form = new CForm(null, 'post');
     $form->SetName('hosts');
     $form->AddVar('config', $config);
     $form->AddVar('update', true);
     $cmbGroups = new CComboBox('groupid', $PAGE_GROUPS['selected'], 'javascript: submit();');
     foreach ($PAGE_GROUPS['groups'] as $groupid => $name) {
         $cmbGroups->addItem($groupid, get_node_name_by_elid($groupid) . $name);
     }
     $header = get_table_header(S_HOSTS_BIG, array(S_GROUP . SPACE, $cmbGroups));
     $form->addItem($header);
     $table = new CTableInfo(S_NO_HOSTS_DEFINED);
     $table->setHeader(array(array(new CCheckBox("all_hosts", true, "CheckAll('" . $form->GetName() . "','all_hosts','hosts');"), make_sorting_link(S_NAME, 'h.host')), make_sorting_link(S_DNS, 'h.dns'), make_sorting_link(S_IP, 'h.ip'), make_sorting_link(S_PORT, 'h.port'), make_sorting_link(S_STATUS, 'h.status'), array(new CCheckBox("all_templates", true, "CheckAll('" . $form->GetName() . "','all_templates','templates');"), S_TEMPLATES), array(new CCheckBox("all_items", true, "CheckAll('" . $form->GetName() . "','all_items','items');"), S_ITEMS), array(new CCheckBox("all_triggers", true, "CheckAll('" . $form->GetName() . "','all_triggers','triggers');"), S_TRIGGERS), array(new CCheckBox("all_graphs", true, "CheckAll('" . $form->GetName() . "','all_graphs','graphs');"), S_GRAPHS)));
     $sql_from = '';
     $sql_where = '';
     if ($_REQUEST['groupid'] > 0) {
         $sql_from .= ' ,hosts_groups hg ';
         $sql_where .= ' AND hg.groupid=' . $_REQUEST['groupid'] . ' AND hg.hostid=h.hostid ';
コード例 #5
0
ファイル: popup_usrgrp.php プロジェクト: rennhak/zabbix
    echo $dstfrm;
    ?>
'];
<!--
<?php 
    foreach ($new_group as $id => $name) {
        echo 'add_var_to_opener_obj(form,"new_group[' . $id . ']","' . $name . '")' . "\r";
    }
    ?>
if(form)
{
	form.submit();
	close_window();
}
-->
</script>
<?php 
}
$form = new CForm();
$form->AddVar('dstfrm', $dstfrm);
$form->SetName('groups');
$table = new CTableInfo(S_NO_GROUPS_DEFINED);
$table->SetHeader(array(array(new CCheckBox("all_groups", NULL, "CheckAll('" . $form->GetName() . "','all_groups');"), S_NAME)));
$result = DBselect('select * from usrgrp where ' . DBin_node('usrgrpid') . ' order by name');
while ($row = DBfetch($result)) {
    $table->AddRow(array(array(new CCheckBox('new_group[' . $row['usrgrpid'] . ']', isset($new_group[$row['usrgrpid']]), NULL, $row['name']), $row['name'])));
}
$table->SetFooter(new CButton('select', S_SELECT));
$form->AddItem($table);
$form->Show();
include_once "include/page_footer.php";
コード例 #6
0
ファイル: services_form.php プロジェクト: phedders/zabbix
    $td = new CCol($cb);
    $td->setAttribute('style', 'text-align:right;');
    $table->SetFooter($td);
    $form->AddItem($table);
    $form->Show();
}
//--------------------------------------------	</PARENT SERVICES LIST>  --------------------------------------------
//---------------------------------------------- <CHILD SERVICES LIST> --------------------------------------------
if (isset($_REQUEST['cservices'])) {
    if (isset($service)) {
        $service = get_service_by_serviceid($service['serviceid']);
    }
    // update date after ACTIONS
    show_table_header(S_IT_SERVICES_BIG);
    $form = new CForm();
    $form->SetName("services");
    if (isset($service)) {
        $form->AddVar("serviceid", $service['serviceid']);
    }
    $table = new CTableInfo();
    $table->SetHeader(array(S_SERVICE, S_STATUS_CALCULATION, S_TRIGGER));
    if (isset($service)) {
        $childs = get_service_childs($service['serviceid'], 1);
        $childs_str = implode(',', $childs);
        !empty($childs_str) ? $childs_str .= ',' : '';
        $query = 'SELECT DISTINCT s.* ' . ' FROM services s ' . ' WHERE ' . DBin_node('s.serviceid') . ' AND (s.triggerid IS NULL OR ' . DBcondition('s.triggerid', $available_triggers) . ') ' . ' AND s.serviceid NOT IN (' . $childs_str . $service['serviceid'] . ') ' . ' ORDER BY s.sortorder,s.name';
    } else {
        $query = 'SELECT DISTINCT s.* ' . ' FROM services s ' . ' WHERE ' . DBin_node('s.serviceid') . ' AND (s.triggerid IS NULL OR ' . DBcondition('s.triggerid', $available_triggers) . ') ' . ' ORDER BY s.sortorder,s.name';
    }
    $db_services = DBselect($query);
    while ($db_service_data = DBfetch($db_services)) {
コード例 #7
0
ファイル: history.php プロジェクト: rennhak/zabbix
            $icon->AddOption('title', S_ADD_TO . ' ' . S_FAVORITES);
            $icon->AddAction('onclick', new CScript("javascript: add2favorites('itemid','" . $_REQUEST['itemid'] . "');"));
        }
        $icon->AddOption('id', 'addrm_fav');
        $icon_tab = new CTable();
        $icon_tab->AddRow(array($icon, SPACE, $l_header));
        $l_header = $icon_tab;
    }
}
$effectiveperiod = navigation_bar_calc();
unset($item_data);
$to_save_request = null;
if (!isset($_REQUEST['plaintext']) && $_REQUEST['fullscreen'] == 0) {
    if ($item_type == ITEM_VALUE_TYPE_LOG) {
        $l_header = new CForm();
        $l_header->SetName('loglist');
        $l_header->AddVar('action', $_REQUEST['action']);
        $l_header->AddVar('from', $_REQUEST['from']);
        $l_header->AddVar('period', $_REQUEST['period']);
        $l_header->AddVar('itemid', $_REQUEST['itemid']);
        if (isset($_REQUEST['filter_task'])) {
            $l_header->AddVar('filter_task', $_REQUEST['filter_task']);
        }
        if (isset($_REQUEST['filter'])) {
            $l_header->AddVar('filter', $_REQUEST['filter']);
        }
        if (isset($_REQUEST['mark_color'])) {
            $l_header->AddVar('mark_color', $_REQUEST['mark_color']);
        }
        $cmbLogList = new CComboBox('cmbloglist');
        if (is_array($_REQUEST['itemid'])) {
コード例 #8
0
ファイル: tr_status.php プロジェクト: rennhak/zabbix
$filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER));
$filterForm->addItemToBottomRow($reset);
$p_elements[] = create_filter(S_FILTER, array(), $filterForm, 'tr_filter', get_profile('web.tr_status.filter.state', 0));
/*************** FILTER END ******************/
if ($_REQUEST['fullscreen']) {
    $triggerInfo = new CTriggersInfo();
    $triggerInfo->HideHeader();
    $triggerInfo->Show();
}
if ($_REQUEST['fullscreen']) {
    $fullscreen = '&fullscreen=1';
} else {
    $fullscreen = '';
}
$m_form = new CForm('acknow.php');
$m_form->SetName('tr_status');
$admin_links = $USER_DETAILS['type'] == USER_TYPE_ZABBIX_ADMIN || $USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN;
$table = new CTableInfo();
$table->ShowStart();
$header = array();
$show_event_col = $config['event_ack_enable'] && $show_events != EVENTS_OPTION_NOEVENT;
$table->SetHeader(array($show_event_col ? new CCheckBox('all_events', false, "CheckAll('" . $m_form->GetName() . "','all_events','events');") : NULL, make_sorting_link(S_SEVERITY, 't.priority'), S_STATUS, make_sorting_link(S_LAST_CHANGE, 't.lastchange'), is_show_subnodes() ? make_sorting_link(S_NODE, 'h.hostid') : null, $_REQUEST['hostid'] > 0 ? null : make_sorting_link(S_HOST, 'h.host'), make_sorting_link(S_NAME, 't.description'), $_REQUEST['show_actions'] ? S_ACTIONS : NULL, $show_event_col ? S_ACKNOWLEDGED : NULL, S_COMMENTS));
$cond = $_REQUEST['hostid'] > 0 ? ' AND h.hostid=' . $_REQUEST['hostid'] . ' ' : '';
switch ($show_triggers) {
    case TRIGGERS_OPTION_ALL:
        $cond .= '';
        break;
    case TRIGGERS_OPTION_NOFALSEFORB:
        $cond .= '';
        break;
    case TRIGGERS_OPTION_ONLYTRUE: