Пример #1
0
function show_report2_header($config, &$PAGE_GROUPS, &$PAGE_HOSTS)
{
    global $USER_DETAILS;
    $available_groups = $PAGE_GROUPS['groupids'];
    $available_hosts = $PAGE_HOSTS['hostids'];
    //	$available_groups = $PAGE_GROUPS['groupids'];
    //	$available_hosts = $PAGE_HOSTS['hostids'];
    $r_form = new CForm();
    $r_form->setMethod('get');
    $cmbConf = new CComboBox('config', $config, 'submit()');
    $cmbConf->addItem(0, S_BY_HOST);
    $cmbConf->addItem(1, S_BY_TRIGGER_TEMPLATE);
    $r_form->addItem(array(S_MODE . SPACE, $cmbConf, SPACE));
    $cmbGroups = new CComboBox('groupid', $PAGE_GROUPS['selected'], 'javascript: submit();');
    $cmbHosts = new CComboBox('hostid', $PAGE_HOSTS['selected'], 'javascript: submit();');
    foreach ($PAGE_GROUPS['groups'] as $groupid => $name) {
        $cmbGroups->addItem($groupid, get_node_name_by_elid($groupid) . $name);
    }
    foreach ($PAGE_HOSTS['hosts'] as $hostid => $name) {
        $cmbHosts->addItem($hostid, get_node_name_by_elid($hostid) . $name);
    }
    $r_form->addItem(array(S_GROUP . SPACE, $cmbGroups));
    $r_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts));
    if (1 == $config) {
        $cmbTrigs = new CComboBox('tpl_triggerid', get_request('tpl_triggerid', 0), 'submit()');
        $cmbHGrps = new CComboBox('hostgroupid', get_request('hostgroupid', 0), 'submit()');
        $cmbTrigs->addItem(0, S_ALL_SMALL);
        $cmbHGrps->addItem(0, S_ALL_SMALL);
    }
    if (0 == $config) {
        show_table_header(S_AVAILABILITY_REPORT_BIG, $r_form);
    } else {
        $sql_cond = ' AND h.hostid=ht.hostid ';
        if ($_REQUEST['hostid'] > 0) {
            $sql_cond .= ' AND ht.templateid=' . $_REQUEST['hostid'];
        }
        if (isset($_REQUEST['tpl_triggerid']) && $_REQUEST['tpl_triggerid'] > 0) {
            $sql_cond .= ' AND t.templateid=' . $_REQUEST['tpl_triggerid'];
        }
        $result = DBselect('SELECT DISTINCT g.groupid,g.name ' . ' FROM triggers t,hosts h,items i,functions f, hosts_templates ht, groups g, hosts_groups hg ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND hg.hostid=h.hostid' . ' AND g.groupid=hg.groupid ' . ' AND ' . DBcondition('h.hostid', $available_hosts) . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND h.status=' . HOST_STATUS_MONITORED . $sql_cond . ' ORDER BY g.name');
        while ($row = DBfetch($result)) {
            $cmbHGrps->addItem($row['groupid'], get_node_name_by_elid($row['groupid']) . $row['name']);
        }
        $sql_cond = $_REQUEST['hostid'] > 0 ? ' AND h.hostid=' . $_REQUEST['hostid'] : ' AND ' . DBcondition('h.hostid', $available_hosts);
        $sql = 'SELECT DISTINCT t.triggerid,t.description ' . ' FROM triggers t,hosts h,items i,functions f ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND h.status=' . HOST_STATUS_TEMPLATE . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . $sql_cond . ' ORDER BY t.description';
        $result = DBselect($sql);
        while ($row = DBfetch($result)) {
            $cmbTrigs->addItem($row['triggerid'], get_node_name_by_elid($row['triggerid']) . expand_trigger_description($row['triggerid']));
        }
        $rr_form = new CForm();
        $rr_form->setMethod('get');
        $rr_form->addVar('config', $config);
        $rr_form->addVar('groupid', $_REQUEST['groupid']);
        $rr_form->addVar('hostid', $_REQUEST['hostid']);
        $rr_form->addItem(array(S_TRIGGER . SPACE, $cmbTrigs, BR(), S_FILTER, SPACE, S_HOST_GROUP . SPACE, $cmbHGrps));
        show_table_header(S_AVAILABILITY_REPORT_BIG, array($r_form, $rr_form));
    }
}
Пример #2
0
        $status['style'] = 'unknown';
    } else {
        if ($httptest_data['lastfailedstep'] > 0) {
            $status['msg'] = S_FAIL . ' - ' . S_ERROR . ': ' . $httptest_data['error'];
            $status['style'] = 'disabled';
        }
    }
}
$table->AddRow(array(new CCol(S_TOTAL_BIG, 'bold'), new CCol(SPACE, 'bold'), new CCol(format_lastvalue($total_data[HTTPSTEP_ITEM_TYPE_TIME]), 'bold'), new CCol(SPACE, 'bold'), new CCol(new CSpan($status['msg'], $status['style']), 'bold')));
$table->Show();
echo SBR;
if (isset($_REQUEST['period']) && $_REQUEST['period'] != ZBX_MIN_PERIOD) {
    update_profile('web.httptest.period', $_REQUEST['period'], PROFILE_TYPE_INT, $_REQUEST['httptestid']);
}
$_REQUEST['period'] = get_profile('web.httptest.period', ZBX_PERIOD_DEFAULT, PROFILE_TYPE_INT, $_REQUEST['httptestid']);
show_table_header(array(S_HISTORY . ' "', bold($httptest_data['name']), '"'));
$form = new CTableInfo();
$form->AddOption('id', 'graph');
$form->AddRow(array(bold(S_SPEED), new CCol(get_dynamic_chart('graph_1', 'chart3.php?' . url_param('period') . url_param('from') . url_param($httptest_data['name'], false, 'name') . url_param(150, false, 'height') . url_param(get_request('stime', 0), false, 'stime') . url_param($items[HTTPSTEP_ITEM_TYPE_IN], false, 'items') . url_param(GRAPH_TYPE_STACKED, false, 'graphtype'), '-128'), 'center')));
$form->AddRow(array(bold(S_RESPONSE_TIME), new CCol(get_dynamic_chart('graph_2', 'chart3.php?' . url_param('period') . url_param('from') . url_param($httptest_data['name'], false, 'name') . url_param(150, false, 'height') . url_param(get_request('stime', 0), false, 'stime') . url_param($items[HTTPSTEP_ITEM_TYPE_TIME], false, 'items') . url_param(GRAPH_TYPE_STACKED, false, 'graphtype'), '-128'), 'center')));
$form->Show();
$period = get_request('period', 3600);
//SDI(get_min_itemclock_by_itemid($items[HTTPSTEP_ITEM_TYPE_IN][0]['itemid']));
$mstime = min(get_min_itemclock_by_itemid($items[HTTPSTEP_ITEM_TYPE_IN][0]['itemid']), get_min_itemclock_by_itemid($items[HTTPSTEP_ITEM_TYPE_TIME][0]['itemid']));
$stime = $mstime ? $mstime : 0;
$bstime = time() - $period;
if (isset($_REQUEST['stime'])) {
    $bstime = $_REQUEST['stime'];
    $bstime = mktime(substr($bstime, 8, 2), substr($bstime, 10, 2), 0, substr($bstime, 4, 2), substr($bstime, 6, 2), substr($bstime, 0, 4));
}
$script = 'scrollinit(0,' . $period . ',' . $stime . ',0,' . $bstime . ');
Пример #3
0
}
if ($action == "modifytemplates") {
    if ($msg != "") {
        printf("<p><b>%s</b></p>\n", $msg);
    }
    show_table_header($lang['edit_templates'], 2);
    show_theme_select_row($lang['choose_theme']);
    if ($themes_found) {
        show_template_select_row($lang['choose_template'], $template_folder);
    }
    show_table_footer();
    if (!isset($content)) {
        $content = "";
    }
    show_form_header("templates.php", "savetemplate");
    show_table_header($lang['edit_template'] . ": " . $template_file_name, 1);
    echo "<tr class=\"tablerow\"><td>";
    ?>
  <style>
  .template_textarea {
    width: 100%;
  }
  </style>
  <?php 
    echo "<textarea name=\"content\" cols=\"60\" rows=\"30\" wrap=\"off\" class=\"template_textarea\">";
    echo htmlspecialchars($content);
    echo "</textarea>";
    show_hidden_input("template_file_name", $template_file_name);
    show_hidden_input("template_folder", $template_folder);
    show_form_footer($lang['save_changes'], "", 1);
}
Пример #4
0
                                $sec_600[$row['proxy_hostid']]++;
                            } else {
                                $sec_rest[$row['proxy_hostid']]++;
                            }
                        }
                    }
                }
            }
        }
        $table->setHeader(array(S_PROXY, S_5_SECONDS, S_10_SECONDS, S_30_SECONDS, S_1_MINUTE, S_5_MINUTES, S_MORE_THAN_10_MINUTES));
        $db_proxies = DBselect('select hostid,host from hosts where status=' . HOST_STATUS_PROXY . ' order by host');
        while (null != ($db_proxy = DBfetch($db_proxies))) {
            $elements = array($db_proxy['host'], new CCol($sec_10[$db_proxy['hostid']], $sec_10[$db_proxy['hostid']] ? "unknown_trigger" : "normal"), new CCol($sec_30[$db_proxy['hostid']], $sec_30[$db_proxy['hostid']] ? "information" : "normal"), new CCol($sec_60[$db_proxy['hostid']], $sec_60[$db_proxy['hostid']] ? "warning" : "normal"), new CCol($sec_300[$db_proxy['hostid']], $sec_300[$db_proxy['hostid']] ? "average" : "normal"), new CCol($sec_600[$db_proxy['hostid']], $sec_600[$db_proxy['hostid']] ? "high" : "normal"), new CCol($sec_rest[$db_proxy['hostid']], $sec_rest[$db_proxy['hostid']] ? "disaster" : "normal"));
            $table->addRow($elements);
        }
        $elements = array(new CCol(S_SERVER, 'bold'), new CCol($sec_10[0], $sec_10[0] ? 'unknown_trigger' : 'normal'), new CCol($sec_30[0], $sec_30[0] ? 'information' : 'normal'), new CCol($sec_60[0], $sec_60[0] ? 'warning' : 'normal'), new CCol($sec_300[0], $sec_300[0] ? 'average' : 'normal'), new CCol($sec_600[0], $sec_600[0] ? 'high' : 'normal'), new CCol($sec_rest[0], $sec_rest[0] ? 'disaster' : 'normal'));
        $table->addRow($elements);
    } else {
        if ($_REQUEST["show"] == 2) {
            $table->SetHeader(array(S_NEXT_CHECK, is_show_subnodes() ? S_NODE : null, S_HOST, S_DESCRIPTION));
            while ($row = DBfetch($result)) {
                $table->AddRow(array(date("m.d.Y H:i:s", $row["nextcheck"]), get_node_name_by_elid($row['hostid']), $row['host'], item_description($row)));
            }
        }
    }
}
$table->Show();
if ($_REQUEST["show"] != 0) {
    show_table_header(S_TOTAL . ": " . $table->GetNumRows());
}
include_once "include/page_footer.php";
Пример #5
0
    }
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(new CButton("form", S_CREATE_MAP));
show_table_header(S_CONFIGURATION_OF_NETWORK_MAPS, $form);
echo SBR;
if (isset($_REQUEST["form"])) {
    insert_map_form();
} else {
    $form = new CForm();
    $form->setName('frm_maps');
    $numrows = new CSpan(null, 'info');
    $numrows->setAttribute('name', 'numrows');
    $header = get_table_header(array(S_MAPS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
    show_table_header($header);
    $table = new CTableInfo(S_NO_MAPS_DEFINED);
    $table->SetHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_link(S_NAME, 'sm.name'), make_sorting_link(S_WIDTH, 'sm.width'), make_sorting_link(S_HEIGHT, 'sm.height'), S_MAP));
    $result = DBselect('SELECT sm.sysmapid,sm.name,sm.width,sm.height ' . ' FROM sysmaps sm' . ' WHERE ' . DBin_node('sm.sysmapid') . order_by('sm.name,sm.width,sm.height', 'sm.sysmapid'));
    while ($row = DBfetch($result)) {
        if (!sysmap_accessible($row["sysmapid"], PERM_READ_WRITE)) {
            continue;
        }
        $table->AddRow(array(new CCheckBox('maps[' . $row['sysmapid'] . ']', NULL, NULL, $row['sysmapid']), new CLink($row["name"], "sysmaps.php?form=update" . "&sysmapid=" . $row["sysmapid"] . "#form", 'action'), $row["width"], $row["height"], new CLink(S_EDIT, "sysmap.php?sysmapid=" . $row["sysmapid"])));
    }
    //----- GO ------
    $goBox = new CComboBox('go');
    $goBox->addItem('delete', S_DELETE_SELECTED);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
Пример #6
0
$page["title"] = "S_TRIGGER_COMMENTS";
$page["file"] = "tr_comments.php";
include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("triggerid" => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), "comments" => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), "save" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), "cancel" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null));
check_fields($fields);
$sql = 'SELECT * ' . ' FROM items i, functions f ' . ' WHERE i.itemid=f.itemid ' . ' AND f.triggerid=' . $_REQUEST['triggerid'] . ' AND ' . DBin_node('f.triggerid');
if (!($db_data = DBfetch(DBselect($sql)))) {
    fatal_error(S_NO_TRIGGER_DEFINED);
}
$available_triggers = get_accessible_triggers(PERM_READ_ONLY, array($db_data['hostid']));
if (!isset($available_triggers[$_REQUEST['triggerid']])) {
    access_deny();
}
$trigger_hostid = $db_data['hostid'];
if (isset($_REQUEST["save"])) {
    $result = update_trigger_comments($_REQUEST["triggerid"], $_REQUEST["comments"]);
    show_messages($result, S_COMMENT_UPDATED, S_CANNOT_UPDATE_COMMENT);
    if ($result) {
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, S_TRIGGER . " [" . $_REQUEST["triggerid"] . "] [" . expand_trigger_description($_REQUEST["triggerid"]) . "] " . S_COMMENTS . " [" . $_REQUEST["comments"] . "]");
    }
} else {
    if (isset($_REQUEST["cancel"])) {
        redirect('tr_status.php?hostid=' . $trigger_hostid);
        exit;
    }
}
show_table_header(S_TRIGGER_COMMENTS_BIG);
echo SBR;
insert_trigger_comment_form($_REQUEST["triggerid"]);
include_once "include/page_footer.php";
Пример #7
0
     if (!empty($global_info['database_size']['4images'])) {
         $db_status = $lang['homestats_total'] . " <b>" . format_file_size($global_info['database_size']['total']) . "</b> / ";
         $db_status .= "4images:&nbsp;<b>" . format_file_size($global_info['database_size']['4images']) . "</b>";
     } else {
         $db_status = format_file_size(!empty($global_info['database_size']['total']));
     }
 } else {
     $db_status = "n/a";
 }
 echo $db_status . "</td>\n";
 echo "</tr>";
 show_table_footer();
 $sql = "SELECT SUM(cat_hits) AS sum\n          FROM " . CATEGORIES_TABLE;
 $row = $site_db->query_firstrow($sql);
 $sum = isset($row['sum']) ? $row['sum'] : 0;
 show_table_header($lang['top_cat_hits'] . " (" . $lang['homestats_total'] . " " . $sum . ")", 4);
 $sql = "SELECT cat_id, cat_name, cat_hits\n          FROM " . CATEGORIES_TABLE . "\n          ORDER BY cat_hits DESC\n          LIMIT {$stats_limit}";
 $result = $site_db->query($sql);
 $num = 1;
 while ($row = $site_db->fetch_array($result)) {
     if ($num == 1) {
         $max = $row['cat_hits'];
         if ($max == 0) {
             $max = 1;
         }
     }
     echo "<tr class=\"" . get_row_bg() . "\">\n";
     echo "<td>&nbsp;" . $num . ".</td>\n<td nowrap=\"nowrap\"><b><a href=\"" . $site_sess->url(ROOT_PATH . "categories.php?" . URL_CAT_ID . "=" . $row['cat_id']) . "\" target=\"_blank\">" . format_text($row['cat_name'], 2) . "</a></b></td>\n\n";
     $per = intval($row['cat_hits'] / $max * 100);
     echo "<td width=\"100%\">\n";
     echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\"><tr><td bgcolor=\"#FFFFFF\">\n";
Пример #8
0
show_messages();
$config = select_config();
switch ($config['authentication_type']) {
    case ZBX_AUTH_INTERNAL:
        $auth = S_ZABBIX_INTERNAL_AUTH;
        break;
    case ZBX_AUTH_LDAP:
        $auth = S_LDAP_AUTH;
        break;
    case ZBX_AUTH_HTTP:
        $auth = S_HTTP_AUTH;
        break;
    default:
        $auth = '';
}
show_table_header(S_AUTHENTICATION_TO_ZABBIX, $auth);
if (ZBX_AUTH_INTERNAL == $_REQUEST['config']) {
    $form_refresh_internal = get_request('form_refresh_internal', 0);
    $form_refresh_internal++;
    $frmAuth = new CFormTable(S_ZABBIX_INTERNAL_AUTH, 'authentication.php');
    $frmAuth->setHelp('web.authentication.php');
    $frmAuth->addVar('form_refresh_internal', $form_refresh_internal);
    $cmbConfig = new CCombobox('config', ZBX_AUTH_INTERNAL, 'submit()');
    $cmbConfig->addItem(ZBX_AUTH_INTERNAL, S_INTERNAL_S);
    $cmbConfig->addItem(ZBX_AUTH_LDAP, S_LDAP);
    $cmbConfig->addItem(ZBX_AUTH_HTTP, S_HTTP);
    $frmAuth->addRow(S_DEFAULT_AUTHENTICATION, $cmbConfig);
    $action = "javascript: if(confirm('" . S_SWITCHING_HTTP . "')) return true; else return false;";
    $frmAuth->addRow(S_ZABBIX_INTERNAL_AUTH . SPACE . S_ENABLED, new CCheckBox('authentication_type', ZBX_AUTH_INTERNAL == $config['authentication_type'], $action, ZBX_AUTH_INTERNAL));
    $frmAuth->addItemToBottomRow(new CButton('save', S_SAVE));
    $frmAuth->Show();
Пример #9
0
        if (in_array($_REQUEST['backurl'], array('tr_events.php', 'events.php'))) {
            redirect($_REQUEST['backurl'] . '?eventid=' . $_REQUEST['eventid'] . '&triggerid=' . $_REQUEST['triggerid']);
        } elseif ($_REQUEST['backurl'] == 'screenedit.php') {
            redirect($_REQUEST['backurl'] . '?screenid=' . $_REQUEST['screenid']);
        } elseif ($_REQUEST['backurl'] == 'screens.php') {
            redirect($_REQUEST['backurl'] . '?elementid=' . $_REQUEST['screenid']);
        } else {
            redirect($_REQUEST['backurl']);
        }
    }
}
ob_end_flush();
/*
 * Display
 */
