diff --git a/configure-db.php b/configure-db.php index 715c9d1..1eb0744 100644 --- a/configure-db.php +++ b/configure-db.php @@ -101,10 +101,6 @@ catch (PDOException $e) { } $contents = file_get_contents($confpath); -foreach ($config as $name => $value) { - $contents = preg_replace('/(define\s*\(\'' . $name . '\',\s*)(.*)(\);)/', '$1"' . $value . '"$3', $contents); -} - if(getenv('AUTH_METHOD') == "ldap") { $config['PLUGINS'] = 'auth_ldap, note'; $contents .= "define('LDAP_AUTH_SERVER_URI', '" . env("LDAP_AUTH_SERVER_URI", "ldap://ldap") . "');\n"; @@ -120,6 +116,9 @@ if(getenv('AUTH_METHOD') == "ldap") { $contents .= "define('LDAP_AUTH_LOG_ATTEMPTS', " . env("LDAP_AUTH_LOG_ATTEMPTS", "FALSE") . ");\n"; $contents .= "define('LDAP_AUTH_DEBUG', " . env("LDAP_AUTH_DEBUG", "FALSE") . ");\n"; } +foreach ($config as $name => $value) { + $contents = preg_replace('/(define\s*\(\'' . $name . '\',\s*)(.*)(\);)/', '$1"' . $value . '"$3', $contents); +} file_put_contents($confpath, $contents);