]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
captive: Redesign clients list box
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 1 May 2017 10:40:06 +0000 (11:40 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Sep 2017 17:56:04 +0000 (18:56 +0100)
Mostly code cleanup

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
12 files changed:
doc/language_issues.de
doc/language_issues.en
doc/language_issues.es
doc/language_issues.fr
doc/language_issues.it
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
doc/language_issues.tr
html/cgi-bin/captive.cgi
html/cgi-bin/captive/index.cgi
langs/en/cgi-bin/en.pl

index ab08359d5b3a548a9fe543c72834ff656ef61023..3148f621964fab631d6201b6f6075681f8e16e7b 100644 (file)
@@ -688,10 +688,12 @@ WARNING: untranslated string: Captive GAIN ACCESS
 WARNING: untranslated string: Captive agree tac
 WARNING: untranslated string: Captive branding
 WARNING: untranslated string: Captive client session expiry time
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Captive expiry time
 WARNING: untranslated string: Captive issued coupons
 WARNING: untranslated string: Captive logo uploaded
 WARNING: untranslated string: Captive terms
+WARNING: untranslated string: Captive terms short
 WARNING: untranslated string: Captive upload logo
 WARNING: untranslated string: Captive upload logo recommendations
 WARNING: untranslated string: Scan for Songs
index 84337cf818fb71cb4e5b6f4acd79875ed8b9b8c7..407cff2690d755ef3924b8c31572d3eb041eff79 100644 (file)
@@ -718,6 +718,7 @@ WARNING: translation string unused: xtaccess all error
 WARNING: translation string unused: xtaccess bad transfert
 WARNING: translation string unused: year-graph
 WARNING: translation string unused: yearly firewallhits
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Scan for Songs
 WARNING: untranslated string: bytes
 WARNING: untranslated string: captive
index f4d93af6306b59299f7b99546fa2b9e9bd304646..9acf434c78e4dea86d927fdb3e44ac6d5e6fd75e 100644 (file)
@@ -628,6 +628,7 @@ WARNING: untranslated string: Captive authentication
 WARNING: untranslated string: Captive brand color
 WARNING: untranslated string: Captive branding
 WARNING: untranslated string: Captive client session expiry time
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expire
@@ -640,6 +641,7 @@ WARNING: untranslated string: Captive menu
 WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive terms
+WARNING: untranslated string: Captive terms short
 WARNING: untranslated string: Captive title
 WARNING: untranslated string: Captive upload logo
 WARNING: untranslated string: Captive upload logo recommendations
index 5c156d13315dd330ae61e60b3199fc42c097870b..b441cb171a079718689ee3e5b808f7486877e9ef 100644 (file)
@@ -638,6 +638,7 @@ WARNING: untranslated string: Captive authentication
 WARNING: untranslated string: Captive brand color
 WARNING: untranslated string: Captive branding
 WARNING: untranslated string: Captive client session expiry time
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expire
@@ -650,6 +651,7 @@ WARNING: untranslated string: Captive menu
 WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive terms
+WARNING: untranslated string: Captive terms short
 WARNING: untranslated string: Captive title
 WARNING: untranslated string: Captive upload logo
 WARNING: untranslated string: Captive upload logo recommendations
index c34b0e2e28f1034c0c369c5a83600079cfc668c8..12d0c26c009bd046b3a52c830c79407c51c1a1b2 100644 (file)
@@ -705,6 +705,7 @@ WARNING: untranslated string: Captive authentication
 WARNING: untranslated string: Captive brand color
 WARNING: untranslated string: Captive branding
 WARNING: untranslated string: Captive client session expiry time
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expire
@@ -717,6 +718,7 @@ WARNING: untranslated string: Captive menu
 WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive terms
+WARNING: untranslated string: Captive terms short
 WARNING: untranslated string: Captive title
 WARNING: untranslated string: Captive upload logo
 WARNING: untranslated string: Captive upload logo recommendations
index 35469204cfe75ad31e62fb7dfe9e90a0c9cf1e90..140de8649d8ece2559f573df9b48be0ecd3d122d 100644 (file)
@@ -701,6 +701,7 @@ WARNING: untranslated string: Captive authentication
 WARNING: untranslated string: Captive brand color
 WARNING: untranslated string: Captive branding
 WARNING: untranslated string: Captive client session expiry time
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expire
@@ -713,6 +714,7 @@ WARNING: untranslated string: Captive menu
 WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive terms
+WARNING: untranslated string: Captive terms short
 WARNING: untranslated string: Captive title
 WARNING: untranslated string: Captive upload logo
 WARNING: untranslated string: Captive upload logo recommendations
index f4d93af6306b59299f7b99546fa2b9e9bd304646..9acf434c78e4dea86d927fdb3e44ac6d5e6fd75e 100644 (file)
@@ -628,6 +628,7 @@ WARNING: untranslated string: Captive authentication
 WARNING: untranslated string: Captive brand color
 WARNING: untranslated string: Captive branding
 WARNING: untranslated string: Captive client session expiry time
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expire
@@ -640,6 +641,7 @@ WARNING: untranslated string: Captive menu
 WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive terms
+WARNING: untranslated string: Captive terms short
 WARNING: untranslated string: Captive title
 WARNING: untranslated string: Captive upload logo
 WARNING: untranslated string: Captive upload logo recommendations
index b44edab25341dc92bf43726bab25dc7c3feab6f5..1c1c54f12e0e6feb208b884f25d693c8dafbde1e 100644 (file)
@@ -630,6 +630,7 @@ WARNING: untranslated string: Captive authentication
 WARNING: untranslated string: Captive brand color
 WARNING: untranslated string: Captive branding
 WARNING: untranslated string: Captive client session expiry time
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expire
@@ -642,6 +643,7 @@ WARNING: untranslated string: Captive menu
 WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive terms
+WARNING: untranslated string: Captive terms short
 WARNING: untranslated string: Captive title
 WARNING: untranslated string: Captive upload logo
 WARNING: untranslated string: Captive upload logo recommendations
index 0878db5e7737628888548c5185bd85bc80fbc41d..8453570883d6e2bc37bd4125443a3dd9eb13a5b9 100644 (file)
@@ -713,6 +713,7 @@ WARNING: untranslated string: Captive authentication
 WARNING: untranslated string: Captive brand color
 WARNING: untranslated string: Captive branding
 WARNING: untranslated string: Captive client session expiry time
+WARNING: untranslated string: Captive clients
 WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expire
@@ -725,6 +726,7 @@ WARNING: untranslated string: Captive menu
 WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive terms
+WARNING: untranslated string: Captive terms short
 WARNING: untranslated string: Captive title
 WARNING: untranslated string: Captive upload logo
 WARNING: untranslated string: Captive upload logo recommendations
index 4d2564afe79760616211b67a5b9fa8f89b5dfa53..453ae49a7be884240b2a101f179b98f7224790b0 100755 (executable)
@@ -621,45 +621,67 @@ END
 }
 
 sub show_clients() {
-       #if there are active clients which use coupons show table
+       # if there are active clients which use coupons show table
        return if ( -z $clients || ! -f $clients );
+
        my $count=0;
        my $col;
-       &Header::openbox('100%', 'left', $Lang::tr{'Captive voactive'});
-print<<END
-       <center><table class='tbl' width='100%'>
-               <tr>
-                       <th align='center' width='15%'>$Lang::tr{'Captive coupon'}</th><th th align='center' width='15%'>$Lang::tr{'Captive activated'}</th><th align='center' width='15%'>$Lang::tr{'Captive expire'}</th><th align='center' width='10%'>$Lang::tr{'Captive mac'}</th><th align='center' width='43%'>$Lang::tr{'remark'}</th><th th align='center' width='5%'>$Lang::tr{'delete'}</th></tr>
+
+       &Header::openbox('100%', 'left', $Lang::tr{'Captive clients'});
+
+       print <<END;
+               <table class='tbl' width='100%'>
+                       <tr>
+                               <th align='center' width='15%'>$Lang::tr{'Captive coupon'}</th>
+                               <th align='center' width='15%'>$Lang::tr{'Captive activated'}</th>
+                               <th align='center' width='15%'>$Lang::tr{'Captive expiry time'}</th>
+                               <th align='center' width='10%'>$Lang::tr{'Captive mac'}</th>
+                               <th align='center' width='43%'>$Lang::tr{'remark'}</th>
+                               <th align='center' width='5%'>$Lang::tr{'delete'}</th>
+                       </tr>
 END
-;
+
        &General::readhasharray($clients, \%clientshash) if (-e $clients);
-       foreach my $key (keys %clientshash)
-       {
+       foreach my $key (keys %clientshash) {
                #calculate time from clientshash (starttime)
                my $starttime = sub{sprintf '%02d.%02d.%04d %02d:%02d', $_[3], $_[4]+1, $_[5]+1900, $_[2], $_[1]  }->(localtime($clientshash{$key}[2]));
+
                #calculate endtime from clientshash
                my $endtime;
                if ($clientshash{$key}[3] eq '0'){
                        $endtime=$Lang::tr{'Captive nolimit'};
-               }else{
+               } else {
                        $endtime = sub{sprintf '%02d.%02d.%04d %02d:%02d', $_[3], $_[4]+1, $_[5]+1900, $_[2], $_[1]  }->(localtime($clientshash{$key}[2]+$clientshash{$key}[3]));
                }
 
-                       if ($count % 2){
-                               print" <tr>";
-                               $col="bgcolor='$color{'color20'}'";
-                       }else{
-                               $col="bgcolor='$color{'color22'}'";
-                               print" <tr>";
-                       }
+               if ($count++ % 2) {
+                       $col="bgcolor='$color{'color20'}'";
+               } else {
+                       $col="bgcolor='$color{'color22'}'";
+               }
+
+               my $coupon = ($clientshash{$key}[4] eq "LICENSE") ? $Lang::tr{'Captive terms short'} : $clientshash{$key}[4];
 
-                       print "<td $col><center><b>$clientshash{$key}[4]</b></td><td $col><center>$starttime ";
-                       print "</center></td><td $col><center>$endtime</center></td><td $col><center>$clientshash{$key}[0]</td><td $col><center>$clientshash{$key}[5]</center>";
-                       print "</td><td $col><form method='post'><center><input type='image' src='/images/delete.gif' align='middle' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' /><form method='post'><input type='hidden' name='ACTION' value='delete-client' /><input type='hidden' name='key' value='$clientshash{$key}[0]' /></form></tr>";
-                       $count++;
+               print <<END;
+                       <tr>
+                               <td $col align="center"><b>$coupon</b></td>
+                               <td $col align="center">$starttime</td>
+                               <td $col align="center">$endtime</td>
+                               <td $col align="center">$clientshash{$key}[0]</td>
+                               <td $col align="center">$clientshash{$key}[5]</td>
+                               <td $col align="center">
+                                       <form method='post'>
+                                               <input type='image' src='/images/delete.gif' align='middle' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' />
+                                               <input type='hidden' name='ACTION' value='delete-client' />
+                                               <input type='hidden' name='key' value='$clientshash{$key}[0]' />
+                                       </form>
+                               </td>
+                       </tr>
+END
        }
 
        print "</table>";
+
        &Header::closebox();
 }
 
index 698384b6a5cac2b1938fd3d3c357c6f63284910b..597d5301446594a292a3b3647cb2edbdc59e38ca 100755 (executable)
@@ -116,7 +116,7 @@ if ($cgiparams{'ACTION'} eq "SUBMIT") {
                $clientshash{$key}[3] = $settings{'SESSION_TIME'} || "0";
 
                # No coupon code
-               $clientshash{$key}[4] = "LICENSE";
+               $clientshash{$key}[4] = "TERMS";
 
                &General::log("Captive", "Internet access granted via license agreement for $ip_address until $clientshash{$key}[3]");
        }
index cfa6af84a0e9234f18a8d3accbfabe4e31a09172..e243f6bcb05bbfef0df66990dfab2e8a5fe1d649 100644 (file)
@@ -43,6 +43,7 @@
 'Captive nolimit' => 'unlimited',
 'Captive nr' => 'Number',
 'Captive terms' => 'Terms &amp; Conditions',
+'Captive terms short' => 'T&Cs',
 'Captive time' => 'Access time post activation (hours)',
 'Captive title' => 'Title of Login Page',
 'Captive upload logo' => 'Upload Logo',