Skip to content

Commit

Permalink
Implement module chaining API
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Dec 12, 2022
1 parent 2b6845b commit 43279c8
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -555,4 +555,30 @@ sub feature_can_reset
return 0;
}

# Nginx SSL will be activated if a regular website is
sub feature_can_chained
{
return 1;
}

# Returns 1 if the regular website is enabled and on by default
sub feature_chained
{
my ($d, $oldd) = @_;
if ($virtual_server::config{'plugins_inactive'} =~ /\Q$module_name\E/) {
# Not in auto mode
return undef;
}
elsif ($d->{'virtualmin-nginx'}) {
if (!$oldd || !$oldd->{'virtualmin-nginx'}) {
# Turning on a website, so enable SSL as well
return 1;
}
}
else {
# Always off when a website is
return 0;
}
}

1;

0 comments on commit 43279c8

Please sign in to comment.