summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-03-02 09:19:26 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-03-02 09:19:26 +0100
commit4009f152558fd5a18cddb37be776fe38e79879c9 (patch)
treea37e211a701746b1154583040816e1d94c3cd846 /lib
parent7194952db487b22b2b15ae4c76d3fbbc93908c04 (diff)
parentafb0d742b9137b2ab0db7a3c90f8baafbfb26ca6 (diff)
downloadnextcloud-server-4009f152558fd5a18cddb37be776fe38e79879c9.tar.gz
nextcloud-server-4009f152558fd5a18cddb37be776fe38e79879c9.zip
Merge pull request #14593 from owncloud/fix/13994
Add detection for invalid CLI configuration for settings page
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index a97b1b3dade..1f2e90deefd 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -575,15 +575,30 @@ class OC {
$errors = OC_Util::checkServer(\OC::$server->getConfig());
if (count($errors) > 0) {
if (self::$CLI) {
+ // Convert l10n string into regular string for usage in database
+ $staticErrors = [];
foreach ($errors as $error) {
echo $error['error'] . "\n";
echo $error['hint'] . "\n\n";
+ $staticErrors[] = [
+ 'error' => (string) $error['error'],
+ 'hint' => (string) $error['hint'],
+ ];
}
+
+ try {
+ \OC::$server->getConfig()->setAppValue('core', 'cronErrors', json_encode($staticErrors));
+ } catch(\Exception $e) {
+ echo('Writing to database failed');
+ }
+ exit();
} else {
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printGuestPage('', 'error', array('errors' => $errors));
+ exit;
}
- exit;
+ } elseif(self::$CLI && \OC::$server->getConfig()->getSystemValue('installed', false)) {
+ \OC::$server->getConfig()->deleteAppValue('core', 'cronErrors');
}
//try to set the session lifetime