Пример #1
0
function InitPhpLogConConfigFile($bHandleMissing = true)
{
    // Needed to make global
    global $CFG, $gl_root_path, $content;
    // Bugfix for race conditions, clear file stats cache!
    clearstatcache();
    if (file_exists($gl_root_path . 'config.php') && GetFileLength($gl_root_path . 'config.php') > 0) {
        // Include the main config
        include_once $gl_root_path . 'config.php';
        // Easier DB Access
        $tblPref = GetConfigSetting("UserDBPref", "logcon");
        define('DB_CONFIG', $tblPref . "config");
        define('DB_GROUPS', $tblPref . "groups");
        define('DB_GROUPMEMBERS', $tblPref . "groupmembers");
        define('DB_FIELDS', $tblPref . "fields");
        define('DB_SEARCHES', $tblPref . "searches");
        define('DB_SOURCES', $tblPref . "sources");
        define('DB_USERS', $tblPref . "users");
        define('DB_VIEWS', $tblPref . "views");
        define('DB_CHARTS', $tblPref . "charts");
        define('DB_MAPPINGS', $tblPref . "dbmappings");
        define('DB_SAVEDREPORTS', $tblPref . "savedreports");
        // Legacy support for old columns definition format!
        if (isset($CFG['Columns']) && is_array($CFG['Columns'])) {
            AppendLegacyColumns();
        }
        // --- Now Copy all entries into content variable
        foreach ($CFG as $key => $value) {
            $content[$key] = $value;
        }
        // ---
        // For MiscShowPageRenderStats
        if (GetConfigSetting("MiscShowPageRenderStats", 1)) {
            $content['ShowPageRenderStats'] = "true";
            InitPageRenderStats();
        }
        // return result
        return true;
    } else {
        // if handled ourselfe, we die in CheckForInstallPhp.
        if ($bHandleMissing == true) {
            // Check for installscript!
            CheckForInstallPhp();
        } else {
            return false;
        }
    }
}
Пример #2
0
                }
            } else {
                $content['fileperm'][$i]['BGCOLOR'] = "#770000";
                $content['fileperm'][$i]['ISSUCCESS'] = "File does NOT exist!";
                $bSuccess = false;
            }
        }
    }
    if (!$bSuccess) {
        $content['NEXT_ENABLED'] = "false";
        $content['RECHECK_ENABLED'] = "true";
        $content['iserror'] = "true";
        $content['errormsg'] = $content['LN_INSTALL_FILEORDIRNOTWRITEABLE'];
    }
    // Check if sample config file is available
    if (!is_file($configsamplefile) || GetFileLength($configsamplefile) <= 0) {
        $content['NEXT_ENABLED'] = "false";
        $content['RECHECK_ENABLED'] = "true";
        $content['iserror'] = "true";
        $content['errormsg'] = GetAndReplaceLangStr($content['LN_INSTALL_SAMPLECONFIGMISSING'], $configsamplefile);
    }
} else {
    if ($content['INSTALL_STEP'] == 3) {
        // --- Read and predefine Database options
        if (isset($_SESSION['UserDBEnabled'])) {
            $content['UserDBEnabled'] = $_SESSION['UserDBEnabled'];
        } else {
            $content['UserDBEnabled'] = false;
        }
        if (isset($_SESSION['UserDBServer'])) {
            $content['UserDBServer'] = $_SESSION['UserDBServer'];