ovpnmain.cgi: Load all modules at the beginning

Although Perl modules tend to take a long time to load, it is better to
do this at the beginning so that loading the script will show any
errors.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2022-05-03 11:54:17 +00:00
parent 2050be20e1
commit c63a54f090

View File

@@ -23,6 +23,9 @@
###
use CGI;
use CGI qw/:standard/;
use Imager::QRCode;
use MIME::Base32;
use MIME::Base64;
use Net::DNS;
use Net::Ping;
use Net::Telnet;
@@ -2638,9 +2641,6 @@ else
} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'show otp qrcode'}) {
&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
use MIME::Base32;
use MIME::Base64;
use Imager::QRCode;
my $qrcode = Imager::QRCode->new(
size => 6,
margin => 0,