1
0
Fork 0

fix #1 - saving of config files

Dieser Commit ist enthalten in:
o.pinke 2022-03-11 18:33:58 +01:00
Ursprung 3ea22223d6
Commit f0585f18c2
2 geänderte Dateien mit 7 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -69,15 +69,15 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract {
if (mr_arrayValue($request, 'checkrootdir') == 1) {
// root dir check is enabled, this results in error
$sMsg = i18n("The specified directory '%s' does not exists", "cl-mod-rewrite");
$sMsg = sprintf($sMsg, $_SERVER['DOCUMENT_ROOT'] . $request['rootdir']);
$sMsgTpl = i18n("The specified directory '%s' does not exists", "cl-mod-rewrite");
$sMsg = sprintf($sMsgTpl, $_SERVER['DOCUMENT_ROOT'] . $request['rootdir']);
$this->_oView->rootdir_error = $this->_notifyBox('error', $sMsg);
$bError = true;
} else {
// root dir check ist disabled, take over the setting and
// output a warning.
$sMsg = i18n("The specified directory '%s' does not exists in DOCUMENT_ROOT '%s'. This could happen, if clients DOCUMENT_ROOT differs from CONTENIDO backends DOCUMENT_ROOT. However, the setting will be taken over because of disabled check.", "cl-mod-rewrite");
$sMsg = sprintf($sMsg, $request['rootdir'], $_SERVER['DOCUMENT_ROOT']);
$sMsgTpl = i18n("The specified directory '%s' does not exists in DOCUMENT_ROOT '%s'. This could happen, if clients DOCUMENT_ROOT differs from CONTENIDO backends DOCUMENT_ROOT. However, the setting will be taken over because of disabled check.", "cl-mod-rewrite");
$sMsg = sprintf($sMsgTpl, $request['rootdir'], $_SERVER['DOCUMENT_ROOT']);
$this->_oView->rootdir_error = $this->_notifyBox('warning', $sMsg);
}
}
@ -377,7 +377,7 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract {
$this->_oView->content_before .= $this->_notifyBox('info', $sMsg);
} else {
$sMsg = i18n("Configuration could not saved. Please check write permissions for %s ", "cl-mod-rewrite");
$sMsg = sprintf($sMsg, $options['key']);
$sMsg = sprintf($sMsg, mr_getConfigurationFilePath($this->_client));
$this->_oView->content_before .= $this->_notifyBox('error', $sMsg);
}
}

Datei anzeigen

@ -688,12 +688,12 @@ function mr_setConfiguration($clientId, array $config) {
if(file_exists($sConfigClientPath) && is_writable($sConfigClientPath)) {
$file = $sConfigClientPath. 'config.mod_rewrite.php';
} else {
} else {
$file = cRegistry::getConfigValue('path', 'contenido') . cRegistry::getConfigValue('path', 'plugins') . 'cl-mod-rewrite/includes/config.mod_rewrite_' . cRegistry::getClientId() . '.php';
}
$result = file_put_contents($file, serialize($config));
return ($result) ? true : false;
return (empty($result)) ? false : true;
}
/**