3 # Move a zone to a different view
5 require './bind8-lib.pl';
7 $pconf = &get_config_parent();
8 $conf = $pconf->{'members'};
9 $nconf = $conf->[$in{'newview'}];
10 if ($in{'view'} ne '') {
11 $view = $conf->[$in{'view'}];
12 $conf = $view->{'members'};
14 $zconf = $conf->[$in{'index'}];
15 &can_edit_zone($zconf, $view) || &error($text{'master_ecannot'});
16 $in{'view'} ne $in{'newview'} || &error($text{'master_emove'});
17 &can_edit_view($nconf) || &error($text{'master_eviewcannot'});
19 # Delete from the view
20 &lock_file(&make_chroot($zconf->{'file'}));
21 &save_directive($pconf, [ $zconf ], [ ], 0);
23 &unlock_file(&make_chroot($zconf->{'file'}));
26 &lock_file(&make_chroot($nconf->{'file'}));
27 &save_directive($nconf, undef, [ $zconf ], 1);
29 &unlock_file(&make_chroot($nconf->{'file'}));
30 &webmin_log("move", undef, $zconf->{'value'}, \%in);