list_key.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!-- Begin toolbar -->
  2. <div class="toolbar">
  3. <div class="toolbar-inner">
  4. <div class="toolbar-buttons">
  5. <a class="button button-secondary button-back js-button-back" href="/edit/user/?token=<?= $_SESSION["token"] ?>">
  6. <i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
  7. </a>
  8. <?php if ($_SESSION["userContext"] === "admin" && isset($_GET["user"]) && $_GET["user"] !== "admin") { ?>
  9. <a href="/add/key/?user=<?= htmlentities($_GET["user"]) ?>" class="button button-secondary js-button-create">
  10. <i class="fas fa-circle-plus icon-green"></i><?= _("Add SSH Key") ?>
  11. </a>
  12. <?php } else { ?>
  13. <a href="/add/key/" class="button button-secondary js-button-create">
  14. <i class="fas fa-circle-plus icon-green"></i><?= _("Add SSH Key") ?>
  15. </a>
  16. <?php } ?>
  17. </div>
  18. </div>
  19. </div>
  20. <!-- End toolbar -->
  21. <div class="container">
  22. <h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("SSH Keys") ?></h1>
  23. <div class="units-table js-units-container">
  24. <div class="units-table-header">
  25. <div class="units-table-cell"><?= _("SSH ID") ?></div>
  26. <div class="units-table-cell"></div>
  27. <div class="units-table-cell"><?= _("SSH Key") ?></div>
  28. </div>
  29. <!-- Begin SSH key list item loop -->
  30. <?php
  31. $i = 0;
  32. foreach ($data as $key => $value) {
  33. ++$i;
  34. ?>
  35. <div class="units-table-row animate__animated animate__fadeIn js-unit" style="<?php if ($data[$key]['ID'] === 'filemanager.ssh.key') { echo 'display: none;'; } ?>">
  36. <div class="units-table-cell units-table-heading-cell u-text-bold">
  37. <span class="u-hide-desktop"><?= _("SSH ID") ?>:</span>
  38. <span class="u-text-break">
  39. <?= htmlspecialchars($data[$key]["ID"]) ?>
  40. </span>
  41. </div>
  42. <div class="units-table-cell">
  43. <ul class="units-table-row-actions">
  44. <li class="units-table-row-action shortcut-delete" data-key-action="js">
  45. <a
  46. class="units-table-row-action-link data-controls js-confirm-action"
  47. <?php if ($_SESSION["userContext"] === "admin" && isset($_GET["user"]) && $_GET["user"] !== "admin") { ?>
  48. href="/delete/key/?user=<?= htmlentities($_GET["user"]) ?>&key=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
  49. <?php } else { ?>
  50. href="/delete/key/?key=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
  51. <?php } ?>
  52. title="<?= _("Delete") ?>"
  53. data-confirm-title="<?= _("Delete") ?>"
  54. data-confirm-message="<?= sprintf(_("Are you sure you want to delete SSH key %s?"), $key) ?>"
  55. >
  56. <i class="fas fa-trash icon-red"></i>
  57. <span class="u-hide-desktop"><?= _("Delete") ?></span>
  58. </a>
  59. </li>
  60. </ul>
  61. </div>
  62. <div class="units-table-cell u-text-bold">
  63. <span class="u-hide-desktop"><?= _("SSH Key") ?>:</span>
  64. <span class="u-text-break">
  65. <?= htmlspecialchars($data[$key]["KEY"], ENT_QUOTES) ?>
  66. </span>
  67. </div>
  68. </div>
  69. <?php } ?>
  70. </div>
  71. </div>
  72. <footer class="app-footer">
  73. <div class="container app-footer-inner">
  74. <p>
  75. <?php printf(ngettext("%d SSH key", "%d SSH keys", $i), $i); ?>
  76. </p>
  77. </div>
  78. </footer>