settings-admin.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2015-2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. /** @var array $_ */
  8. use OCA\Federation\TrustedServers;
  9. /** @var \OCP\IL10N $l */
  10. script('federation', 'settings-admin');
  11. style('federation', 'settings-admin')
  12. ?>
  13. <div id="ocFederationSettings" class="section">
  14. <h2><?php p($l->t('Trusted servers')); ?></h2>
  15. <p class="settings-hint"><?php p($l->t('Federation allows you to connect with other trusted servers to exchange the account directory. For example this will be used to auto-complete external accounts for federated sharing. It is not necessary to add a server as trusted server in order to create a federated share.')); ?></p>
  16. <ul id="listOfTrustedServers">
  17. <?php foreach ($_['trustedServers'] as $trustedServer) { ?>
  18. <li id="<?php p($trustedServer['id']); ?>">
  19. <?php if ((int)$trustedServer['status'] === TrustedServers::STATUS_OK) { ?>
  20. <span class="status success"></span>
  21. <?php
  22. } elseif (
  23. (int)$trustedServer['status'] === TrustedServers::STATUS_PENDING ||
  24. (int)$trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED
  25. ) { ?>
  26. <span class="status indeterminate"></span>
  27. <?php } else {?>
  28. <span class="status error"></span>
  29. <?php } ?>
  30. <?php p($trustedServer['url']); ?>
  31. <span class="icon icon-delete"></span>
  32. </li>
  33. <?php } ?>
  34. </ul>
  35. <p id="ocFederationAddServer">
  36. <button id="ocFederationAddServerButton" class=""><?php p($l->t('+ Add trusted server')); ?></button>
  37. <div class="serverUrl hidden">
  38. <div class="serverUrl-block">
  39. <label for="serverUrl"><?php p($l->t('Trusted server')); ?></label>
  40. <input id="serverUrl" type="text" value="" placeholder="<?php p($l->t('Trusted server')); ?>" name="server_url"/>
  41. <button id="ocFederationSubmit" class="hidden"><?php p($l->t('Add')); ?></button>
  42. </div>
  43. <span class="msg"></span>
  44. </div>
  45. </p>
  46. </div>