summaryrefslogtreecommitdiffstats
path: root/settings/admin.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-08-18 09:40:42 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-08-18 11:10:22 +0200
commit64d64610d25658de4af0062e208881583ef86f4f (patch)
tree4286cc7d820190b9c630beea8f62ae90ecc0ff6f /settings/admin.php
parent4dd07f572ca726c7e62204170c3fdbf5c6c6cfbd (diff)
downloadnextcloud-server-64d64610d25658de4af0062e208881583ef86f4f.tar.gz
nextcloud-server-64d64610d25658de4af0062e208881583ef86f4f.zip
Add a note about overwritewebroot when using system cron
If the current webroot is non-empty but the webroot from the config is, and system cron is used, the URL generator fails to build valid URLs. So we notify the admin to set it up correctly. Fix #9995
Diffstat (limited to 'settings/admin.php')
-rwxr-xr-xsettings/admin.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/settings/admin.php b/settings/admin.php
index 9d631bbf98c..cf37726189b 100755
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -19,6 +19,7 @@ $htaccessworking=OC_Util::isHtaccessWorking();
$entries=OC_Log_Owncloud::getEntries(3);
$entriesremain = count(OC_Log_Owncloud::getEntries(4)) > 3;
+$config = \OC::$server->getConfig();
// Should we display sendmail as an option?
$tmpl->assign('sendmail_is_available', (bool) findBinaryPath('sendmail'));
@@ -71,14 +72,16 @@ $tmpl->assign('groups', $groups);
// Check if connected using HTTPS
-if (OC_Request::serverProtocol() === 'https') {
- $connectedHTTPS = true;
-} else {
- $connectedHTTPS = false;
-}
-$tmpl->assign('isConnectedViaHTTPS', $connectedHTTPS);
+$tmpl->assign('isConnectedViaHTTPS', OC_Request::serverProtocol() === 'https');
$tmpl->assign('enforceHTTPSEnabled', OC_Config::getValue( "forcessl", false));
+// If the current webroot is non-empty but the webroot from the config is,
+// and system cron is used, the URL generator fails to build valid URLs.
+$shouldSuggestOverwriteWebroot = $config->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'cron' &&
+ \OC::$WEBROOT && \OC::$WEBROOT !== '/' &&
+ !$config->getSystemValue('overwritewebroot', '');
+$tmpl->assign('suggestedOverwriteWebroot', ($shouldSuggestOverwriteWebroot) ? \OC::$WEBROOT : '');
+
$tmpl->assign('allowLinks', OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
$tmpl->assign('enforceLinkPassword', \OCP\Util::isPublicLinkPasswordRequired());
$tmpl->assign('allowPublicUpload', OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'));