-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathedit_newsharedips.cgi
executable file
·56 lines (46 loc) · 1.61 KB
/
edit_newsharedips.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
#!/usr/local/bin/perl
# Show a page for entering possible shared IP addresses
require './virtual-server-lib.pl';
&can_edit_templates() || &error($text{'sharedips_ecannot'});
&ui_print_header(undef, $text{'sharedips_title'}, "", "sharedips");
print "$text{'sharedips_desc'}<p>\n";
print &ui_form_start("save_newsharedips.cgi", "post");
print &ui_table_start($text{'sharedips_header'}, undef, 2);
# Current default IP
print &ui_table_row($text{'sharedips_def'},
&get_default_ip());
if (defined(&list_resellers)) {
# Shared IPs owned by resellers
foreach $r (&list_resellers()) {
if ($r->{'acl'}->{'defip'}) {
push(@rips, "<tt>$r->{'acl'}->{'defip'}</tt> ".
"($r->{'name'})");
}
}
if (@rips) {
print &ui_table_row($text{'sharedips_rips'},
join("<br>\n", @rips));
}
}
# Other possible shared IPs for regular servers
print &ui_table_row($text{'sharedips_ips'},
&ui_textarea("ips", join("\n", &list_shared_ips()),
5, 20));
# Allocate a new one from the default template
$tmpl = &get_template(&get_init_template(0));
if ($tmpl->{'ranges'}) {
print &ui_table_row(" ",
&ui_checkbox("alloc", 1, $text{'sharedips_alloc'}, 0));
}
if (&supports_ip6()) {
# Default IPv6 address
print &ui_table_row($text{'sharedips_def6'},
&get_default_ip6() || "<i>$text{'sharedips_def6none'}</i>");
# Other possible shared IPv6 addressses for regular servers
print &ui_table_row($text{'sharedips_ip6s'},
&ui_textarea("ip6s", join("\n", &list_shared_ip6s()),
5, 40));
}
print &ui_table_end();
print &ui_form_end([ [ "ok", $text{'sharedips_ok'} ] ]);
&ui_print_footer("", $text{'index_return'});