del.php 868 B

1234567891011121314151617181920
  1. <?php declare(strict_types=1); ?>
  2. <form method="post">
  3. <label for="site"><?= _('Access to delete') ?></label><br>
  4. <select required="" name="site" id="site">
  5. <option value="" disabled="" selected="">—</option>
  6. <?php
  7. foreach (query('select', 'sites', ['username' => $_SESSION['id'] ?? '']) as $site) {
  8. $url = match ($site['type']) {
  9. 'subpath' => 'https://' . CONF['ht']['subpath_domain'] . '/' . $site['address'] . '/',
  10. 'subdomain' => 'https://' . $site['address'] . '.' . CONF['ht']['subdomain_domain'] . '/',
  11. 'onion' => 'http://' . $site['address'] . '/',
  12. 'dns' => 'https://' . $site['address'] . '/',
  13. };
  14. echo ' <option value="' . $site['type'] . ':' . $site['address'] . '">' . ' ' . sprintf(_('%1$s to %2$s'), $url, '/' . $site['site_dir']) . '</option>' . LF;
  15. }
  16. ?>
  17. </select>
  18. <br>
  19. <input type="submit" value="<?= _('Delete access') ?>">
  20. </form>