[Pkg-owncloud-commits] [owncloud] 86/121: Add a note about overwritewebroot when using system cron

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 86009a564e45553efef23444c435d20235095463
Author: Joas Schilling <nickvergessen at gmx.de>
Date:   Mon Aug 18 09:40:42 2014 +0200

    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
---
 settings/admin.php           | 15 +++++++++------
 settings/templates/admin.php | 19 ++++++++++++++++++-
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/settings/admin.php b/settings/admin.php
index dd5f969..a9f90ac 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'));
@@ -70,14 +71,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'));
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index 03f3efd..5426e10 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -1,8 +1,12 @@
-<?php /**
+<?php
+/**
  * Copyright (c) 2011, Robin Appelman <icewind1991 at gmail.com>
  * This file is licensed under the Affero General Public License version 3 or later.
  * See the COPYING-README file.
  */
+/**
+ * @var array $_
+ */
 $levels = array('Debug', 'Info', 'Warning', 'Error', 'Fatal');
 $levelLabels = array(
 	$l->t( 'Everything (fatal issues, errors, warnings, info, debug)' ),
@@ -178,6 +182,19 @@ if (!$_['internetconnectionworking']) {
 </div>
 <?php
 }
+
+if ($_['suggestedOverwriteWebroot']) {
+	?>
+	<div class="section">
+		<h2><?php p($l->t('URL generation in notification emails'));?></h2>
+
+		<span class="connectionwarning">
+		<?php p($l->t('If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the "overwritewebroot" option in your config.php file to the webroot path of your installation (Suggested: "%s")', $_['suggestedOverwriteWebroot'])); ?>
+	</span>
+
+	</div>
+<?php
+}
 ?>
 
 <?php foreach ($_['forms'] as $form) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list