summaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-04-23 20:20:56 +0200
committerRobin Appelman <robin@icewind.nl>2021-05-12 16:11:31 +0200
commit0e6321957df6635d43ad07d7add23b1cea581fc0 (patch)
tree0e0e448f515cd778b6f08e7140abf742a3e11e3a /apps/settings
parentb1dca57a1ce59bacc4089761275e4366e9760313 (diff)
downloadnextcloud-server-0e6321957df6635d43ad07d7add23b1cea581fc0.tar.gz
nextcloud-server-0e6321957df6635d43ad07d7add23b1cea581fc0.zip
allow excluding groups from creating link shares
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/js/admin.js2
-rw-r--r--apps/settings/lib/Settings/Admin/Sharing.php4
-rw-r--r--apps/settings/templates/settings/admin/sharing.php10
3 files changed, 14 insertions, 2 deletions
diff --git a/apps/settings/js/admin.js b/apps/settings/js/admin.js
index 271d13b43d0..f749c9e132c 100644
--- a/apps/settings/js/admin.js
+++ b/apps/settings/js/admin.js
@@ -1,5 +1,5 @@
window.addEventListener('DOMContentLoaded', function(){
- $('#excludedGroups').each(function (index, element) {
+ $('#excludedGroups,#linksExcludedGroups').each(function (index, element) {
OC.Settings.setupGroupsSelect($(element));
$(element).change(function(ev) {
var groups = ev.val || [];
diff --git a/apps/settings/lib/Settings/Admin/Sharing.php b/apps/settings/lib/Settings/Admin/Sharing.php
index 7eb9649a1aa..8d759b4ae85 100644
--- a/apps/settings/lib/Settings/Admin/Sharing.php
+++ b/apps/settings/lib/Settings/Admin/Sharing.php
@@ -64,11 +64,15 @@ class Sharing implements ISettings {
$excludedGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
$excludeGroupsList = !is_null(json_decode($excludedGroups))
? implode('|', json_decode($excludedGroups, true)) : '';
+ $linksExcludedGroups = $this->config->getAppValue('core', 'shareapi_allow_links_exclude_groups', '');
+ $linksExcludeGroupsList = !is_null(json_decode($linksExcludedGroups))
+ ? implode('|', json_decode($linksExcludedGroups, true)) : '';
$parameters = [
// Built-In Sharing
'allowGroupSharing' => $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes'),
'allowLinks' => $this->config->getAppValue('core', 'shareapi_allow_links', 'yes'),
+ 'allowLinksExcludeGroups' => $linksExcludeGroupsList,
'allowPublicUpload' => $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'),
'allowResharing' => $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes'),
'allowShareDialogUserEnumeration' => $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes'),
diff --git a/apps/settings/templates/settings/admin/sharing.php b/apps/settings/templates/settings/admin/sharing.php
index 4bb2ddca7d9..9b562cface6 100644
--- a/apps/settings/templates/settings/admin/sharing.php
+++ b/apps/settings/templates/settings/admin/sharing.php
@@ -138,6 +138,14 @@
<p class="<?php if ($_['shareAPIEnabled'] === 'no') {
p('hidden');
}?>">
+ <p class="indent">
+ <?php p($l->t('Exclude groups from creating link shares:'));?>
+ </p>
+ <p id="selectLinksExcludedGroups" class="indent <?php if ($_['allowLinks'] === 'no') {
+ p('hidden');
+} ?>">
+ <input name="shareapi_allow_links_exclude_groups" type="hidden" id="linksExcludedGroups" value="<?php p($_['allowLinksExcludeGroups']) ?>" style="width: 400px" class="noJSAutoUpdate"/>
+ </p>
<input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" class="checkbox"
value="1" <?php if ($_['allowResharing'] === 'yes') {
print_unescaped('checked="checked"');
@@ -176,7 +184,7 @@
} ?>">
<input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px" class="noJSAutoUpdate"/>
<br />
- <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em>
+ <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em>
</p>
<p class="<?php if ($_['shareAPIEnabled'] === 'no') {