new: domain administration

This commit is contained in:
Tower committed 2026-03-09 22:23:46 +01:00
1 parent fc665213b3
commit e58bfb6bb1
2 files changed
+119

No files matched your search

+7
View File
@@ -56,6 +56,7 @@ $serviceGroups = array (
0 => 'api_tester',
1 => 'weather_chart',
2 => 'tabellen',
3 => 'domains',
),
),
);
@@ -163,6 +164,12 @@ $services = array (
'active' => true,
'adminOnly' => false,
),
'domains' =>
array (
'name' => 'Domains',
'active' => true,
'adminOnly' => false,
),
);
$linkGroups = array (
+112
View File
@@ -0,0 +1,112 @@
<?php
$statusMsg = "";
/* =========================
Neue Domain hinzufügen
========================= */
if (isset($_POST["add_domain"])) {
$subdomain = trim($_POST["subdomain"]);
if ($subdomain != "") {
DatabaseInsert("Domains", "SUBDOMAIN", $subdomain);
$statusMsg = "Domain wurde hinzugefügt.";
}
}
/* =========================
Domain löschen
========================= */
if (isset($_POST["delete_domain"])) {
$id = intval($_POST["id"]);
DatabaseDelete("Domains", "ID = ?", $id);
$statusMsg = "Domain wurde gelöscht.";
}
/* =========================
Domain bearbeiten
========================= */
if (isset($_POST["save_domain"])) {
$id = intval($_POST["id"]);
$subdomain = trim($_POST["subdomain"]);
DatabaseUpdate("Domains", "SUBDOMAIN = ?", "ID = ?", $subdomain, $id);
$statusMsg = "Domain wurde gespeichert.";
}
/* =========================
Domains laden
========================= */
$domains = DatabaseShow("Domains", "*");
?>
<h2>
Domain Verwaltung
</h2>
<?php if ($statusMsg): ?>
<div class="status-msg">
<?= htmlspecialchars($statusMsg) ?>
</div>
<?php endif; ?>
<div class="admin-grid">
<?php foreach ($domains as $domain): ?>
<form method="post" class="admin-card">
<input type="hidden" name="id" value="<?= $domain["ID"] ?>">
<label>Subdomain</label>
<input type="text" name="subdomain" value="<?= htmlspecialchars($domain["SUBDOMAIN"]) ?>">
<div style="margin-top:10px; display:flex; gap:10px;">
<button type="submit" name="save_domain" class="btn-save">
Speichern
</button>
<button type="submit" name="delete_domain" class="btn-delete">
Löschen
</button>
</div>
</form>
<?php endforeach; ?>
<!-- Neue Domain -->
<form method="post" class="admin-card new-item">
<h3>Neu</h3>
<label>Subdomain</label>
<input type="text" name="subdomain" placeholder="z.B. kleinerpenis.blackpi.ipv64.net">
<button type="submit" name="add_domain" class="btn-add">
Domain hinzufügen
</button>
</form>
</div>