예제 #1
0
require_once 'functions.php';
require_once 'database.php';
require_once 'auth.php';
require_once 'navigation.php';
require_once 'triggers.php';
require_once 'remote.php';
require_once 'caching.php';
require_once 'slb.php';
require_once 'slbv2.php';
// secret.php may be missing, in which case this is a special fatal error
if (!fileSearchExists($path_to_secret_php)) {
    throw new RackTablesError("This instance of RackTables misses a configuration file " . "(<code>{$path_to_secret_php}</code>).<br>" . "The configuration file is usually generated by RackTables installer, which " . "can be launched <a href='?module=installer'>here</a>.", RackTablesError::MISCONFIGURED);
}
connectDB();
transformRequestData();
$configCache = loadConfigDefaults();
$tab['reports']['local'] = getConfigVar('enterprise');
if (getConfigVar('DB_VERSION') != CODE_VERSION) {
    echo '<p align=justify>This Racktables installation seems to be ' . 'just upgraded to version ' . CODE_VERSION . ', while the ' . 'database version is ' . getConfigVar('DB_VERSION') . '.<br>No user will be ' . 'either authenticated or shown any page until the upgrade is ' . "finished.<br>Follow <a href='?module=upgrade'>this link</a> and " . 'authenticate as administrator to finish the upgrade.</p>';
    exit(1);
}
if (!mb_internal_encoding('UTF-8')) {
    throw new RackTablesError('Failed setting multibyte string encoding to UTF-8', RackTablesError::INTERNAL);
}
$rackCodeCache = loadScript('RackCodeCache');
if ($rackCodeCache == NULL or !strlen($rackCodeCache)) {
    $rackCode = getRackCode(loadScript('RackCode'));
    saveScript('RackCodeCache', base64_encode(serialize($rackCode)));
} else {
    $rackCode = unserialize(base64_decode($rackCodeCache));
    if ($rackCode === FALSE) {
예제 #2
0
require_once 'config.php';
require_once 'functions.php';
require_once 'database.php';
require_once 'auth.php';
require_once 'navigation.php';
require_once 'triggers.php';
require_once 'remote.php';
require_once 'caching.php';
require_once 'slb.php';
// secret.php may be missing, in which case this is a special fatal error
if (!fileSearchExists($path_to_secret_php)) {
    throw new RackTablesError("Database connection parameters are read from {$path_to_secret_php} file, " . "which cannot be found.<br>You probably need to complete the installation " . "procedure by following <a href='?module=installer'>this link</a>.", RackTablesError::MISCONFIGURED);
}
connectDB();
transformRequestData();
loadConfigDefaults();
$tab['reports']['local'] = getConfigVar('enterprise');
if (getConfigVar('DB_VERSION') != CODE_VERSION) {
    echo '<p align=justify>This Racktables installation seems to be ' . 'just upgraded to version ' . CODE_VERSION . ', while the ' . 'database version is ' . getConfigVar('DB_VERSION') . '.<br>No user will be ' . 'either authenticated or shown any page until the upgrade is ' . "finished.<br>Follow <a href='?module=upgrade'>this link</a> and " . 'authenticate as administrator to finish the upgrade.</p>';
    exit(1);
}
if (!mb_internal_encoding('UTF-8')) {
    throw new RackTablesError('Failed setting multibyte string encoding to UTF-8', RackTablesError::INTERNAL);
}
$rackCodeCache = loadScript('RackCodeCache');
if ($rackCodeCache == NULL or !strlen($rackCodeCache)) {
    $rackCode = getRackCode(loadScript('RackCode'));
    saveScript('RackCodeCache', base64_encode(serialize($rackCode)));
} else {
    $rackCode = unserialize(base64_decode($rackCodeCache));
    if ($rackCode === FALSE) {