mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-04 10:13:07 -04:00
29 lines
602 B
PHP
29 lines
602 B
PHP
<?php
|
|
/** @phpstan-var \Gazelle\User $Viewer */
|
|
/** @phpstan-var \Twig\Environment $Twig */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Gazelle;
|
|
|
|
if (!$Viewer->permitted('users_view_ips')) {
|
|
Error403::error();
|
|
}
|
|
|
|
$ssl = new Manager\SSLHost();
|
|
|
|
$remove = array_key_extract_suffix('id-', $_POST);
|
|
if ($remove) {
|
|
authorize();
|
|
$ssl->removeList($remove);
|
|
}
|
|
if (!empty($_POST['hostname']) && !empty($_POST['port'])) {
|
|
authorize();
|
|
$ssl->add(trim($_POST['hostname']), (int)$_POST['port']);
|
|
}
|
|
|
|
echo $Twig->render('admin/ssl_host.twig', [
|
|
'list' => $ssl->list(),
|
|
'viewer' => $Viewer,
|
|
]);
|