-
-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathmove_form.cgi
executable file
·66 lines (58 loc) · 1.85 KB
/
move_form.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/local/bin/perl
# Display server re-parent form
require './virtual-server-lib.pl';
&ReadParse();
$d = &get_domain($in{'dom'});
&can_move_domain($d) || &error($text{'move_ecannot'});
&ui_print_header(&domain_in($d), $text{'move_title'}, "", "move");
if ($d->{'alias'}) {
print "$text{'move_desc3'}<p>\n";
}
elsif (!$d->{'parent'}) {
print "$text{'move_desc'}<p>\n";
}
else {
print "$text{'move_desc2'}<p>\n";
}
print &ui_form_start("move.cgi");
print &ui_hidden("dom", $d->{'id'}),"\n";
print &ui_table_start($text{'move_header'}, undef, 2);
# Domain being moved
print &ui_table_row($text{'move_dom'},
"<tt>".&show_domain_name($d)."</tt>");
if ($d->{'alias'}) {
# New alias target
@pdoms = sort { lc($a->{'dom'}) cmp lc($b->{'dom'}) }
grep { !$_->{'alias'} && can_config_domain($_) }
&list_domains();
print &ui_table_row($text{'move_target2'},
&ui_select("parent", undef,
[ map { [ $_->{'id'}, &show_domain_name($_) ] } @pdoms ]));
}
else {
# New parent
@pdoms = sort { lc($a->{'dom'}) cmp lc($b->{'dom'}) }
grep { !$_->{'parent'} && &can_config_domain($_) }
&list_visible_domains();
if ($d->{'parent'}) {
@pdoms = grep { $_->{'id'} ne $d->{'parent'} } @pdoms;
}
else {
@pdoms = grep { $_->{'id'} ne $d->{'id'} } @pdoms;
}
print &ui_table_row($text{'move_target'},
&ui_select("parent", undef,
[ $d->{'parent'} ? ( [ 0, $text{'move_up'} ] ) : ( ),
map { [ $_->{'id'}, &show_domain_name($_) ] } @pdoms ]));
# Options for making a new parent domain
if ($d->{'parent'}) {
print &ui_table_row($text{'move_newuser'},
&ui_textbox("newuser", $d->{'user'}, 20));
print &ui_table_row($text{'move_newpass'},
&ui_password("newpass", $d->{'pass'}, 20));
}
}
print &ui_table_end();
print &ui_form_end([ [ "move", $text{'move_ok'} ] ]);
&ui_print_footer(&domain_footer_link($d),
"", $text{'index_return'});