From: Alexander Marx Date: Mon, 14 Jul 2014 08:29:24 +0000 (+0200) Subject: OpenVPN: change sortorder of client status and control. Now every network is sorted... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b942f7f3b3fd5277ca990c22530ea5f0aa33876;p=people%2Fms%2Fipfire-2.x.git OpenVPN: change sortorder of client status and control. Now every network is sorted and displayed in a group --- diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 3f49dccc1c..927616a55d 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -5024,24 +5024,41 @@ END ### &Header::openbox('100%', 'LEFT', $Lang::tr{'connection status and controlc' }); - print < - - $Lang::tr{'name'} - $Lang::tr{'type'} - $Lang::tr{'network'} - $Lang::tr{'remark'} - $Lang::tr{'status'} - $Lang::tr{'action'} - -END ; my $id = 0; my $gif; my $col1=""; + my $lastnet; foreach my $key (sort { ncmp ($confighash{$a}[32],$confighash{$b}[32]) } sort { ncmp ($confighash{$a}[1],$confighash{$b}[1]) } keys %confighash) { + if ($confighash{$key}[32] eq "" && $confighash{$key}[3] eq 'net' ){$confighash{$key}[32]=$Lang::tr{'fwhost OpenVPN N-2-N'};} + if ($confighash{$key}[32] eq "dynamic"){$confighash{$key}[32]=$Lang::tr{'ccd dynrange'};} + if($id == 0){ + print"$confighash{$key}[32]"; + print < + + $Lang::tr{'name'} + $Lang::tr{'type'} + $Lang::tr{'remark'} + $Lang::tr{'status'} + $Lang::tr{'action'} + +END + } + if ($id > 0 && $lastnet ne $confighash{$key}[32]){ + print "
"; + print"$confighash{$key}[32]"; + print < + + $Lang::tr{'name'} + $Lang::tr{'type'} + $Lang::tr{'remark'} + $Lang::tr{'status'} + $Lang::tr{'action'} + +END + } if ($confighash{$key}[0] eq 'on') { $gif = 'on.gif'; } else { $gif = 'off.gif'; } if ($id % 2) { print ""; @@ -5060,9 +5077,6 @@ END my $cavalid = `/usr/bin/openssl x509 -text -in ${General::swroot}/ovpn/certs/$confighash{$key}[1]cert.pem`; $cavalid =~ /Not After : (.*)[\n]/; $cavalid = $1; - if ($confighash{$key}[32] eq "" && $confighash{$key}[3] eq 'net' ){$confighash{$key}[32]="net-2-net";} - if ($confighash{$key}[32] eq "" && $confighash{$key}[3] eq 'host' ){$confighash{$key}[32]="dynamic";} - print "$confighash{$key}[32]"; print "$confighash{$key}[25]"; $col1="bgcolor='${Header::colourred}'"; my $active = "$Lang::tr{'capsclosed'}"; @@ -5191,7 +5205,9 @@ END END ; $id++; + $lastnet = $confighash{$key}[32]; } + print""; ; # If the config file contains entries, print Key to action icons