Revision: 7076
          http://sourceforge.net/p/ipcop/svn/7076
Author:   owes
Date:     2013-07-12 20:43:59 +0000 (Fri, 12 Jul 2013)
Log Message:
-----------
Sort OpenVPN connections similar to IPsec

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/openvpn.cgi

Modified: ipcop/trunk/html/cgi-bin/openvpn.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/openvpn.cgi        2013-07-10 21:07:57 UTC (rev 
7075)
+++ ipcop/trunk/html/cgi-bin/openvpn.cgi        2013-07-12 20:43:59 UTC (rev 
7076)
@@ -2017,7 +2017,7 @@
     print <<END
 <table width='100%' border='0' cellspacing='1' cellpadding='0'>
 <tr valign='bottom'>
-    <td width='10%' class='boldbase' 
align='center'><b>$Lang::tr{'name'}</b></td>
+    <td width='10%' class='boldbase' align='center'><b>$Lang::tr{'name'}</b> 
$Header::sortup</td>
     <td width='15%' class='boldbase' 
align='center'><b>$Lang::tr{'type'}</b></td>
     <td width='15%' class='boldbase' align='center'><b>$Lang::tr{'common 
name'}</b></td>
     <td width='20%' class='boldbase' align='center'><b>$Lang::tr{'valid 
until'}</b></td>
@@ -2029,7 +2029,7 @@
     ;
     my $id = 0;
     my $gif;
-    foreach my $key (keys %confighash) {
+    foreach my $key (sort SortConfigHashByName (keys(%confighash))) {
         if ($confighash{$key}[0] eq 'on') {
             $gif = 'on.gif';
         }
@@ -2190,3 +2190,18 @@
 
 &Header::closebigbox();
 &Header::closepage();
+
+
+
+sub SortConfigHashByName
+{
+    if ($confighash{$a}[1] lt $confighash{$b}[1]) {
+        return -1;
+    }
+    elsif ($confighash{$a}[1] gt $confighash{$b}[1]) {
+        return 1;
+    }
+    else {
+        return 0;
+    }
+}

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to