settings-admin.php 1.8 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('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 trusted server')); ?></button>
  18. <input id="serverUrl" class="hidden" type="text" value="" placeholder="<?php p($l->t('Trusted server')); ?>" name="server_url"/>
  19. <button id="ocFederationSubmit" class="hidden"><?php p($l->t('Add')); ?></button>
  20. <span class="msg"></span>
  21. </p>
  22. <ul id="listOfTrustedServers">
  23. <?php foreach($_['trustedServers'] as $trustedServer) { ?>
  24. <li id="<?php p($trustedServer['id']); ?>">
  25. <?php if((int)$trustedServer['status'] === TrustedServers::STATUS_OK) { ?>
  26. <span class="status success"></span>
  27. <?php
  28. } elseif(
  29. (int)$trustedServer['status'] === TrustedServers::STATUS_PENDING ||
  30. (int)$trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED
  31. ) { ?>
  32. <span class="status indeterminate"></span>
  33. <?php } else {?>
  34. <span class="status error"></span>
  35. <?php } ?>
  36. <?php p($trustedServer['url']); ?>
  37. <span class="icon icon-delete"></span>
  38. </li>
  39. <?php } ?>
  40. </ul>
  41. </div>