-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathmanual_records.cgi
executable file
·38 lines (32 loc) · 1.27 KB
/
manual_records.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/local/bin/perl
# Show a form for manually editing DNS records
require './virtual-server-lib.pl';
&require_bind();
&ReadParse();
&error_setup($text{'mrecords_err'});
$d = &get_domain($in{'dom'});
$d || &error($text{'edit_egone'});
&can_edit_domain($d) || &error($text{'edit_ecannot'});
&can_manual_dns() || &error($text{'mrecords_ecannot'});
©_alias_records($d) && &error($text{'records_ecannot2'});
# Get the zone and records
($recs, $file) = &get_domain_dns_records_and_file($d);
$file || &error($recs);
$file = &bind8::make_chroot($file);
$data = &read_file_contents($file);
&ui_print_header(&domain_in($d), $text{'mrecords_title'}, "");
# Show editing form
print $text{'mrecords_desc'},"<p>\n";
print &ui_form_start("manual_records_save.cgi", "post");
print &ui_hidden("dom", $in{'dom'});
print &ui_hidden("show", $in{'show'});
print &ui_table_start(undef, "width=100%", 2);
print &ui_table_row(undef, &ui_textarea("data", $data, 30, 80, "off",
0, "style='width:100%'"), 2);
print &ui_table_row(undef,
&ui_checkbox("validate", 1, $text{'mrecords_validate'}, 1));
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("list_records.cgi?dom=$in{'dom'}", $text{'records_return'},
&domain_footer_link($d),
"", $text{'index_return'});