show_table_header(array(_('ALARM ACKNOWLEDGES') . NAME_DELIMITER, $bulk ? ' BULK ACKNOWLEDGE ' : $eventTriggerName));
echo SBR;
if ($bulk) {
    $title = _('Acknowledge alarm by');
    $saveAndReturnLabel = _('Acknowledge and return');
} else {
    $acknowledges = DBselect('SELECT a.*,u.alias,u.name,u.surname' . ' FROM acknowledges a' . ' LEFT JOIN users u ON u.userid=a.userid' . ' WHERE a.eventid=' . zbx_dbstr($_REQUEST['eventid']));
    if ($acknowledges) {
        $acknowledgesTable = new CTable(null, 'ack_msgs');
        $acknowledgesTable->setAlign('center');
        while ($acknowledge = DBfetch($acknowledges)) {
            $acknowledgesTable->addRow(array(new CCol(getUserFullname($acknowledge), 'user'), new CCol(zbx_date2str(_('d M Y H:i:s'), $acknowledge['clock']), 'time')), 'title');
            $acknowledgesTable->addRow(new CCol(zbx_nl2br($acknowledge['message']), null, 2), 'msg');
        }
        $acknowledgesTable->show();
    }
Пример #10
0
}
$form = new CForm();
$form->SetMethod('get');
$form->AddVar("serviceid", $_REQUEST["serviceid"]);
$cmbPeriod = new CComboBox("period", $period, "submit();");
$cmbPeriod->AddItem("dayly", S_DAILY);
$cmbPeriod->AddItem("weekly", S_WEEKLY);
$cmbPeriod->AddItem("monthly", S_MONTHLY);
$cmbPeriod->AddItem("yearly", S_YEARLY);
$form->AddItem(array(SPACE . S_PERIOD . SPACE, $cmbPeriod));
$cmbYear = new CComboBox("year", $year, "submit();");
for ($y = date("Y") - YEAR_LEFT_SHIFT; $y <= date("Y"); $y++) {
    $cmbYear->AddItem($y, $y);
}
$form->AddItem(array(SPACE . S_YEAR . SPACE, $cmbYear));
show_table_header(array(S_IT_SERVICES_AVAILABILITY_REPORT_BIG, SPACE . "\"", new CLink($service["name"], "srv_status.php?serviceid=" . $service["serviceid"]), "\""), $form);
$table = new CTableInfo();
$header = array(S_OK, S_PROBLEMS, S_DOWNTIME, S_PERCENTAGE, S_SLA);
switch ($period) {
    case "yearly":
        $from = date("Y") - YEAR_LEFT_SHIFT;
        $to = date("Y");
        array_unshift($header, new CCol(S_YEAR, "center"));
        function get_time($y)
        {
            return mktime(0, 0, 0, 1, 1, $y);
        }
        function format_time($t)
        {
            return date("Y", $t);
        }
Пример #11
0
/*
** ZABBIX
** Copyright (C) 2000-2008 SIA Zabbix
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once "include/config.inc.php";
require_once "include/blocks.inc.php";
$page["title"] = "S_STATUS_OF_ZABBIX";
$page["file"] = "report1.php";
$page['hist_arg'] = array();
include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array();
check_fields($fields);
show_table_header(S_STATUS_OF_ZABBIX_BIG);
$status = make_status_of_zbx();
$status->show();
include_once "include/page_footer.php";
Пример #12
0
    access_deny();
}
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('password1' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({form})&&({form}!="update")&&isset({change_password})'), 'password2' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({form})&&({form}!="update")&&isset({change_password})'), 'lang' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})'), 'theme' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})'), 'autologin' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'autologout' => array(T_ZBX_INT, O_OPT, null, BETWEEN(90, 10000), null), 'url' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'refresh' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 3600), 'isset({save})'), 'change_password' => array(T_ZBX_STR, O_OPT, null, null, null), 'save' => 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);
if (isset($_REQUEST['cancel'])) {
    $url = get_profile('web.menu.view.last', 'index.php');
    redirect($url);
} else {
    if (isset($_REQUEST['save'])) {
        $_REQUEST['password1'] = get_request('password1', null);
        $_REQUEST['password2'] = get_request('password2', null);
        if (isset($_REQUEST['password1']) && $_REQUEST['password1'] == '') {
            show_error_message(S_ONLY_FOR_GUEST_ALLOWED_EMPTY_PASSWORD);
        } else {
            if ($_REQUEST['password1'] == $_REQUEST['password2']) {
                $result = update_user_profile($USER_DETAILS['userid'], $_REQUEST['password1'], $_REQUEST['url'], get_request('autologin', 0), get_request('autologout', 0), $_REQUEST['lang'], $_REQUEST['theme'], $_REQUEST['refresh']);
                show_messages($result, S_USER_UPDATED, S_CANNOT_UPDATE_USER);
                if ($result) {
                    add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_USER, 'User alias [' . $USER_DETAILS['alias'] . '] name [' . $USER_DETAILS['name'] . '] surname [' . $USER_DETAILS['surname'] . '] profile id [' . $USER_DETAILS['userid'] . ']');
                }
            } else {
                show_error_message(S_CANNOT_UPDATE_USER_BOTH_PASSWORDS);
            }
        }
    }
}
show_table_header(S_USER_PROFILE_BIG . ' : ' . $USER_DETAILS['name'] . ' ' . $USER_DETAILS['surname']);
echo '<br>';
insert_user_form($USER_DETAILS['userid'], 1);
include_once 'include/page_footer.php';
Пример #13
0
                flush();
                @set_time_limit(90);
                if (resize_image($path . "/" . $image_cache[$key]['cat_id'] . "/" . $image_cache[$key][$sql_image_type], $quality, $dimension, $resize_type)) {
                    echo "<br />&nbsp;&nbsp;&nbsp;<b>" . $lang['resizing_image_success'] . "</b><p>";
                } else {
                    echo "<br />&nbsp;&nbsp;&nbsp;<b class=\"marktext\">" . $lang['resizing_image_error'] . "</b><p>";
                }
            }
        }
    } else {
        echo "<b>Just relaxing because you give me nothing to do!</b>";
    }
}
if ($action == "selectoptions") {
    show_form_header("resizer.php", "selectoptions");
    show_table_header($lang['resize_images'], 2);
    $image_type = isset($HTTP_POST_VARS['image_type']) ? trim($HTTP_POST_VARS['image_type']) : "media";
    $select_image_type = "<select name=\"image_type\">";
    $select_image_type .= "<option value=\"media\"";
    if ($image_type == "media") {
        $select_image_type .= " selected";
    }
    $select_image_type .= ">" . $lang['resize_image_files'] . "</option>";
    $select_image_type .= "<option value=\"thumb\"";
    if ($image_type == "thumb") {
        $select_image_type .= " selected";
    }
    $select_image_type .= ">" . $lang['resize_thumb_files'] . "</option>";
    $select_image_type .= "</select>";
    show_custom_row($lang['resize_image_type_desc'], $select_image_type);
    $dimension = isset($HTTP_POST_VARS['dimension']) ? intval($HTTP_POST_VARS['dimension']) : $config['max_image_width'];
Пример #14
0
$gridShow->setAttribute('id', 'gridshow');
$gridAutoAlign = new CSpan($sysmap['grid_align'] == SYSMAP_GRID_ALIGN_ON ? _('On') : _('Off'), 'whitelink');
$gridAutoAlign->setAttribute('id', 'gridautoalign');
$possibleGridSizes = array(20 => '20x20', 40 => '40x40', 50 => '50x50', 75 => '75x75', 100 => '100x100');
$gridSize = new CComboBox('gridsize', $sysmap['grid_size']);
$gridSize->addItems($possibleGridSizes);
$gridAlignAll = new CSubmit('gridalignall', _('Align icons'));
$gridAlignAll->setAttribute('id', 'gridalignall');
$gridForm = new CDiv(array($gridSize, $gridAlignAll));
$gridForm->setAttribute('id', 'gridalignblock');
$saveButton = new CSubmit('save', _('Save'));
$saveButton->setAttribute('id', 'sysmap_save');
$menuRow = array(_s('Map "%s"', $sysmap['name']), SPACE . SPACE, _('Icon'), SPACE, $el_add, SPACE, $el_rmv, SPACE . SPACE, _('Link'), SPACE, $cn_add, SPACE, $cn_rmv, SPACE . SPACE, _('Expand macros') . ' [ ', $expandMacros, ' ]', SPACE . SPACE, _('Grid') . SPACE . '[', $gridShow, '|', $gridAutoAlign, ']', SPACE, $gridForm, SPACE . '|' . SPACE, $saveButton);
$elcn_tab = new CTable(null, 'textwhite');
$elcn_tab->addRow($menuRow);
show_table_header($elcn_tab);
$sysmap_img = new CImg('images/general/tree/zero.gif', 'Sysmap');
$sysmap_img->setAttribute('id', 'sysmap_img', $sysmap['width'], $sysmap['height']);
$table = new CTable();
$table->addRow($sysmap_img);
$table->Show();
$container = new CDiv();
$container->setAttribute('id', 'sysmap_cnt');
$container->Show();
insert_show_color_picker_javascript();
add_elementNames($sysmap['selements']);
foreach ($sysmap['links'] as &$link) {
    foreach ($link['linktriggers'] as $lnum => $linktrigger) {
        $dbTrigger = API::Trigger()->get(array('triggerids' => $linktrigger['triggerid'], 'output' => array('description', 'expression'), 'selectHosts' => API_OUTPUT_EXTEND, 'preservekeys' => true, 'expandDescription' => true));
        $dbTrigger = reset($dbTrigger);
        $host = reset($dbTrigger['hosts']);
Пример #15
0
CProfile::update('web.popup_right.nodeid.last', $nodeid, PROFILE_TYPE_ID);
$frmTitle = new CForm();
$frmTitle->addVar('dstfrm', $dstfrm);
$frmTitle->addVar('permission', $permission);
if (ZBX_DISTRIBUTED) {
    $available_nodes = get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
    $cmbResourceNode = new CComboBox('nodeid', $nodeid, 'submit();');
    $cmbResourceNode->addItem(0, S_ALL_S);
    $sql = 'SELECT name,nodeid ' . ' FROM nodes ' . ' WHERE ' . DBcondition('nodeid', $available_nodes);
    $db_nodes = DBselect($sql);
    while ($node = DBfetch($db_nodes)) {
        $cmbResourceNode->addItem($node['nodeid'], $node['name']);
    }
    $frmTitle->addItem(array(S_NODE, SPACE, $cmbResourceNode));
}
show_table_header(permission2str($permission), $frmTitle);
$form = new CForm();
$form->setAttribute('id', 'groups');
$table = new CTableInfo(S_NO_RESOURCES_DEFINED);
$table->setHeader(new CCol(array(new CCheckBox('all_groups', NULL, 'check_all(this.checked)'), S_NAME)));
// NODES
if ($nodeid == 0) {
    $nodeids = get_current_nodeid(true);
} else {
    $nodeids = $nodeid;
}
$count = 0;
$grouplist = array();
$options = array('nodeids' => $nodeids, 'output' => API_OUTPUT_EXTEND);
$groups = CHostGroup::get($options);
foreach ($groups as $gnum => $row) {
Пример #16
0
    }
}
if ($action == "modifysettings") {
    if (isset($HTTP_GET_VARS['settings_msg'])) {
        printf("<b>%s</b><p>", trim($HTTP_GET_VARS['settings_msg']));
    } elseif (!empty($msg)) {
        echo $msg;
    }
    $sql = "SELECT setting_name, setting_value\n          FROM " . SETTINGS_TABLE;
    $result = $site_db->query($sql);
    $config = array();
    while ($row = $site_db->fetch_array($result)) {
        $config[$row['setting_name']] = $row['setting_value'];
    }
    show_form_header("settings.php", "updatesettings");
    show_table_header($lang['nav_general_settings'], 2);
    echo "<tr class=\"tablerow\"><td colspan=\"2\">";
    echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\"><tr valign=\"top\">\n";
    $numgroups = sizeof($setting_group);
    $percolumn = ceil($numgroups / 2);
    $settingcounter = 0;
    foreach ($setting_group as $key => $val) {
        $settingcounter++;
        echo "<td>";
        show_text_link($val, "#setting_group_" . $key);
        echo "<br /></td>\n";
        if ($settingcounter == 4) {
            echo "</tr><tr>";
            $settingcounter = 0;
        }
    }
Пример #17
0
 $form->addItem(SPACE . _('Period') . SPACE);
 $cmbPeriod = new CComboBox('period', $period, 'submit();');
 $cmbPeriod->addItem('daily', _('Daily'));
 $cmbPeriod->addItem('weekly', _('Weekly'));
 $cmbPeriod->addItem('monthly', _('Monthly'));
 $cmbPeriod->addItem('yearly', _('Yearly'));
 $form->addItem($cmbPeriod);
 if ($period != 'yearly') {
     $form->addItem(SPACE . _('Year') . SPACE);
     $cmbYear = new CComboBox('year', $year, 'submit();');
     for ($y = $minYear; $y <= date('Y'); $y++) {
         $cmbYear->addItem($y, $y);
     }
     $form->addItem($cmbYear);
 }
 show_table_header(_('Notifications'), $form);
 $header = array();
 $db_users = DBselect('SELECT u.*' . ' FROM users u' . whereDbNode('u.userid') . ' ORDER BY u.alias,u.userid');
 while ($user_data = DBfetch($db_users)) {
     $header[] = new CCol($user_data['alias'], 'vertical_rotation');
     $users[$user_data['userid']] = $user_data['alias'];
 }
 $intervals = array();
 switch ($period) {
     case 'yearly':
         $minTime = mktime(0, 0, 0, 1, 1, $minYear);
         $dateFormat = REPORT4_ANNUALLY_DATE_FORMAT;
         array_unshift($header, new CCol(_('Year'), 'center'));
         for ($i = $minYear; $i <= date('Y'); $i++) {
             $intervals[mktime(0, 0, 0, 1, 1, $i)] = mktime(0, 0, 0, 1, 1, $i + 1);
         }
Пример #18
0
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
$nozip = 1;
define('IN_CP', 1);
$root_path = false === stristr($_SERVER['PHP_SELF'], "/plugins/") ? "./../" : "./../../";
define('ROOT_PATH', $root_path);
require ROOT_PATH . 'admin/admin_global.php';
if ($config['language_dir'] == 'deutsch') {
    $lang_clear_cache = 'Cache leeren';
    $lang_clear_confirm = 'Wollen Sie das Cache-Verzeichnis leeren (%s)?';
    $lang_clear_success = 'Cache-Verzeichnis geleert';
} else {
    $lang_clear_cache = 'Clear Cache';
    $lang_clear_confirm = 'Do you want to clear the cache directory (%s)?';
    $lang_clear_success = 'Cache directory cleared';
}
show_admin_header();
if ($action == "clearcache") {
    @set_time_limit(0);
    clear_cache();
    $msg = $lang_clear_success;
}
if ($msg != "") {
    printf("<b>%s</b>\n", $msg);
}
show_form_header($HTTP_SERVER_VARS['PHP_SELF'], "clearcache");
show_table_header($lang_clear_cache);
show_description_row(sprintf($lang_clear_confirm, realpath($cache_path)));
show_form_footer($lang['submit'], "");
show_admin_footer();
Пример #19
0
        echo "</ul>\n</td></tr></table>\n";
        echo "</td></tr>\n";
        show_table_footer();
        $action = "final";
    }
}
if ($action == "intro") {
    $category = "\n<select name=\"cat\" class=\"categoryselect\">\n";
    $category .= "<option value=\"0\">" . $lang['all_categories'] . "</option>\n";
    $category .= "<option value=\"0\">-------------------------------</option>\n";
    $drop_down_cat_cache = array();
    $drop_down_cat_cache = $cat_parent_cache;
    $category .= get_category_dropdown_bits($cat_id);
    $category .= "</select>\n";
    show_form_header("files_check.php", "checkimages");
    show_table_header("Files Check", 2);
    show_custom_row("Category", $category);
    show_radio_row("Include sub-categories", "subcat", 1);
    show_input_row("Number of images to do per cycle", "imchksize", 50, 5);
    show_radio_row("Check Remote Files", "local", 1);
    show_radio_row("Check Thumbnails", "thumbs", 1);
    show_radio_row("Include automatic JavaScript redirect to next page", "autoredirect", 1);
    show_form_footer($lang['submit'], $lang['reset'], 2);
}
if ($action == "checkimages") {
    if (isset($HTTP_GET_VARS['cat']) || isset($HTTP_POST_VARS['cat'])) {
        $cat = isset($HTTP_GET_VARS['cat']) ? intval($HTTP_GET_VARS['cat']) : intval($HTTP_POST_VARS['cat']);
    } else {
        $cat = 0;
    }
    if (isset($HTTP_GET_VARS['subcat']) || isset($HTTP_POST_VARS['subcat'])) {
** 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/users.inc.php';
$page['title'] = _('Groups');
$page['file'] = 'popup_usrgrp.php';
define('ZBX_PAGE_NO_MENU', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('dstfrm' => array(T_ZBX_STR, O_MAND, P_SYS, NOT_EMPTY, NULL), 'new_groups' => array(T_ZBX_STR, O_OPT, P_SYS, NOT_EMPTY, NULL), 'select' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL));
check_fields($fields);
// destination form
$dstfrm = get_request('dstfrm', 0);
$new_groups = get_request('new_groups', array());
show_table_header(_('Groups'));
?>
<script language="JavaScript" type="text/javascript">
<!--
function add_var_to_opener_obj(obj,name,value){
        new_variable = window.opener.document.createElement('input');
        new_variable.type = 'hidden';
        new_variable.name = name;
        new_variable.value = value;

        obj.appendChild(new_variable);
}
-->
</script>
<?php 
if (isset($_REQUEST['select']) && count($new_groups) > 0) {
Пример #21
0
$form->AddItem(SPACE . S_PERIOD . SPACE);
$cmbPeriod = new CComboBox("period", $period, "submit();");
$cmbPeriod->AddItem("dayly", S_DAILY);
$cmbPeriod->AddItem("weekly", S_WEEKLY);
$cmbPeriod->AddItem("monthly", S_MONTHLY);
$cmbPeriod->AddItem("yearly", S_YEARLY);
$form->AddItem($cmbPeriod);
if ($period != "yearly") {
    $form->AddItem(SPACE . S_YEAR . SPACE);
    $cmbYear = new CComboBox("year", $year, "submit();");
    for ($y = $MIN_YEAR; $y <= date("Y"); $y++) {
        $cmbYear->AddItem($y, $y);
    }
    $form->AddItem($cmbYear);
}
show_table_header(S_NOTIFICATIONS_BIG, $form);
$_REQUEST["year"] = $year;
$_REQUEST["period"] = $period;
$_REQUEST["media_type"] = $media_type;
$table = new CTableInfo();
$header = array();
$db_users = DBselect('select * from users where ' . DBin_node('userid') . ' order by alias,userid');
while ($user_data = DBfetch($db_users)) {
    array_push($header, new CImg("vtext.php?text=" . $user_data["alias"]));
    $users[$user_data['userid']] = $user_data['alias'];
}
$media_types = array();
$db_media_types = DBselect('select * from media_type where ' . DBin_node('mediatypeid') . ($media_type > 0 ? " and mediatypeid=" . $media_type : "") . " order by description,mediatypeid");
while ($media_type_data = DBfetch($db_media_types)) {
    $media_types[$media_type_data['mediatypeid']] = $media_type_data['description'];
}
Пример #22
0
    show_form_header("comments.php", "updatecomment", "form", 1);
    show_hidden_input("comment_id", $comment_id);
    show_table_header($lang['nav_comments_edit'] . ": " . format_text($comment['comment_headline'], 2), 2);
    show_input_row($lang['field_username'], "user_name", $comment['user_name'], $textinput_size);
    show_input_row($lang['field_headline'], "comment_headline", $comment['comment_headline'], $textinput_size);
    show_textarea_row($lang['field_comment'], "comment_text", $comment['comment_text'], $textarea_size);
    show_input_row($lang['field_ip'], "comment_ip", $comment['comment_ip'], $textinput_size);
    show_date_input_row($lang['field_date'] . $lang['date_format'] . $lang['date_desc'], "comment_date", $comment['comment_date'], $textinput_size);
    show_form_footer($lang['save_changes'], $lang['reset'], 2);
}
if ($action == "modifycomments") {
    if ($msg != "") {
        printf("<b>%s</b>\n", $msg);
    }
    show_form_header("comments.php", "findcomments", "form");
    show_table_header($lang['nav_comments_edit'], 2);
    show_input_row($lang['field_image_id_contains'], "image_id", "", $textinput_size);
    show_input_row($lang['field_image_name_contains'], "image_name", "", $textinput_size);
    show_input_row($lang['field_username_contains'], "user_name", "", $textinput_size);
    show_input_row($lang['field_headline_contains'], "comment_headline", "", $textinput_size);
    show_input_row($lang['field_comment_contains'], "comment_text", "", $textinput_size);
    show_date_input_row($lang['field_date_after'] . $lang['date_format'], "dateafter", "", $textinput_size);
    show_date_input_row($lang['field_date_before'] . $lang['date_format'], "datebefore", "", $textinput_size);
    show_table_separator($lang['sort_options'], 2);
    ?>
  <tr class="<?php 
    echo get_row_bg();
    ?>
"><td><p><b><?php 
    echo $lang['order_by'];
    ?>
Пример #23
0
<?php

/**
 * DiscuzX Convert
 *
 * $Id: do_setting.inc.php 10469 2010-05-11 09:12:14Z monkey $
 */
showtips('setting_tips');
$sfile = DISCUZ_ROOT . './source/' . $source . '/setting.ini';
if (!submitcheck('submit')) {
    show_form_header();
    show_table_header();
    show_table_row(array(array('colspan="3"', '编辑配置文件 source/' . $source . '/setting.ini')), 'title');
    foreach ($setting as $key => $value) {
        if (is_array($value) && !empty($value)) {
            show_table_row(array(array('colspan="3" align="left"', '<strong>[' . $key . ']<strong>')), 'bg1');
            $disabled = in_array($key, array('program', 'config', 'steps', 'start', 'tablecheck')) ? ' disabled readonly' : '';
            foreach ($value as $k => $v) {
                show_table_row(array(lang($k), array('class="bg2" width="70%"', '<input type="text" size="40" name="newsetting[' . $key . '][' . $k . ']" value="' . htmlspecialchars($v) . '"' . $disabled . '>' . ($disabled ? ' 只读' : ''))), 'bg2');
            }
        }
    }
    show_table_footer();
    show_form_footer('submit', lang('submit'));
} else {
    $newsetting = getgpc('newsetting');
    if (is_array($newsetting)) {
        $lines = file($sfile);
        foreach ($lines as $num => $line) {
            $lines[$num] = $line = trim($line);
            $check = substr($line, 0, 1);
Пример #24
0
        }
    }
}
/* 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"]) {
Пример #25
0
$form->setMethod('get');
$form->addVar('serviceid', $_REQUEST['serviceid']);
$cmbPeriod = new CComboBox('period', $period, 'submit();');
$cmbPeriod->addItem('daily', _('Daily'));
$cmbPeriod->addItem('weekly', _('Weekly'));
$cmbPeriod->addItem('monthly', _('Monthly'));
$cmbPeriod->addItem('yearly', _('Yearly'));
$form->addItem(array(SPACE . _('Period') . SPACE, $cmbPeriod));
if ($period != 'yearly') {
    $cmbYear = new CComboBox('year', $year, 'submit();');
    for ($y = date('Y') - YEAR_LEFT_SHIFT; $y <= date('Y'); $y++) {
        $cmbYear->addItem($y, $y);
    }
    $form->addItem(array(SPACE . _('Year') . SPACE, $cmbYear));
}
show_table_header(array(_('IT SERVICES AVAILABILITY REPORT'), SPACE . '"', new CLink($service['name'], 'srv_status.php?showgraph=1&serviceid=' . $service['serviceid']), '"'), $form);
$table = new CTableInfo();
$header = array(_('Ok'), _('Problems'), _('Downtime'), _('SLA'), _('Acceptable SLA'));
switch ($period) {
    case 'yearly':
        $from = date('Y') - YEAR_LEFT_SHIFT;
        $to = date('Y');
        array_unshift($header, new CCol(_('Year'), 'center'));
        function get_time($y)
        {
            return mktime(0, 0, 0, 1, 1, $y);
        }
        function format_time($t)
        {
            return zbx_date2str(_x('Y', DATE_FORMAT_CONTEXT), $t);
        }
Пример #26
0
        if (defined('ZBX_MBSTRINGS_ENABLED')) {
            $value = mb_convert_encoding($value, 'UTF-8', mb_detect_encoding($value));
            $valueTo = mb_convert_encoding($valueTo, 'UTF-8', mb_detect_encoding($valueTo));
        }
        //		$value = new CDiv($value);
        //		$value->setAttribute('style','text-align: right;');
        //		$frmLcls->addRow($value, new CTextBox('langTo['.$key.']',$valueTo,80));
        $frmLcls->addRow(new CTextBox('langTo[' . $key . ']', $valueTo, 80), $value);
        $value = '';
    }
    $frmLcls->addItemToBottomRow(new CButton('prev', '<< ' . S_PREVIOUS));
    $frmLcls->addItemToBottomRow(SPACE);
    $frmLcls->addItemToBottomRow(new CButton('download', S_DOWNLOAD));
    $frmLcls->show();
} else {
    show_table_header(S_LOCALES);
    echo SBR;
    $frmLcls = new CFormTable(S_CREATE . SPACE . S_LOCALE_SMALL, 'locales.php', 'post', null, 'form');
    $frmLcls->setAttribute('id', 'locales');
    $cmbLang = new CComboBox('srclang', get_request('srclang', 'en_gb'));
    foreach ($ZBX_LOCALES as $id => $name) {
        $cmbLang->addItem($id, $name);
    }
    $frmLcls->addRow(S_TAKE_DEF_LOCALE, $cmbLang);
    $cmbExtLang = new CComboBox('extlang', get_request('extlang', 'new'));
    $cmbExtLang->addItem('new', S_CREATE . SPACE . S_NEW_SMALL);
    foreach ($ZBX_LOCALES as $id => $name) {
        $cmbExtLang->addItem($id, $name);
    }
    $frmLcls->addRow(S_LOCALE_TO_EXTEND, $cmbExtLang);
    $cmbFill = new CComboBox('fill', get_request('fill', 1));
Пример #27
0
    show_messages($result, S_MEDIA_TYPE_DELETED, S_MEDIA_TYPE_WAS_NOT_DELETED);
    if ($result) {
        /*			add_audit(AUDIT_ACTION_DELETE,AUDIT_RESOURCE_MEDIA_TYPE,
        				"Media type [".$mediatype["description"]."]");
        */
        unset($_REQUEST["form"]);
    }
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(new CButton("form", S_CREATE_MEDIA_TYPE));
$row_count = 0;
$numrows = new CSpan(null, 'info');
$numrows->addOption('name', 'numrows');
$header = get_table_header(array(S_CONFIGURATION_OF_MEDIA_TYPES_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
show_table_header($header, $form);
if (isset($_REQUEST["form"])) {
    echo SBR;
    insert_media_type_form();
} else {
    $table = new CTableInfo(S_NO_MEDIA_TYPES_DEFINED);
    $table->setHeader(array(make_sorting_link(S_TYPE, 'mt.type'), make_sorting_link(S_DESCRIPTION, 'mt.description'), S_DETAILS));
    $result = DBselect('SELECT mt.* ' . ' FROM media_type mt' . ' WHERE ' . DBin_node('mt.mediatypeid') . order_by('mt.type,mt.description'));
    while ($row = DBfetch($result)) {
        switch ($row['type']) {
            case MEDIA_TYPE_EMAIL:
                $details = S_SMTP_SERVER . ": '" . $row['smtp_server'] . "', " . S_SMTP_HELO . ": '" . $row['smtp_helo'] . "', " . S_SMTP_EMAIL . ": '" . $row['smtp_email'] . "'";
                break;
            case MEDIA_TYPE_EXEC:
                $details = S_SCRIPT_NAME . ": '" . $row['exec_path'] . "'";
                break;
Пример #28
0
**/
require_once 'include/config.inc.php';
require_once 'include/screens.inc.php';
require_once 'include/forms.inc.php';
require_once 'include/nodes.inc.php';
require_once 'include/blocks.inc.php';
$page['title'] = "S_CONFIGURATION_OF_SCREENS";
$page['file'] = 'screenedit.php';
$page['hist_arg'] = array('screenid');
$page['scripts'] = array('scriptaculous.js?load=effects,dragdrop', 'cscreen.js');
include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('screenid' => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 'screenitemid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, '(isset({form})&&({form}=="update"))&&(!isset({x})||!isset({y}))'), 'resourcetype' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 14), 'isset({save})'), 'resourceid' => array(T_ZBX_INT, O_OPT, null, DB_ID, 'isset({save})'), 'width' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null), 'height' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), null), 'colspan' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 100), null), 'rowspan' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 100), null), 'elements' => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, 65535), null), 'valign' => array(T_ZBX_INT, O_OPT, null, BETWEEN(VALIGN_MIDDLE, VALIGN_BOTTOM), null), 'halign' => array(T_ZBX_INT, O_OPT, null, BETWEEN(HALIGN_CENTER, HALIGN_RIGHT), null), 'style' => array(T_ZBX_INT, O_OPT, null, BETWEEN(STYLE_HORISONTAL, STYLE_VERTICAL), 'isset({save})'), 'url' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'dynamic' => array(T_ZBX_INT, O_OPT, null, null, null), 'x' => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, 100), 'isset({save})&&(isset({form})&&({form}!="update"))'), 'y' => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, 100), 'isset({save})&&(isset({form})&&({form}!="update"))'), '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), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'delete' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null), 'add_row' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 100), null), 'add_col' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 100), null), 'rmv_row' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 100), null), 'rmv_col' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 100), null), 'sw_pos' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 100), null));
check_fields($fields);
$_REQUEST['dynmic'] = get_request('dynamic', SCREEN_SIMPLE_ITEM);
show_table_header(S_CONFIGURATION_OF_SCREEN_BIG);
if (isset($_REQUEST['screenid'])) {
    if (!screen_accessible($_REQUEST['screenid'], PERM_READ_WRITE)) {
        access_deny();
    }
    $screen = get_screen_by_screenid($_REQUEST['screenid']);
    echo SBR;
    if (isset($_REQUEST['save'])) {
        if (!isset($_REQUEST['elements'])) {
            $_REQUEST['elements'] = 0;
        }
        DBstart();
        if (isset($_REQUEST['screenitemid'])) {
            $result = update_screen_item($_REQUEST['screenitemid'], $_REQUEST['resourcetype'], $_REQUEST['resourceid'], $_REQUEST['width'], $_REQUEST['height'], $_REQUEST['colspan'], $_REQUEST['rowspan'], $_REQUEST['elements'], $_REQUEST['valign'], $_REQUEST['halign'], $_REQUEST['style'], $_REQUEST['url'], $_REQUEST['dynmic']);
            show_messages($result, S_ITEM_UPDATED, S_CANNOT_UPDATE_ITEM);
        } else {
Пример #29
0
     if ($resize_type_thumbs == $key) {
         $resize .= " selected=\"selected\"";
     }
     $resize .= ">{$val}</option>\n";
 }
 $resize .= "</select>\n";
 show_custom_row($lang['resize_proportions_desc'], $resize);
 show_input_row($lang['convert_thumbnail_quality'], "quality_thumbs", $quality_thumbs);
 if (!$detailed) {
     show_table_separator($lang['user'], 2);
     show_user_select_row($lang['add_as_user'], $user_id);
 }
 show_table_footer();
 show_hidden_input("cat_id_p", $cat_id_p);
 show_hidden_input("mode", 1);
 show_table_header(preg_replace("/" . $site_template->start . "num_all_newimages" . $site_template->end . "/siU", $num_all_newimages, $lang['checkimages_note']), $colspan);
 if ($num_all_newimages) {
     show_description_row("<input name=\"allbox\" type=\"checkbox\" onClick=\"CheckAll();\"" . ($status ? "" : " checked=\"checked\"") . " /> <b>" . $lang['check_all'] . "</b>", $colspan);
 } else {
     show_description_row($lang['no_newimages'], $colspan);
 }
 $i = 0;
 foreach ($image_list as $key => $val) {
     $cat_id = $key;
     $cat_path = $cat_id == 0 ? "" : "/" . $cat_id;
     $cat_name = @$cat_cache[$cat_id]['cat_name'];
     $count = count($val);
     foreach ($val as $file) {
         $i++;
         //Check Image
         $file_type = get_file_extension($file);
Пример #30
0
 }
 show_form_header("backup.php", "makebackup");
 show_table_header($lang['do_backup'], 2);
 $table_select = "<select name=\"db_tables[]\" size=\"10\" multiple>\n";
 $result = $site_db->query("SHOW tables");
 while ($row = $site_db->fetch_array($result)) {
     $table_select .= "<option value=\"" . $row[0] . "\"";
     if (in_array($row[0], $default_tables) && preg_match("/^" . $table_prefix . "/i", $row[0])) {
         $table_select .= " selected";
     }
     $table_select .= ">" . $row[0] . "</option>\n";
 }
 $table_select .= "</select>\n";
 show_custom_row($lang['do_backup_desc'] . $db_status, $table_select);
 show_form_footer($lang['do_backup'], $lang['reset']);
 show_table_header($lang['list_backups'], 4);
 $handle = opendir(ROOT_PATH . DATABASE_DIR);
 $filelist = array();
 while ($file = @readdir($handle)) {
     if (is_file(ROOT_PATH . DATABASE_DIR . "/" . $file) && $file != "." && $file != ".." && preg_match("/\\.sql/i", $file)) {
         $filelist[] = $file;
     }
 }
 closedir($handle);
 if (!empty($filelist)) {
     rsort($filelist);
     foreach ($filelist as $key => $file) {
         echo "<tr class=\"" . get_row_bg() . "\" width=\"30%\">\n<td><p class=\"rowtitle\">{$file}</p></td>\n";
         $file_time = format_date($config['date_format'] . " " . $config['time_format'], filemtime(ROOT_PATH . DATABASE_DIR . "/" . $file));
         echo "<td>" . $file_time . "</td>";
         $file_size = format_file_size(@filesize(ROOT_PATH . DATABASE_DIR . "/" . $file));