12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <form method="post">
- <label for="domain">Domaine</label>
- <select required="" name="domain" id="domain">
- <option value="" disabled="" selected="">-</option>
- <?php
- if (isset($_SESSION['username']))
- foreach (regListUserDomains($_SESSION['username']) as $domain)
- echo ' <option value="' . $domain . '">' . $domain . '</option>' . LF;
- ?>
- </select>
- <br>
- <input value="Afficher" type="submit">
- </form>
- <?php
- if (processForm()) {
- regCheckDomainPossession($_POST['domain']);
- $zoneContent = file_get_contents(CONF['reg']['registry_file']);
- if ($zoneContent === false)
- output(500, 'Unable to read registry file.');
- ?>
- <table>
- <tr>
- <th>Domaine</th>
- <th>TTL</th>
- <th>Type</th>
- <th>Contenu</th>
- </tr>
- <?php
- foreach(explode(LF, $zoneContent) as $zoneLine) {
- if (str_starts_with($zoneLine, ';')) continue; // Ignore comments
- if (empty($zoneLine)) continue;
- $elements = preg_split('/[\t ]+/', $zoneLine, 4);
- if (!str_ends_with($elements[0], $_POST['domain'])) continue; // Ignore records for other domains
- if (!in_array($elements[2], ['A', 'AAAA', 'NS', 'DS'], true)) continue; // Ignore records generated by Knot
- echo ' <tr>' . LF;
- foreach ($elements as $element)
- echo ' <td><code>' . htmlspecialchars($element) . '</code></td>' . LF;
- echo ' </tr>' . LF;
- }
- echo '</table>';
- output(200);
- }
|