Skip to content

Commit 84715e1

Browse files
committed
Allow plugins to be association and dis-associated
1 parent 222770b commit 84715e1

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

Diff for: assoc.cgi

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ $d || &error($text{'edit_egone'});
1010

1111
# Update domain object with new features
1212
&obtain_lock_everything($d);
13-
foreach my $f (&list_possible_domain_features($d)) {
13+
foreach my $f (&list_possible_domain_features($d),
14+
&list_possible_domain_plugins($d)) {
1415
if ($d->{$f} && !$in{$f}) {
1516
$d->{$f} = 0;
1617
push(@disabled, $f);

Diff for: assoc_form.cgi

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ my @grid;
2020
foreach my $f (&list_possible_domain_features($d)) {
2121
push(@grid, &ui_checkbox($f, 1, $text{'edit_'.$f}, $d->{$f}));
2222
}
23+
foreach my $f (&list_possible_domain_plugins($d)) {
24+
$label = &plugin_call($f, "feature_label", 1);
25+
push(@grid, &ui_checkbox($f, 1, $label, $d->{$f}));
26+
}
2327
print &ui_table_row($text{'assoc_features'},
2428
&ui_grid_table(\@grid, 2));
2529

Diff for: virtual-server-lib-funcs.pl

+17
Original file line numberDiff line numberDiff line change
@@ -18919,6 +18919,23 @@ sub list_possible_domain_features
1891918919
return @rv;
1892018920
}
1892118921

18922+
# list_possible_domain_plugins(&domain)
18923+
# Given a domain, returns a list of plugin features that can possibly be enabled
18924+
# or disabled for it
18925+
sub list_possible_domain_plugins
18926+
{
18927+
my ($d) = @_;
18928+
my @rv;
18929+
my $aliasdom = $d->{'alias'} ? &get_domain($d->{'alias'}) : undef;
18930+
my $subdom = $d->{'subdom'} ? &get_domain($d->{'subdom'}) : undef;
18931+
foreach my $f (&list_feature_plugins()) {
18932+
next if (!&plugin_call($f, "feature_suitable",
18933+
$parentdom, $aliasdom, $subdom));
18934+
push(@rv, $f);
18935+
}
18936+
return @rv;
18937+
}
18938+
1892218939
# list_remote_domain_features(&domain)
1892318940
# Returns a list of all features for a domain that are on shared storage
1892418941
sub list_remote_domain_features

0 commit comments

Comments
 (0)