settings-admin.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /** @var array $_ */
  3. use OCA\Federation\TrustedServers;
  4. /** @var OC_L10N $l */
  5. script('federation', 'settings-admin');
  6. style('federation', 'settings-admin')
  7. ?>
  8. <div id="ocFederationSettings" class="section">
  9. <h2><?php p($l->t('Federation')); ?></h2>
  10. <em><?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.')); ?></em>
  11. <p>
  12. <input id="autoAddServers" type="checkbox" class="checkbox" <?php if($_['autoAddServers']) p('checked'); ?> />
  13. <label for="autoAddServers"><?php p($l->t('Add server automatically once a federated share was created successfully')); ?></label>
  14. </p>
  15. <h3><?php p($l->t('Trusted Servers')); ?></h3>
  16. <p id="ocFederationAddServer">
  17. <button id="ocFederationAddServerButton" class=""><?php p($l->t('+ Add Nextcloud server')); ?></button>
  18. <input id="serverUrl" class="hidden" type="text" value="" placeholder="<?php p($l->t('Nextcloud Server')); ?>" name="server_url"/>
  19. <span class="msg"></span>
  20. </p>
  21. <ul id="listOfTrustedServers">
  22. <?php foreach($_['trustedServers'] as $trustedServer) { ?>
  23. <li id="<?php p($trustedServer['id']); ?>">
  24. <?php if((int)$trustedServer['status'] === TrustedServers::STATUS_OK) { ?>
  25. <span class="status success"></span>
  26. <?php
  27. } elseif(
  28. (int)$trustedServer['status'] === TrustedServers::STATUS_PENDING ||
  29. (int)$trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED
  30. ) { ?>
  31. <span class="status indeterminate"></span>
  32. <?php } else {?>
  33. <span class="status error"></span>
  34. <?php } ?>
  35. <?php p($trustedServer['url']); ?>
  36. <span class="icon icon-delete"></span>
  37. </li>
  38. <?php } ?>
  39. </ul>
  40. </div>