Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1054 → Rev 1055

/trunk/includes/classes/OIDplus.class.php
53,6 → 53,10
private function __construct() {
}
 
private static function insideSetup() {
return (strpos($_SERVER['REQUEST_URI'], OIDplus::webpath(null,OIDplus::PATH_RELATIVE_TO_ROOT).'setup/') === 0);
}
 
// --- Static classes
 
private static $baseConfig = null;
64,6 → 68,10
self::$baseConfig = new OIDplusBaseConfig();
}
 
if (self::insideSetup()) return self::$baseConfig;
if ((basename($_SERVER['SCRIPT_NAME']) === 'oidplus.min.js.php') && isset($_REQUEST['noBaseConfig']) && ($_REQUEST['noBaseConfig'] == '1')) return self::$baseConfig;
if ((basename($_SERVER['SCRIPT_NAME']) === 'oidplus.min.css.php') && isset($_REQUEST['noBaseConfig']) && ($_REQUEST['noBaseConfig'] == '1')) return self::$baseConfig;
 
if ($first_init) {
// Include a file containing various size/depth limitations of OIDs
// It is important to include it before userdata/baseconfig/config.inc.php was included,
123,10 → 131,9
}
}
 
// Backwards compatibility 2.0 => 2.1
if (defined('OIDPLUS_CONFIG_VERSION') && (OIDPLUS_CONFIG_VERSION == 2.0)) {
self::$oldConfigFormatLoaded = true;
 
// Backwards compatibility 2.0 => 2.1
foreach (get_defined_constants(true)['user'] as $name => $value) {
$name = str_replace('OIDPLUS_', '', $name);
if ($name == 'SESSION_SECRET') $name = 'SERVER_SECRET';
139,20 → 146,20
'DISABLE_PLUGIN_TushevOrg\OIDplus\OIDplusPagePublicUITweaks', $name);
$name = str_replace('DISABLE_PLUGIN_OIDplus',
'DISABLE_PLUGIN_ViaThinkSoft\OIDplus\OIDplus', $name);
if (($name == 'MYSQL_PASSWORD') || ($name == 'ODBC_PASSWORD') || ($name == 'PDO_PASSWORD') || ($name == 'PGSQL_PASSWORD')) {
self::$baseConfig->setValue($name, base64_decode($value));
} else {
if ($name == 'CONFIG_VERSION') $value = 2.1;
if ($name == 'CONFIG_VERSION') {
$value = 2.1;
} else if (($name == 'MYSQL_PASSWORD') || ($name == 'ODBC_PASSWORD') || ($name == 'PDO_PASSWORD') || ($name == 'PGSQL_PASSWORD')) {
$value = base64_decode($value);
}
self::$baseConfig->setValue($name, $value);
}
}
}
} else {
if (!is_dir(OIDplus::localpath().'setup')) {
throw new OIDplusConfigInitializationException(_L('File %1 is missing, but setup can\'t be started because its directory missing.',$config_file));
} else {
if (self::$html) {
if (strpos($_SERVER['REQUEST_URI'], OIDplus::webpath(null,OIDplus::PATH_RELATIVE_TO_ROOT).'setup/') !== 0) {
if (!self::insideSetup()) {
header('Location:'.OIDplus::webpath(null,OIDplus::PATH_RELATIVE).'setup/');
die(_L('Redirecting to setup...'));
} else {