3 # Edit an existing record of some type
5 require './bind8-lib.pl';
7 $zone = &get_zone_name($in{'index'}, $in{'view'});
8 $dom = $zone->{'name'};
9 &can_edit_zone($zone) ||
10 &error($text{'recs_ecannot'});
11 $type = $zone->{'type'};
12 $file = $zone->{'file'};
13 @recs = &read_zone_file($file, $dom);
14 $rec = &find_record_by_id(\@recs, $in{'id'}, $in{'num'});
15 $rec || &error($text{'edit_egone'});
16 &can_edit_type($rec->{'type'}, \%access) ||
17 &error($text{'recs_ecannottype'});
19 $desc = &text('edit_header', &ip6int_to_net(&arpa_to_ip($dom)));
20 &ui_print_header($desc, &text('edit_title', $text{"edit_".$rec->{'type'}} || $rec->{'type'}), "",
21 undef, undef, undef, undef, &restart_links($zone));
23 &record_input($in{'index'}, $in{'view'}, $in{'type'}, $file,
24 $dom, $in{'num'}, $rec);
25 &ui_print_footer("", $text{'index_return'},
26 "edit_$type.cgi?index=$in{'index'}&view=$in{'view'}",
28 "edit_recs.cgi?index=$in{'index'}&type=$in{'type'}",
29 $text{'edit_return'});