From 3fdc034f172e02075289ea8b46b3fda89300fe8a Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 2 Sep 2022 09:50:18 +0200 Subject: [PATCH] minor enhancements in dns-editor Signed-off-by: Michael Kaufmann --- dns_editor.php | 18 ++++++++++++++++-- lib/tablelisting/tablelisting.dns.php | 1 + lng/de.lng.php | 4 +++- lng/en.lng.php | 1 + templates/Froxlor/user/dns-editor.html.twig | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dns_editor.php b/dns_editor.php index 0af4abab..c368cf29 100644 --- a/dns_editor.php +++ b/dns_editor.php @@ -31,6 +31,7 @@ if (!defined('AREA')) { use Froxlor\Api\Commands\DomainZones; use Froxlor\Dns\Dns; use Froxlor\UI\Collection; +use Froxlor\UI\HTML; use Froxlor\UI\Listing; use Froxlor\UI\Panel\UI; use Froxlor\UI\Request; @@ -70,9 +71,22 @@ if ($action == 'add_record' && !empty($_POST)) { $errors = str_replace("\n", "
", $e->getMessage()); } } elseif ($action == 'delete') { - // remove entry $entry_id = isset($_GET['id']) ? (int)$_GET['id'] : 0; - if ($entry_id > 0) { + HTML::askYesNo('dnsentry_reallydelete', $filename, [ + 'id' => $entry_id, + 'domain_id' => $domain_id, + 'page' => $page, + 'action' => 'deletesure' + ], '', [ + 'section' => 'domains', + 'page' => $page, + 'domain_id' => $domain_id + ]); +} elseif ($action == 'deletesure' && !empty($_POST)) { + $entry_id = isset($_POST['id']) ? (int)$_POST['id'] : 0; + $domain_id = isset($_POST['domain_id']) ? (int)$_POST['domain_id'] : 0; + // remove entry + if ($entry_id > 0 && $domain_id > 0) { try { DomainZones::getLocal($userinfo, [ 'entry_id' => $entry_id, diff --git a/lib/tablelisting/tablelisting.dns.php b/lib/tablelisting/tablelisting.dns.php index 9b189560..da90bcf0 100644 --- a/lib/tablelisting/tablelisting.dns.php +++ b/lib/tablelisting/tablelisting.dns.php @@ -30,6 +30,7 @@ use Froxlor\UI\Listing; return [ 'dns_list' => [ 'title' => 'DNS Entries', + 'description' => $domain, 'icon' => 'fa-solid fa-globe', 'self_overview' => ['section' => 'domains', 'page' => 'domaindnseditor'], 'columns' => [ diff --git a/lng/de.lng.php b/lng/de.lng.php index 8cab6150..dba89ddb 100644 --- a/lng/de.lng.php +++ b/lng/de.lng.php @@ -1249,7 +1249,9 @@ Vielen Dank, Ihr Administrator', 'remove_subbutmain_domains' => 'Auch Domains entfernen, welche als volle Domains hinzugefügt wurden, aber Subdomains von dieser Domain sind?', 'customer_reallyunlock' => 'Wollen Sie den Kunden "%s" wirklich entsperren?', 'admin_integritycheck_reallyfix' => 'Möchten Sie wirklich versuchen sämtliche Datenbank-Integritätsprobleme automatisch zu beheben?', - 'plan_reallydelete' => 'Wollen Sie den Api-Key wirklich löschen?', + 'plan_reallydelete' => 'Wollen Sie den Hostingplan %s wirklich löschen?', + 'apikey_reallydelete' => 'Wollen Sie den Api-Key wirklich löschen?', + 'dnsentry_reallydelete' => 'Wollen Sie den DNS-Eintrag wirklich löschen?', ], 'serversettings' => [ 'session_timeout' => [ diff --git a/lng/en.lng.php b/lng/en.lng.php index 225591cb..425f8298 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -1617,6 +1617,7 @@ Yours sincerely, your administrator', 'admin_integritycheck_reallyfix' => 'Do you really want to try fixing all database integrity problems automatically?', 'plan_reallydelete' => 'Do you really want to delete the hosting plan %s?', 'apikey_reallydelete' => 'Do you really want to delete this api-key?', + 'dnsentry_reallydelete' => 'Do you really want to delete this zone entry?', ], 'redirect_desc' => [ 'rc_default' => 'default', diff --git a/templates/Froxlor/user/dns-editor.html.twig b/templates/Froxlor/user/dns-editor.html.twig index 08f285ff..ec0df31a 100644 --- a/templates/Froxlor/user/dns-editor.html.twig +++ b/templates/Froxlor/user/dns-editor.html.twig @@ -1,7 +1,7 @@ {% extends "Froxlor/user/table.html.twig" %} {% block content %} -
+
{% include 'Froxlor/misc/alertbox.html.twig' %}