print.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php declare(strict_types=1); ?>
  2. <form method="post">
  3. <input type="radio" name="print" id="table" value="table" checked="">
  4. <label for="table"><?= _('Records table') ?></label>
  5. <br>
  6. <input type="radio" name="print" id="ds" value="ds">
  7. <label for="ds"><?= _('DS record') ?></label>
  8. <br>
  9. <input type="radio" name="print" id="raw" value="raw">
  10. <label for="raw"><?= _('Raw zonefile') ?></label>
  11. <br>
  12. <label for="zone"><?= _('Selected zone') ?></label>
  13. <select required="" name="zone" id="zone">
  14. <option value="" disabled="" selected="">-</option>
  15. <?php
  16. foreach (nsListUserZones() as $zone)
  17. echo ' <option value="' . $zone . '">' . $zone . '</option>' . LF;
  18. ?>
  19. </select>
  20. <br>
  21. <input type="submit" value="<?= _('Display') ?>">
  22. </form>
  23. <?php
  24. if (isset($data['zone-raw']))
  25. echo '<pre>' . htmlspecialchars($data['zone-raw']) . '</pre>';
  26. if (isset($data['zone-table'])) { ?>
  27. <table class="zone">
  28. <tr>
  29. <th><?= _('Domain') ?></th>
  30. <th><?= _('TTL') ?></th>
  31. <th><?= _('Type') ?></th>
  32. <th><?= _('Value') ?></th>
  33. </tr>
  34. <?php
  35. foreach ($data['zone-table'] as $zone_line) {
  36. echo ' <tr>' . LF;
  37. foreach ($zone_line as $element)
  38. echo ' <td><code>' . htmlspecialchars($element) . '</code></td>' . LF;
  39. echo ' </tr>' . LF;
  40. }
  41. }
  42. ?>
  43. </table>
  44. <?php
  45. if (isset($data['zone-ds'])) { ?>
  46. <dl>
  47. <dt><?= _('Zone') ?></dt>
  48. <dd>
  49. <code><?= $_POST['zone'] ?></code>
  50. </dd>
  51. <dt><?= _('Tag') ?></dt>
  52. <dd>
  53. <code><?= $data['zone-ds']['tag'] ?></code>
  54. </dd>
  55. <dt><?= _('Algorithm') ?></dt>
  56. <dd>
  57. <code><?= $data['zone-ds']['algo'] ?></code><?= ($data['zone-ds']['algo'] === '15') ? ' (Ed25519)' : '' ?>
  58. </dd>
  59. <dt><?= _('Digest type') ?></dt>
  60. <dd>
  61. <code><?= $data['zone-ds']['digest_type'] ?></code><?= ($data['zone-ds']['digest_type'] === '2') ? ' (SHA-256)' : '' ?>
  62. </dd>
  63. <dt><?= _('Digest') ?></dt>
  64. <dd>
  65. <code><?= $data['zone-ds']['digest'] ?></code>
  66. </dd>
  67. </dl>
  68. <?php
  69. }