You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'" onclick="return submitDeleteRecord(this)"><span style="color: #ff0000;" class="bi bi-trash" title="Delete together with associated PTR record (if any exist)"></span></a>';
296
+
'" data-ptr="true" onclick="return submitDeleteRecord(this)"><span style="color: #ff0000;" class="bi bi-trash" title="Delete together with associated PTR record (if any exist)"></span></a>';
if (isset($_POST["ptr"]) && $_POST["ptr"] == true)
38
49
{
39
-
Debug('PTR record deletion was requested for ' . $record);
40
-
if (!isset($_POST['key']) || !isset($_POST['value']) || !isset($_POST['type']))
41
-
{
42
-
Warning('PTR record was not removed because either key, value or type was not specified');
43
-
return;
44
-
}
45
-
$key = $_POST['key'];
46
-
$type = $_POST['type'];
47
-
$value = $_POST['value'];
48
-
if ($type != 'A')
49
-
{
50
-
Warning('Requested PTR record was not deleted: PTR record can be only deleted when you are changing A record, you deleted ' . $type . ' record instead');
51
-
} else
50
+
foreach ($recordsas$record)
52
51
{
53
-
DNS_DeletePTRForARecord($value, $key, '');
52
+
$parts = preg_split('/\s+/', trim($record), 4);
53
+
if (count($parts) < 4)
54
+
{
55
+
Warning('PTR record was not removed because record details were incomplete');
56
+
continue;
57
+
}
58
+
if ($parts[2] != 'A')
59
+
{
60
+
Debug('Not deleting PTR for non-A record: ' . $record);
@@ -116,5 +122,8 @@ public static function GetContents($fc)
116
122
$fc->AppendHtml('<div class="hidden_types">This zone contains record types that are hidden by default, click <a href="?action=manage&domain=' . $g_selected_domain . '&hidden_types=hide">here</a> to hide them</div>');
117
123
}
118
124
$fc->AppendObject($record_list);
125
+
if (Zones::IsEditable($g_selected_domain) && IsAuthorizedToWrite($g_selected_domain))
'<button type="button" class="btn btn-sm btn-danger" onclick="return submitSelectedRecords(true)">Delete selected records and their PTR records</button></div>');
0 commit comments