2022-12-22 00:44:57 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if (preg_match('/^(?<type>subpath|subdomain|onion|dns):(?<address>[a-z0-9._-]{1,256})$/D', $_POST['site'], $site) !== 1)
|
|
|
|
output(403, 'Malformed value for <code>site</code>.');
|
|
|
|
|
|
|
|
if (isset(query('select', 'sites', ['username' => $_SESSION['id'], 'address' => $site['address'], 'type' => $site['type']], 'address')[0]) !== true)
|
|
|
|
output(403, 'Unavailable value for <code>site</code>.');
|
|
|
|
|
|
|
|
htDeleteSite($site['address'], $site['type']);
|
|
|
|
|
2023-01-21 00:27:52 +00:00
|
|
|
output(200, _('Access removed.'));
|