]> source.dussan.org Git - nextcloud-server.git/commitdiff
feature endorse password for share links
authorBjoern Schiessle <bjoern@schiessle.org>
Mon, 27 Mar 2017 13:11:13 +0000 (15:11 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Mon, 3 Apr 2017 08:57:52 +0000 (10:57 +0200)
works like "enforce password protection", but let the
user optionally remove the password protection after the
password is set. by Timo Benk

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
lib/private/Settings/Admin/Sharing.php
lib/private/Template/JSConfigHelper.php
settings/templates/admin/sharing.php

index 9b17efa8028cd79a4029a73c591845777e5cfcfb..8f57f77b20ae9b97ee983d9828768a527c1b1ae2 100644 (file)
@@ -64,6 +64,7 @@ class Sharing implements ISettings {
                        'shareExcludeGroups'              => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false,
                        'shareExcludedGroupsList'         => $excludeGroupsList,
                        'publicShareDisclaimerText'       => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null),
+                       'enableLinkPasswordByDefault'     => $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'),
                ];
 
                return new TemplateResponse('settings', 'admin/sharing', $parameters, '');
index ca45bbee9c62b417c8bec404dc07bbc4839574a5..4fc21680211680f7e02184195637a689514cb91f 100644 (file)
@@ -112,6 +112,9 @@ class JSConfigHelper {
                        $apps_paths[$app] = \OC_App::getAppWebPath($app);
                }
 
+
+               $enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no');
+               $enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false;
                $defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';
                $defaultExpireDate = $enforceDefaultExpireDate = null;
                if ($defaultExpireDateEnabled) {
@@ -217,6 +220,7 @@ class JSConfigHelper {
                                        'defaultExpireDate' => $defaultExpireDate,
                                        'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
                                        'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
+                                       'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault,
                                        'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
                                        'resharingAllowed' => \OCP\Share::isResharingAllowed(),
                                        'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
index db025c8f20561ce6d311c882bd052a9dadad1697..9de71c58990992480823e74bce750e847b67b56a 100644 (file)
@@ -46,7 +46,9 @@
                <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" class="checkbox"
                           value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> />
                <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/>
-
+               <input type="checkbox" name="shareapi_enable_link_password_by_default" id="enableLinkPasswordByDefault" class="checkbox"
+                          value="1" <?php if ($_['enableLinkPasswordByDefault'] === 'yes') print_unescaped('checked="checked"'); ?> />
+               <label for="enableLinkPasswordByDefault"><?php p($l->t('Always ask for a password'));?></label><br/>
                <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox"
                           value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> />
                <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/>