Fix to move module check at the top

This commit is contained in:
iliajie
2022-10-30 13:30:02 +02:00
parent 7bceedfe42
commit cd5616a6c0

View File

@@ -8,6 +8,17 @@ require './xterm-lib.pl';
my $wver = &get_webmin_version();
$wver =~ s/\.//;
# Check for needed modules
my $modname = "Net::WebSocket::Server";
eval "use ${modname};";
if ($@) {
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0);
print &text('index_cpan', "<tt>$modname</tt>",
"../cpan/download.cgi?source=3&cpan=$modname&mode=2&return=/$module_name/&returndesc=".&urlize($module_info{'desc'})),"<p>\n";
&ui_print_footer("/", $text{'index'});
return;
}
# Build Xterm dependency links
my $termlinks =
{ 'css' => ['xterm.css?$wver'],
@@ -131,16 +142,6 @@ if (!$xmlhr) {
print "<script>history.replaceState(null, String(), location.pathname);</script>";
}
# Check for needed modules
my $modname = "Net::WebSocket::Server";
eval "use ${modname};";
if ($@) {
print &text('index_cpan', "<tt>$modname</tt>",
"../cpan/download.cgi?source=3&cpan=$modname&mode=2&return=/$module_name/&returndesc=".&urlize($module_info{'desc'})),"<p>\n";
&ui_print_footer("/", $text{'index'});
return;
}
# Find ports already in use
&lock_file(&get_miniserv_config_file());
my %miniserv;