2022-05-22 14:59:45 +02:00
|
|
|
<?php require "../../common/html.php"; ?>
|
2022-06-11 23:50:14 +02:00
|
|
|
|
2021-02-16 19:20:19 +01:00
|
|
|
<p>
|
2022-06-11 23:50:14 +02:00
|
|
|
Retirer un accès Onion d'un dossier
|
2021-02-16 19:20:19 +01:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<form method="post">
|
2022-04-18 16:05:00 +02:00
|
|
|
<label for="dir">Dossier ciblé</label><br>
|
|
|
|
<select required="" name="dir" id="dir">
|
|
|
|
<option value="" disabled="" selected="">---</option>
|
|
|
|
|
2022-05-21 02:15:36 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if (isset($_SESSION['username'])) {
|
|
|
|
$dirsStatuses = dirsStatuses($_SESSION['username'], "onion", "http");
|
|
|
|
|
|
|
|
foreach ($dirsStatuses as $dir => $alreadyEnabled) {
|
2022-06-11 23:42:48 +02:00
|
|
|
$disabled = $alreadyEnabled ? "" : "disabled='' ";
|
|
|
|
echo " <option " . $disabled . "value='" . $dir . "'>" . $dir . "</option>\n";
|
2022-05-21 02:15:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2022-04-18 16:05:00 +02:00
|
|
|
</select>
|
|
|
|
<br>
|
|
|
|
<input value="Valider" type="submit">
|
2021-02-16 19:20:19 +01:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
2022-05-31 17:31:48 +02:00
|
|
|
switchToFormProcess();
|
2021-02-16 19:20:19 +01:00
|
|
|
|
2022-06-11 23:42:48 +02:00
|
|
|
if ($dirsStatuses[$_POST['dir']] !== true)
|
2022-05-31 17:31:48 +02:00
|
|
|
userError("Wrong value for <code>dir</code>.");
|
2021-02-16 19:20:19 +01:00
|
|
|
|
2022-06-18 04:22:05 +02:00
|
|
|
htDeleteSite($_POST['dir'], domainType: 'onion', protocol: 'http');
|
2022-05-31 17:31:48 +02:00
|
|
|
|
2022-06-18 04:22:05 +02:00
|
|
|
success("Accès retiré.");
|