[Pkg-owncloud-commits] [owncloud] 231/457: Adding information on file locking status to admin section

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:13 UTC 2015


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

taffit pushed a commit to branch stable8
in repository owncloud.

commit 43772e2a9a4b1400e7e3a8874130ac817aa64058
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Fri May 29 11:54:05 2015 +0200

    Adding information on file locking status to admin section
---
 settings/admin.php           |  8 ++++++++
 settings/templates/admin.php | 37 +++++++++++++++++++++++++------------
 2 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/settings/admin.php b/settings/admin.php
index 5720bd9..f2e01ad 100644
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -29,6 +29,8 @@
  *
  */
 
+use OC\Lock\NoopLockingProvider;
+
 OC_Util::checkAdminUser();
 OC_App::setActiveNavigationEntry("admin");
 
@@ -175,6 +177,11 @@ $template->assign('fileSharingSettings', $fileSharingSettings);
 $template->assign('filesExternal', $filesExternal);
 $template->assign('updaterAppPanel', $updaterAppPanel);
 $template->assign('ocDefaultEncryptionModulePanel', $ocDefaultEncryptionModulePanel);
+if (\OC::$server->getLockingProvider() instanceof NoopLockingProvider) {
+	$template->assign('fileLockingEnabled', false);
+} else {
+	$template->assign('fileLockingEnabled', true);
+}
 
 $formsMap = array_map(function ($form) {
 	if (preg_match('%(<h2[^>]*>.*?</h2>)%i', $form, $regs)) {
@@ -200,6 +207,7 @@ $formsAndMore = array_merge($formsAndMore, $formsMap);
 $formsAndMore[] = ['anchor' => 'backgroundjobs', 'section-name' => $l->t('Cron')];
 $formsAndMore[] = ['anchor' => 'mail_general_settings', 'section-name' => $l->t('Email server')];
 $formsAndMore[] = ['anchor' => 'log-section', 'section-name' => $l->t('Log')];
+$formsAndMore[] = ['anchor' => 'server-status', 'section-name' => $l->t('Server Status')];
 $formsAndMore[] = ['anchor' => 'admin-tips', 'section-name' => $l->t('Tips & tricks')];
 if ($updaterAppPanel) {
 	$formsAndMore[] = ['anchor' => 'updater', 'section-name' => $l->t('Updates')];
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index f9a99b5..3d253d4 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -7,6 +7,7 @@
 /**
  * @var array $_
  * @var \OCP\IL10N $l
+ * @var OC_Defaults $theme
  */
 
 style('settings', 'settings');
@@ -15,32 +16,32 @@ script('core', ['multiselect', 'setupchecks']);
 vendor_script('select2/select2');
 vendor_style('select2/select2');
 
-$levels = array('Debug', 'Info', 'Warning', 'Error', 'Fatal');
-$levelLabels = array(
+$levels = ['Debug', 'Info', 'Warning', 'Error', 'Fatal'];
+$levelLabels = [
 	$l->t( 'Everything (fatal issues, errors, warnings, info, debug)' ),
 	$l->t( 'Info, warnings, errors and fatal issues' ),
 	$l->t( 'Warnings, errors and fatal issues' ),
 	$l->t( 'Errors and fatal issues' ),
 	$l->t( 'Fatal issues only' ),
-);
+];
 
-$mail_smtpauthtype = array(
+$mail_smtpauthtype = [
 	''	=> $l->t('None'),
 	'LOGIN'	=> $l->t('Login'),
 	'PLAIN'	=> $l->t('Plain'),
 	'NTLM'	=> $l->t('NT LAN Manager'),
-);
+];
 
-$mail_smtpsecure = array(
+$mail_smtpsecure = [
 	''		=> $l->t('None'),
 	'ssl'	=> $l->t('SSL'),
 	'tls'	=> $l->t('TLS'),
-);
+];
 
-$mail_smtpmode = array(
+$mail_smtpmode = [
 	'php',
 	'smtp',
-);
+];
 if ($_['sendmail_is_available']) {
 	$mail_smtpmode[] = 'sendmail';
 }
@@ -137,7 +138,7 @@ if (!$_['isLocaleWorking']) {
 		?>
 			<br>
 			<?php
-			p($l->t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', array($locales)));
+			p($l->t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales]));
 			?>
 	</li>
 <?php
@@ -266,12 +267,12 @@ if ($_['cronErrors']) {
 			if (time() - $_['lastcron'] <= 3600): ?>
 				<span class="cronstatus success"></span>
 				<span class="crondate" original-title="<?php p($absolute_time);?>">
-					<?php p($l->t("Last cron job execution: %s.", array($relative_time)));?>
+					<?php p($l->t("Last cron job execution: %s.", [$relative_time]));?>
 				</span>
 			<?php else: ?>
 				<span class="cronstatus error"></span>
 				<span class="crondate" original-title="<?php p($absolute_time);?>">
-					<?php p($l->t("Last cron job execution: %s. Something seems wrong.", array($relative_time)));?>
+					<?php p($l->t("Last cron job execution: %s. Something seems wrong.", [$relative_time]));?>
 				</span>
 			<?php endif;
 		else: ?>
@@ -527,6 +528,18 @@ if ($_['cronErrors']) {
 		<li><a target="_blank" href="<?php p(link_to_docs('admin-security')); ?>"><?php p($l->t('Hardening and security guidance'));?> ↗</a></li>
 	</ul>
 </div>
+<div class="section" id="server-status">
+	<h2><?php p($l->t('Server Status'));?></h2>
+	<ul>
+		<li>
+			<?php if ($_['fileLockingEnabled']) {
+				p($l->t('Experimental File Lock is enabled.'));
+			} else {
+				p($l->t('Experimental File Lock is disabled.'));
+			} ?>
+		</li>
+	</ul>
+</div>
 
 <div class="section">
 	<h2><?php p($l->t('Version'));?></h2>

-- 
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