1
0

Move replace section, so that PLUGIN constant gets replaced properly

This commit is contained in:
fischerman 2016-01-31 00:17:05 +01:00
parent 407df28a8d
commit 035f03c623

View File

@ -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);