Beispiel #1
0
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage web
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if ($_SESSION['userlevel'] < 10) {
    print_error_permission();
    return;
}
register_html_resource('js', 'clipboard.min.js');
register_html_resource('script', 'new Clipboard("#clipboard");');
// Load SQL config into $database_config
load_sqlconfig($database_config);
// cache default and config.php-defined values
$defined_config = get_defined_settings();
$default_config = get_default_settings();
echo '<form id="settings" name="settings" method="post" action="" class="form form-inline">' . PHP_EOL;
// Pretty inefficient looping everything if section != all, but meh
// This is only done on this page, so there is no performance issue for the rest of Observium
foreach ($config_subsections as $section => $subdata) {
    if (isset($config_sections[$section]['edition']) && $config_sections[$section]['edition'] != OBSERVIUM_EDITION) {
        // Skip sections not allowed for current Observium edition
        continue;
    }
    echo '  <div class="row"> <div class="col-md-12"> <!-- BEGIN SECTION ' . $section . ' -->' . PHP_EOL;
    if ($vars['section'] == 'all' || $vars['section'] == $section) {
        if ($vars['section'] == 'all') {
            // When printing all, also print the section name
Beispiel #2
0
            dbQuery('SET SESSION `sql_mode` = ?', array(implode(',', $db_modes)));
            print_debug('DB STRICT mode disabled');
        }
        //register_shutdown_function('dbClose');
        // Maybe better in another place, but at least here it runs always; keep track of what svn revision we last saw, and eventlog the upgrade versions.
        // We have versions here from the includes above, and we just connected to the DB.
        $rev_old = @get_obs_attrib('current_rev');
        if ($rev_old < OBSERVIUM_REV || !is_numeric($rev_old)) {
            set_obs_attrib('current_rev', OBSERVIUM_REV);
            log_event("Observium updated: {$rev_old} -> " . OBSERVIUM_REV);
            // FIXME log_event currently REQUIRES a device, the SQL query will fail.
        }
    }
}
// Load SQL configuration into $config variable
load_sqlconfig($config);
/**
 * OHMYGOD, this is very dangerous, because this is secure hole for override static definitions,
 * now already defined configs skipped in load_sqlconfig().
 *
// Reload configuration file into $config variable to make sure it overrules all SQL-supplied and default settings
// Not the greatest hack, but array_merge was unfit for the job, unfortunately.
include($config['install_dir']."/config.php");
*/
// Disable nonexistant features in CE, do not try to turn on, it will not give effect
if (OBSERVIUM_EDITION == 'community') {
    $config['enable_billing'] = 0;
    $config['api']['enabled'] = 0;
    // Disabled (not exist) modules
    unset($config['poller_modules']['oids'], $config['poller_modules']['loadbalancer'], $config['poller_modules']['aruba-controller'], $config['poller_modules']['netscaler-vsvr']);
}