]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/ovpnmain.cgi
OpenVPN: change sortorder of client status and control. Now every network is sorted...
[ipfire-2.x.git] / html / cgi-bin / ovpnmain.cgi
index ed614d86831d6f8994ce8c3eaf9cae458df81bf0..927616a55d2217f9b30c30a5c5e6cc8f7db6f2d8 100644 (file)
@@ -1519,17 +1519,6 @@ END
        exit(0);
     }
 
-###
-### Download Diffie-Hellman parameter
-###
-}elsif ($cgiparams{'ACTION'} eq $Lang::tr{'download dh parameter'}) {
-    if ( -f "${General::swroot}/ovpn/ca/dh1024.pem" ) {
-       print "Content-Type: application/octet-stream\r\n";
-       print "Content-Disposition: filename=dh1024.pem\r\n\r\n";
-       print `/usr/bin/openssl dhparam -in ${General::swroot}/ovpn/ca/dh1024.pem`;
-       exit(0);
-    }
-
 ###
 ### Download tls-auth key
 ###
@@ -5035,24 +5024,41 @@ END
 ###
 
     &Header::openbox('100%', 'LEFT', $Lang::tr{'connection status and controlc' });
-    print <<END;
-
-
-    <table width='100%' cellspacing='1' cellpadding='0' class='tbl'>
-<tr>
-    <th width='10%' class='boldbase' align='center'><b>$Lang::tr{'name'}</b></th>
-    <th width='15%' class='boldbase' align='center'><b>$Lang::tr{'type'}</b></th>
-    <th width='22%' class='boldbase' align='center'><b>$Lang::tr{'network'}</b></th>
-    <th width='20%' class='boldbase' align='center'><b>$Lang::tr{'remark'}</b></th>
-    <th width='10%' class='boldbase' align='center'><b>$Lang::tr{'status'}</b></th>
-    <th width='5%' class='boldbase' colspan='6' align='center'><b>$Lang::tr{'action'}</b></th>
-</tr>
-END
        ;
        my $id = 0;
        my $gif;
        my $col1="";
-       foreach my $key (sort { ncmp ($confighash{$a}[1],$confighash{$b}[1]) } keys %confighash) {
+       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"<b>$confighash{$key}[32]</b>";
+                       print <<END;
+       <table width='100%' cellspacing='1' cellpadding='0' class='tbl'>
+<tr>
+       <th width='10%' class='boldbase' align='center'><b>$Lang::tr{'name'}</b></th>
+       <th width='15%' class='boldbase' align='center'><b>$Lang::tr{'type'}</b></th>
+       <th width='20%' class='boldbase' align='center'><b>$Lang::tr{'remark'}</b></th>
+       <th width='10%' class='boldbase' align='center'><b>$Lang::tr{'status'}</b></th>
+       <th width='5%' class='boldbase' colspan='6' align='center'><b>$Lang::tr{'action'}</b></th>
+</tr>
+END
+               }
+               if ($id > 0 && $lastnet ne $confighash{$key}[32]){
+                       print "</table><br>";
+                       print"<b>$confighash{$key}[32]</b>";
+                       print <<END;
+       <table width='100%' cellspacing='1' cellpadding='0' class='tbl'>
+<tr>
+       <th width='10%' class='boldbase' align='center'><b>$Lang::tr{'name'}</b></th>
+       <th width='15%' class='boldbase' align='center'><b>$Lang::tr{'type'}</b></th>
+       <th width='20%' class='boldbase' align='center'><b>$Lang::tr{'remark'}</b></th>
+       <th width='10%' class='boldbase' align='center'><b>$Lang::tr{'status'}</b></th>
+       <th width='5%' class='boldbase' colspan='6' align='center'><b>$Lang::tr{'action'}</b></th>
+</tr>
+END
+               }
        if ($confighash{$key}[0] eq 'on') { $gif = 'on.gif'; } else { $gif = 'off.gif'; }
        if ($id % 2) {
                print "<tr>";
@@ -5071,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 "<td align='center' $col>$confighash{$key}[32]</td>";
        print "<td align='center' $col>$confighash{$key}[25]</td>";
        $col1="bgcolor='${Header::colourred}'";
        my $active = "<b><font color='#FFFFFF'>$Lang::tr{'capsclosed'}</font></b>";
@@ -5202,7 +5205,9 @@ END
 END
        ;
        $id++;
+       $lastnet = $confighash{$key}[32];
     }
+    print"</table>";
     ;
 
     # If the config file contains entries, print Key to action icons
@@ -5351,8 +5356,6 @@ END
                        <input type='image' name='$Lang::tr{'show dh'}' src='/images/info.gif' alt='$Lang::tr{'show dh'}' title='$Lang::tr{'show dh'}' width='20' height='20' border='0' />
                        </form>
                        <form method='post' name='frmdhparam'><td width='3%' align='center' $col3>
-                       <input type='image' name="$Lang::tr{'download dh parameter'}" src='/images/media-floppy.png' alt="$Lang::tr{'download dh parameter'}" title="$Lang::tr{'download dh parameter'}" border='0' />
-                       <input type='hidden' name='ACTION' value="$Lang::tr{'download dh parameter'}" />
                        </form>
                        <td width='4%' $col3>&nbsp;</td>
                </tr>
@@ -5463,7 +5466,7 @@ END
        <form method='post' enctype='multipart/form-data'>
        <table width='100%' border='0'cellspacing='1' cellpadding='0'>
        <tr>
-               <td class'base'><b>CA-Upload</b></td>
+               <td class'base'><b>$Lang::tr{'upload ca certificate'}</b></td>
        </tr>
        <tr>
                <td class='base' nowrap='nowrap'>$Lang::tr{'ca name'}:</td>