settings-admin.php 1.8 KB

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