Skip to content

Commit

Permalink
Just assume that new functions are available
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Jul 29, 2017
1 parent b16b3e7 commit 18771e6
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -251,19 +251,13 @@ sub feature_setup
&virtual_server::register_post_action(\&virtualmin_nginx::print_apply_nginx);

# Add this IP and cert to Webmin/Usermin's SSL keys list
my %vinfo = &get_module_info("virtual-server");
my $nv = &compare_version_numbers($vinfo{'version'}, 5.08) >= 0;
my $canipkeys = $d->{'virt'} || $nv;
my $rwfunc = $nv ? \&virtual_server::restart_webmin_fully
: \&virtual_server::restart_webmin;
if ($tmpl->{'web_webmin_ssl'} && $canipkeys) {
if ($tmpl->{'web_webmin_ssl'}) {
&virtual_server::setup_ipkeys($d,
\&get_miniserv_config,
\&put_miniserv_config,
$rwfunc);
\&virtual_server::restart_webmin_fully);
}
if ($tmpl->{'web_usermin_ssl'} && &foreign_installed("usermin") &&
$canipkeys) {
if ($tmpl->{'web_usermin_ssl'} && &foreign_installed("usermin")) {
&foreign_require("usermin");
&virtual_server::setup_ipkeys($d,
\&usermin::get_usermin_miniserv_config,
Expand Down Expand Up @@ -450,14 +444,10 @@ sub feature_delete
&virtual_server::register_post_action(\&virtualmin_nginx::print_apply_nginx);

# Delete per-IP SSL cert
my %vinfo = &get_module_info("virtual-server");
my $nv = &compare_version_numbers($vinfo{'version'}, 5.08) >= 0;
my $rwfunc = $nv ? \&virtual_server::restart_webmin_fully
: \&virtual_server::restart_webmin;
&virtual_server::delete_ipkeys($d,
\&get_miniserv_config,
\&put_miniserv_config,
$rwfunc);
\&virtual_server::restart_webmin_fully);
if (&foreign_installed("usermin")) {
&foreign_require("usermin");
&virtual_server::delete_ipkeys($d,
Expand Down

0 comments on commit 18771e6

Please sign in to comment.