From a34f70ce0a6732554120a8e356030f32dc3b82e6 Mon Sep 17 00:00:00 2001 From: Eric Masseran Date: Sat, 28 Oct 2017 00:54:25 +0200 Subject: [PATCH] Change status code when config is write protected Add hint msg, you can make config file read only If the config.php is not writable, print an error message: #6893 - set config writable - or set option to keep it read only Signed-off-by: Eric Masseran --- lib/base.php | 8 ++++++-- lib/private/legacy/util.php | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/base.php b/lib/base.php index 5cc33e233f9..c859972d39b 100644 --- a/lib/base.php +++ b/lib/base.php @@ -249,14 +249,18 @@ class OC { if (self::$CLI) { echo $l->t('Cannot write into "config" directory!')."\n"; echo $l->t('This can usually be fixed by giving the webserver write access to the config directory')."\n"; - echo "\n"; echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-dir_permissions') ])."\n"; + echo "\n"; + echo $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.')."\n"; + echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-config') ])."\n"; exit; } else { OC_Template::printErrorPage( $l->t('Cannot write into "config" directory!'), $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s', - [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) + [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. ' + . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', + [ $urlGenerator->linkToDocs('admin-config') ] ) ); } } diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 356d336f687..ab595d885cb 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -745,7 +745,9 @@ class OC_Util { $errors[] = array( 'error' => $l->t('Cannot write into "config" directory'), 'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s', - [$urlGenerator->linkToDocs('admin-dir_permissions')]) + [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. ' + . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', + [ $urlGenerator->linkToDocs('admin-config') ] ) ); } }