settings-admin.php 1.9 KB

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