コード例 #1
0
ファイル: http-auth.inc.php プロジェクト: Natolumin/observium
/**
 * This function forces a login prompt via basic HTTP authentication by making the browser believe
 * the authentication has failed. Required to log out a basic HTTP auth session.
 */
function http_auth_require_login()
{
    $realm = $GLOBALS['config']['login_message'];
    header('WWW-Authenticate: Basic realm="' . $realm . '"');
    header('HTTP/1.1 401 Unauthorized');
    print_error_permission();
    session_logout();
    die;
}
コード例 #2
0
ファイル: data.inc.php プロジェクト: Natolumin/observium
<?php

/**
 * Observium Network Management and Monitoring System
 * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org
 *
 * @package    observium
 * @subpackage webui
 * @author     Adam Armstrong <*****@*****.**>
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if ($_SESSION['userlevel'] < 10) {
    print_error_permission();
    return;
}
$export_device = $device;
if ($config['snmp']['hide_auth']) {
    $params = array('snmp_community', 'snmp_authlevel', 'snmp_authname', 'snmp_authpass', 'snmp_authalgo', 'snmp_cryptopass', 'snmp_cryptoalgo');
    foreach ($params as $param) {
        if (strlen($export_device[$param])) {
            $export_device[$param] = '***';
        }
    }
}
if ($vars['saveas'] == 'yes' && $vars['filename']) {
    download_as_file(gzencode(_json_encode($export_device)), $vars['filename']);
} else {
    if ($config['snmp']['hide_auth']) {
        print_warning("NOTE, <strong>\$config['snmp']['hide_auth']</strong> is set to <strong>TRUE</strong>, snmp community and snmp v3 auth hidden from output and export.");
    } else {
コード例 #3
0
ファイル: port-edit.inc.php プロジェクト: Natolumin/observium
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage webui
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
# enable/disable ports/interfaces on devices.
$device_id = intval($vars['device']);
if (!device_permitted($device_id)) {
    print_error_permission('You have insufficient permissions to edit settings.');
    return;
}
$rows_updated = 0;
//r($vars);
$ports_attribs = get_device_entities_attribs($device_id, 'port');
// Get all attribs
$where = generate_query_values($vars['port'], 'port_id');
foreach (dbFetchRows("SELECT `port_id`, `ignore`, `disabled` FROM `ports` WHERE `device_id` = ?" . $where, array($device_id)) as $port) {
    $updated = FALSE;
    $port_id = $port['port_id'];
    $update_array = array();
    if (isset($ports_attribs['port'][$port_id])) {
        $port = array_merge($port, $ports_attribs['port'][$port_id]);
    }
    // Check ignored and disabled port