From f49539ad96e908c709bff333dc628f586e9348ce Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Wed, 21 Jun 2023 16:48:51 -0700 Subject: [PATCH] Add a warning about editing Virtualmin-controlled domains --- bind8/edit_master.cgi | 8 ++++++++ bind8/lang/en | 2 ++ 2 files changed, 10 insertions(+) diff --git a/bind8/edit_master.cgi b/bind8/edit_master.cgi index 4f6aba0e3..942110ad7 100755 --- a/bind8/edit_master.cgi +++ b/bind8/edit_master.cgi @@ -17,6 +17,14 @@ my $dom = $zone->{'name'}; &ui_print_header(&zone_subhead($zone), $text{'master_title'}, "", undef, undef, undef, undef, &restart_links($zone)); +my $d = &get_virtualmin_domains($dom); +if ($d && $d->{'alias'}) { + print &ui_alert_box($text{'master_vminalias'}, 'danger'); + } +elsif ($d) { + print &ui_alert_box($text{'master_vmin'}, 'warn'); + } + # Find the record types my (@rcodes, @recs); if (!$config{'largezones'}) { diff --git a/bind8/lang/en b/bind8/lang/en index c356e93b3..1d44a95cd 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -147,6 +147,8 @@ master_defttl=Default time-to-live for records master_edefttl='$1' is not a valid default time-to-live for records master_esoagone=No SOA record found! master_einclude=Additional template file does not exist +master_vmin=WARNING! This zone is managed by Virtualmin. Records should be edited using the Virtualmin UI, to ensure they are consistent with other virtual server settings. +master_vminalias=DANGER! This zone is an alias of a Virtualmin domain, which is kept in sync with it's target. Records should never be edited here, as any changes will be overwritten! delete_title=Delete Zone delete_mesg=Are you sure you want to delete the zone $1 ? All records and the zone file will be deleted.