forked from virtualmin/virtualmin-gpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
assoc_form.cgi
executable file
·38 lines (30 loc) · 1.1 KB
/
assoc_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
#!/usr/local/bin/perl
# Show a form to associate or disassociate features
require './virtual-server-lib.pl';
&ReadParse();
$d = &get_domain($in{'dom'});
$d || &error($text{'edit_egone'});
&can_associate_domain($d) || &error($text{'assoc_ecannot'});
&ui_print_header(&domain_in($d), $text{'assoc_title'}, "");
print $text{'assoc_desc'},"<p>\n";
print &ui_form_start("assoc.cgi", "post");
print &ui_hidden("dom", $in{'dom'});
print &ui_table_start($text{'assoc_header'}, undef, 2);
# Features to enable or disable
my @grid;
foreach my $f (&list_possible_domain_features($d)) {
push(@grid, &ui_checkbox($f, 1, $text{'edit_'.$f}, $d->{$f}));
}
foreach my $f (&list_possible_domain_plugins($d)) {
$label = &plugin_call($f, "feature_label", 1);
push(@grid, &ui_checkbox($f, 1, $label, $d->{$f}));
}
print &ui_table_row($text{'assoc_features'},
&ui_grid_table(\@grid, 2));
# Validate afterwards?
print &ui_table_row($text{'assoc_validate'},
&ui_yesno_radio("validate", 0));
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&domain_footer_link($d),
"", $text{'index_return'});