sharing.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. /** @var \OCP\IL10N $l */
  24. /** @var array $_ */
  25. ?>
  26. <div class="section" id="shareAPI">
  27. <h2><?php p($l->t('Sharing'));?></h2>
  28. <a target="_blank" rel="noreferrer" class="icon-info"
  29. title="<?php p($l->t('Open documentation'));?>"
  30. href="<?php p(link_to_docs('admin-sharing')); ?>"></a>
  31. <p id="enable">
  32. <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" class="checkbox"
  33. value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> />
  34. <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/>
  35. </p>
  36. <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
  37. <input type="checkbox" name="shareapi_allow_links" id="allowLinks" class="checkbox"
  38. value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> />
  39. <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/>
  40. </p>
  41. <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>">
  42. <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" class="checkbox"
  43. value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> />
  44. <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/>
  45. <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox"
  46. value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> />
  47. <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/>
  48. <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" class="checkbox"
  49. value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> />
  50. <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date'));?></label><br/>
  51. </p>
  52. <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>">
  53. <?php p($l->t( 'Expire after ' )); ?>
  54. <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>"
  55. value='<?php p($_['shareExpireAfterNDays']) ?>' />
  56. <?php p($l->t( 'days' )); ?>
  57. <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" class="checkbox"
  58. value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> />
  59. <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/>
  60. </p>
  61. <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
  62. <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" class="checkbox"
  63. value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> />
  64. <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/>
  65. </p>
  66. <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
  67. <input type="checkbox" name="shareapi_allow_group_sharing" id="allowGroupSharing" class="checkbox"
  68. value="1" <?php if ($_['allowGroupSharing'] === 'yes') print_unescaped('checked="checked"'); ?> />
  69. <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups'));?></label><br />
  70. </p>
  71. <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
  72. <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" class="checkbox"
  73. value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> />
  74. <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/>
  75. </p>
  76. <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
  77. <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" class="checkbox"
  78. value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> />
  79. <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/>
  80. </p>
  81. <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>">
  82. <input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px" class="noJSAutoUpdate"/>
  83. <br />
  84. <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em>
  85. </p>
  86. <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
  87. <input type="checkbox" name="shareapi_allow_share_dialog_user_enumeration" value="1" id="shareapi_allow_share_dialog_user_enumeration" class="checkbox"
  88. <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') print_unescaped('checked="checked"'); ?> />
  89. <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username needs to be entered.'));?></label><br />
  90. </p>
  91. <p>
  92. <input type="checkbox" id="publicShareDisclaimer" class="checkbox noJSAutoUpdate"
  93. <?php if ($_['publicShareDisclaimerText'] !== null) print_unescaped('checked="checked"'); ?> />
  94. <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)'));?></label>
  95. <span id="publicShareDisclaimerStatus" class="msg" style="display:none"></span>
  96. <br/>
  97. <textarea placeholder="<?php p($l->t('This text will be shown on the public link upload page when the file list is hidden.')) ?>" id="publicShareDisclaimerText" <?php if ($_['publicShareDisclaimerText'] === null) { print_unescaped('class="hidden"'); } ?>><?php p($_['publicShareDisclaimerText']) ?></textarea>
  98. </p>
  99. </div>