Commit 9601ef2c authored by Timo Benk's avatar Timo Benk
Browse files

feature endorse password for share links

works like "enforce password protection", but let the
user optionally remove the password protection after the
password is set.
parent 9ebf8c09
......@@ -64,6 +64,9 @@ $outgoingServer2serverShareEnabled = $config->getAppValue('files_sharing', 'outg
$countOfDataLocation = 0;
$value = $config->getAppValue('core', 'shareapi_endorse_links_password', 'no');
$endorsePasswordForPublicLink = ($value === 'yes') ? true :false;
$dataLocation = str_replace(OC::$SERVERROOT .'/', '', $config->getSystemValue('datadirectory', ''), $countOfDataLocation);
if($countOfDataLocation !== 1 || !OC_User::isAdminUser(OC_User::getUser())){
$dataLocation = false;
......@@ -159,6 +162,7 @@ $array = [
'defaultExpireDate' => $defaultExpireDate,
'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
'endorsePasswordForPublicLink' => $endorsePasswordForPublicLink,
'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
'resharingAllowed' => \OCP\Share::isResharingAllowed(),
'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
......
......@@ -22,6 +22,7 @@
defaults: {
publicUploadEnabled: false,
enforcePasswordForPublicLink: oc_appconfig.core.enforcePasswordForPublicLink,
endorsePasswordForPublicLink: oc_appconfig.core.endorsePasswordForPublicLink,
isDefaultExpireDateEnforced: oc_appconfig.core.defaultExpireDateEnforced === true,
isDefaultExpireDateEnabled: oc_appconfig.core.defaultExpireDateEnabled === true,
isRemoteShareAllowed: oc_appconfig.core.remoteShareAllowed,
......
......@@ -157,7 +157,7 @@
}
if($checkBox.is(':checked')) {
if(this.configModel.get('enforcePasswordForPublicLink') === false) {
if(this.configModel.get('enforcePasswordForPublicLink') === false && this.configModel.get('endorsePasswordForPublicLink') === false) {
$loading.removeClass('hidden');
// this will create it
this.model.saveLinkShare();
......
......@@ -134,6 +134,7 @@ $template->assign('suggestedOverwriteCliUrl', $suggestedOverwriteCliUrl);
$template->assign('allowLinks', $appConfig->getValue('core', 'shareapi_allow_links', 'yes'));
$template->assign('enforceLinkPassword', \OCP\Util::isPublicLinkPasswordRequired());
$template->assign('endorseLinkPassword', $appConfig->getValue('core', 'shareapi_endorse_links_password', 'no'));
$template->assign('allowPublicUpload', $appConfig->getValue('core', 'shareapi_allow_public_upload', 'yes'));
$template->assign('allowResharing', $appConfig->getValue('core', 'shareapi_allow_resharing', 'yes'));
$template->assign('allowPublicMailNotification', $appConfig->getValue('core', 'shareapi_allow_public_notification', 'no'));
......
......@@ -221,6 +221,10 @@ if ($_['cronErrors']) {
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_endorse_links_password" id="endorseLinkPassword" class="checkbox"
value="1" <?php if ($_['endorseLinkPassword'] === 'yes') print_unescaped('checked="checked"'); ?> />
<label for="endorseLinkPassword"><?php p($l->t('Endorse password protection'));?></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/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment