]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
captive: Simplify coupon time selection
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Oct 2017 13:05:53 +0000 (15:05 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Oct 2017 13:05:53 +0000 (15:05 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
13 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
doc/language_missings
html/cgi-bin/captive.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index f5d6d36751ef0c482ffb4728189f189ba8f21d79..0443130156dbbae4cc590b20c5bfb555d0f911c9 100644 (file)
@@ -14,6 +14,7 @@ WARNING: translation string unused: Captive ip
 WARNING: translation string unused: Captive logo_set
 WARNING: translation string unused: Captive logo_upload
 WARNING: translation string unused: Captive logo_upload1
+WARNING: translation string unused: Captive noexpiretime
 WARNING: translation string unused: Captive nr
 WARNING: translation string unused: Captive time
 WARNING: translation string unused: Captive voactive
index 1a22e2836fe97d32fdf67e143762451c1f646ee1..eebb5d6dc6ada90582ba548f0ac3301ea98ab9da 100644 (file)
@@ -14,6 +14,7 @@ WARNING: translation string unused: Captive invalid logosize
 WARNING: translation string unused: Captive invalid_voucher
 WARNING: translation string unused: Captive ip
 WARNING: translation string unused: Captive logo_set
+WARNING: translation string unused: Captive noexpiretime
 WARNING: translation string unused: Captive nr
 WARNING: translation string unused: Captive please enter a coupon code
 WARNING: translation string unused: Captive time
index 38cf21080cc2b358001298efc4e193c1cc1b5bce..4ade5d5cd6da695a4479f5986912ffe70fae37e8 100644 (file)
@@ -635,12 +635,12 @@ WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expiry time
 WARNING: untranslated string: Captive export coupons
-WARNING: untranslated string: Captive generate coupon
+WARNING: untranslated string: Captive generate coupons
+WARNING: untranslated string: Captive generated coupon no
 WARNING: untranslated string: Captive issued coupons
 WARNING: untranslated string: Captive logo uploaded
 WARNING: untranslated string: Captive mac
 WARNING: untranslated string: Captive menu
-WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive please accept the terms and conditions
 WARNING: untranslated string: Captive portal
@@ -813,6 +813,7 @@ WARNING: untranslated string: firewall logs country
 WARNING: untranslated string: firewall rules
 WARNING: untranslated string: first
 WARNING: untranslated string: flag
+WARNING: untranslated string: four hours
 WARNING: untranslated string: fw default drop
 WARNING: untranslated string: fw settings
 WARNING: untranslated string: fw settings color
@@ -1059,6 +1060,7 @@ WARNING: untranslated string: notice
 WARNING: untranslated string: one hour
 WARNING: untranslated string: one month
 WARNING: untranslated string: one week
+WARNING: untranslated string: one year
 WARNING: untranslated string: openvpn default
 WARNING: untranslated string: openvpn destination port used
 WARNING: untranslated string: openvpn fragment allowed with udp
@@ -1180,6 +1182,8 @@ WARNING: untranslated string: tor traffic limit hard
 WARNING: untranslated string: tor traffic limit soft
 WARNING: untranslated string: tor traffic read written
 WARNING: untranslated string: tor use exit nodes
+WARNING: untranslated string: twelve hours
+WARNING: untranslated string: two weeks
 WARNING: untranslated string: unblock
 WARNING: untranslated string: unblock all
 WARNING: untranslated string: uncheck all
index 351d8a2ef9b2b2646ebf42d7a93bf8ba682ba74c..eae0337a673e9ede055e315af571a9231a6f6895 100644 (file)
@@ -644,12 +644,12 @@ WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expiry time
 WARNING: untranslated string: Captive export coupons
-WARNING: untranslated string: Captive generate coupon
+WARNING: untranslated string: Captive generate coupons
+WARNING: untranslated string: Captive generated coupon no
 WARNING: untranslated string: Captive issued coupons
 WARNING: untranslated string: Captive logo uploaded
 WARNING: untranslated string: Captive mac
 WARNING: untranslated string: Captive menu
-WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive please accept the terms and conditions
 WARNING: untranslated string: Captive portal
@@ -822,6 +822,7 @@ WARNING: untranslated string: firewall logs country
 WARNING: untranslated string: firewall rules
 WARNING: untranslated string: first
 WARNING: untranslated string: flag
+WARNING: untranslated string: four hours
 WARNING: untranslated string: fw default drop
 WARNING: untranslated string: fw settings
 WARNING: untranslated string: fw settings color
@@ -1077,6 +1078,7 @@ WARNING: untranslated string: ntp sync
 WARNING: untranslated string: one hour
 WARNING: untranslated string: one month
 WARNING: untranslated string: one week
+WARNING: untranslated string: one year
 WARNING: untranslated string: openvpn default
 WARNING: untranslated string: openvpn destination port used
 WARNING: untranslated string: openvpn fragment allowed with udp
@@ -1193,6 +1195,8 @@ WARNING: untranslated string: tor traffic limit hard
 WARNING: untranslated string: tor traffic limit soft
 WARNING: untranslated string: tor traffic read written
 WARNING: untranslated string: tor use exit nodes
+WARNING: untranslated string: twelve hours
+WARNING: untranslated string: two weeks
 WARNING: untranslated string: unblock
 WARNING: untranslated string: unblock all
 WARNING: untranslated string: uncheck all
index 36af2732310210803225543273b54c107adfed79..13508b61e0803581b8c3f5bac30ec7fd52643b7b 100644 (file)
@@ -712,12 +712,12 @@ WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expiry time
 WARNING: untranslated string: Captive export coupons
-WARNING: untranslated string: Captive generate coupon
+WARNING: untranslated string: Captive generate coupons
+WARNING: untranslated string: Captive generated coupon no
 WARNING: untranslated string: Captive issued coupons
 WARNING: untranslated string: Captive logo uploaded
 WARNING: untranslated string: Captive mac
 WARNING: untranslated string: Captive menu
-WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive please accept the terms and conditions
 WARNING: untranslated string: Captive portal
@@ -774,6 +774,7 @@ WARNING: untranslated string: firewall graph port
 WARNING: untranslated string: firewall log country
 WARNING: untranslated string: firewall log ip
 WARNING: untranslated string: firewall log port
+WARNING: untranslated string: four hours
 WARNING: untranslated string: fwdfw err concon
 WARNING: untranslated string: fwdfw err ratecon
 WARNING: untranslated string: fwdfw limitconcon
@@ -848,6 +849,7 @@ WARNING: untranslated string: none
 WARNING: untranslated string: one hour
 WARNING: untranslated string: one month
 WARNING: untranslated string: one week
+WARNING: untranslated string: one year
 WARNING: untranslated string: outgoing compression in bytes per second
 WARNING: untranslated string: outgoing overhead in bytes per second
 WARNING: untranslated string: ovpn add conf
@@ -862,6 +864,8 @@ WARNING: untranslated string: routing table
 WARNING: untranslated string: samba join a domain
 WARNING: untranslated string: samba join domain
 WARNING: untranslated string: search
+WARNING: untranslated string: twelve hours
+WARNING: untranslated string: two weeks
 WARNING: untranslated string: unblock
 WARNING: untranslated string: unblock all
 WARNING: untranslated string: uncheck all
index 91fca78476c61d7f29ab0df8cb0046d94955d422..74590a27a7bed676589752b8107c05b463f0b451 100644 (file)
@@ -708,12 +708,12 @@ WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expiry time
 WARNING: untranslated string: Captive export coupons
-WARNING: untranslated string: Captive generate coupon
+WARNING: untranslated string: Captive generate coupons
+WARNING: untranslated string: Captive generated coupon no
 WARNING: untranslated string: Captive issued coupons
 WARNING: untranslated string: Captive logo uploaded
 WARNING: untranslated string: Captive mac
 WARNING: untranslated string: Captive menu
-WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive please accept the terms and conditions
 WARNING: untranslated string: Captive portal
@@ -787,6 +787,7 @@ WARNING: untranslated string: firewall log country
 WARNING: untranslated string: firewall log ip
 WARNING: untranslated string: firewall log port
 WARNING: untranslated string: firewall logs country
+WARNING: untranslated string: four hours
 WARNING: untranslated string: fwdfw err concon
 WARNING: untranslated string: fwdfw err ratecon
 WARNING: untranslated string: fwdfw limitconcon
@@ -880,6 +881,7 @@ WARNING: untranslated string: not a valid dh key
 WARNING: untranslated string: one hour
 WARNING: untranslated string: one month
 WARNING: untranslated string: one week
+WARNING: untranslated string: one year
 WARNING: untranslated string: outgoing compression in bytes per second
 WARNING: untranslated string: outgoing overhead in bytes per second
 WARNING: untranslated string: ovpn add conf
@@ -908,6 +910,8 @@ WARNING: untranslated string: show tls-auth key
 WARNING: untranslated string: software version
 WARNING: untranslated string: source ip country
 WARNING: untranslated string: ta key
+WARNING: untranslated string: twelve hours
+WARNING: untranslated string: two weeks
 WARNING: untranslated string: unblock
 WARNING: untranslated string: unblock all
 WARNING: untranslated string: uncheck all
index 38cf21080cc2b358001298efc4e193c1cc1b5bce..4ade5d5cd6da695a4479f5986912ffe70fae37e8 100644 (file)
@@ -635,12 +635,12 @@ WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expiry time
 WARNING: untranslated string: Captive export coupons
-WARNING: untranslated string: Captive generate coupon
+WARNING: untranslated string: Captive generate coupons
+WARNING: untranslated string: Captive generated coupon no
 WARNING: untranslated string: Captive issued coupons
 WARNING: untranslated string: Captive logo uploaded
 WARNING: untranslated string: Captive mac
 WARNING: untranslated string: Captive menu
-WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive please accept the terms and conditions
 WARNING: untranslated string: Captive portal
@@ -813,6 +813,7 @@ WARNING: untranslated string: firewall logs country
 WARNING: untranslated string: firewall rules
 WARNING: untranslated string: first
 WARNING: untranslated string: flag
+WARNING: untranslated string: four hours
 WARNING: untranslated string: fw default drop
 WARNING: untranslated string: fw settings
 WARNING: untranslated string: fw settings color
@@ -1059,6 +1060,7 @@ WARNING: untranslated string: notice
 WARNING: untranslated string: one hour
 WARNING: untranslated string: one month
 WARNING: untranslated string: one week
+WARNING: untranslated string: one year
 WARNING: untranslated string: openvpn default
 WARNING: untranslated string: openvpn destination port used
 WARNING: untranslated string: openvpn fragment allowed with udp
@@ -1180,6 +1182,8 @@ WARNING: untranslated string: tor traffic limit hard
 WARNING: untranslated string: tor traffic limit soft
 WARNING: untranslated string: tor traffic read written
 WARNING: untranslated string: tor use exit nodes
+WARNING: untranslated string: twelve hours
+WARNING: untranslated string: two weeks
 WARNING: untranslated string: unblock
 WARNING: untranslated string: unblock all
 WARNING: untranslated string: uncheck all
index 25227c4c4a47d51a0e78f7a57d53ac6a088483a8..6468d5fc0fcaa4127e332f9d50e6a449ee684ae7 100644 (file)
@@ -637,12 +637,12 @@ WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expiry time
 WARNING: untranslated string: Captive export coupons
-WARNING: untranslated string: Captive generate coupon
+WARNING: untranslated string: Captive generate coupons
+WARNING: untranslated string: Captive generated coupon no
 WARNING: untranslated string: Captive issued coupons
 WARNING: untranslated string: Captive logo uploaded
 WARNING: untranslated string: Captive mac
 WARNING: untranslated string: Captive menu
-WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive please accept the terms and conditions
 WARNING: untranslated string: Captive portal
@@ -807,6 +807,7 @@ WARNING: untranslated string: firewall logs country
 WARNING: untranslated string: firewall rules
 WARNING: untranslated string: first
 WARNING: untranslated string: flag
+WARNING: untranslated string: four hours
 WARNING: untranslated string: fw default drop
 WARNING: untranslated string: fw settings
 WARNING: untranslated string: fw settings color
@@ -1061,6 +1062,7 @@ WARNING: untranslated string: notice
 WARNING: untranslated string: one hour
 WARNING: untranslated string: one month
 WARNING: untranslated string: one week
+WARNING: untranslated string: one year
 WARNING: untranslated string: openvpn default
 WARNING: untranslated string: openvpn destination port used
 WARNING: untranslated string: openvpn fragment allowed with udp
@@ -1175,6 +1177,8 @@ WARNING: untranslated string: tor traffic limit hard
 WARNING: untranslated string: tor traffic limit soft
 WARNING: untranslated string: tor traffic read written
 WARNING: untranslated string: tor use exit nodes
+WARNING: untranslated string: twelve hours
+WARNING: untranslated string: two weeks
 WARNING: untranslated string: unblock
 WARNING: untranslated string: unblock all
 WARNING: untranslated string: uncheck all
index 733c6641135a04b4f8d5b1e859825bc378fc037a..ade6c89f8b8cbd9c6dfbfdd8415d2e56c4467d98 100644 (file)
@@ -720,12 +720,12 @@ WARNING: untranslated string: Captive config
 WARNING: untranslated string: Captive coupon
 WARNING: untranslated string: Captive expiry time
 WARNING: untranslated string: Captive export coupons
-WARNING: untranslated string: Captive generate coupon
+WARNING: untranslated string: Captive generate coupons
+WARNING: untranslated string: Captive generated coupon no
 WARNING: untranslated string: Captive issued coupons
 WARNING: untranslated string: Captive logo uploaded
 WARNING: untranslated string: Captive mac
 WARNING: untranslated string: Captive menu
-WARNING: untranslated string: Captive noexpiretime
 WARNING: untranslated string: Captive nolimit
 WARNING: untranslated string: Captive please accept the terms and conditions
 WARNING: untranslated string: Captive portal
@@ -750,6 +750,7 @@ WARNING: untranslated string: firewall graph port
 WARNING: untranslated string: firewall log country
 WARNING: untranslated string: firewall log ip
 WARNING: untranslated string: firewall log port
+WARNING: untranslated string: four hours
 WARNING: untranslated string: fwhost cust geoipgrp
 WARNING: untranslated string: fwhost err hostip
 WARNING: untranslated string: guardian
@@ -795,10 +796,13 @@ WARNING: untranslated string: no data
 WARNING: untranslated string: one hour
 WARNING: untranslated string: one month
 WARNING: untranslated string: one week
+WARNING: untranslated string: one year
 WARNING: untranslated string: route config changed
 WARNING: untranslated string: routing config added
 WARNING: untranslated string: routing config changed
 WARNING: untranslated string: routing table
+WARNING: untranslated string: twelve hours
+WARNING: untranslated string: two weeks
 WARNING: untranslated string: unlimited
 WARNING: untranslated string: uplink bit rate
 WARNING: untranslated string: vpn broken
index 64c184dbf51b45130d09999036ce7a122b538a20..2fc918cec3f7366bd426c4ac0d602b0d3fd33386 100644 (file)
@@ -58,7 +58,8 @@
 < Captive expiry time
 < Captive export coupons
 < Captive GAIN ACCESS
-< Captive generate coupon
+< Captive generate coupons
+< Captive generated coupon no
 < Captive genvoucher
 < Captive invalid logosize
 < Captive invalid_voucher
 < first
 < flag
 < forward firewall
+< four hours
 < fw default drop
 < fwdfw ACCEPT
 < fwdfw action
 < ntp common settings
 < ntp sync
 < Number of Countries for the pie chart
+< one year
 < openvpn default
 < openvpn destination port used
 < openvpn disabled
 < tor traffic limit soft
 < tor traffic read written
 < tor use exit nodes
+< twelve hours
+< two weeks
 < unblock
 < unblock all
 < uncheck all
 < Captive expiry time
 < Captive export coupons
 < Captive GAIN ACCESS
-< Captive generate coupon
+< Captive generate coupons
+< Captive generated coupon no
 < Captive genvoucher
 < Captive invalid logosize
 < Captive invalid_voucher
 < first
 < flag
 < forward firewall
+< four hours
 < fw default drop
 < fwdfw ACCEPT
 < fwdfw action
 < not a valid dh key
 < notice
 < Number of Countries for the pie chart
+< one year
 < openvpn default
 < openvpn destination port used
 < openvpn disabled
 < tor traffic limit soft
 < tor traffic read written
 < tor use exit nodes
+< twelve hours
+< two weeks
 < unblock
 < unblock all
 < uncheck all
 < Captive expiry time
 < Captive export coupons
 < Captive GAIN ACCESS
-< Captive generate coupon
+< Captive generate coupons
+< Captive generated coupon no
 < Captive genvoucher
 < Captive invalid logosize
 < Captive invalid_voucher
 < first
 < flag
 < forward firewall
+< four hours
 < fw default drop
 < fwdfw ACCEPT
 < fwdfw action
 < not a valid dh key
 < notice
 < Number of Countries for the pie chart
+< one year
 < openvpn default
 < openvpn destination port used
 < openvpn disabled
 < tor traffic limit soft
 < tor traffic read written
 < tor use exit nodes
+< twelve hours
+< two weeks
 < unblock
 < unblock all
 < uncheck all
 < Captive expiry time
 < Captive export coupons
 < Captive GAIN ACCESS
-< Captive generate coupon
+< Captive generate coupons
+< Captive generated coupon no
 < Captive genvoucher
 < Captive invalid logosize
 < Captive invalid_voucher
 < first
 < flag
 < forward firewall
+< four hours
 < frequency
 < fw default drop
 < fwdfw ACCEPT
 < not a valid dh key
 < notice
 < Number of Countries for the pie chart
+< one year
 < openvpn default
 < openvpn destination port used
 < openvpn disabled
 < tor traffic limit soft
 < tor traffic read written
 < tor use exit nodes
+< twelve hours
+< two weeks
 < unblock
 < unblock all
 < uncheck all
index 629acaee2be4420322eb750f836298fff1567408..242549d33f2eec4391b693a655de279434084777 100755 (executable)
@@ -34,6 +34,19 @@ require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+my %session_times = (
+       3600            => $Lang::tr{'one hour'},
+       14400           => $Lang::tr{'four hours'},
+       28800           => $Lang::tr{'eight hours'},
+       43200           => $Lang::tr{'twelve hours'},
+       86400           => $Lang::tr{'24 hours'},
+       604800          => $Lang::tr{'one week'},
+       1209600         => $Lang::tr{'two weeks'},
+       18144000        => $Lang::tr{'one month'},
+       31536000        => $Lang::tr{'one year'},
+       0               => "- $Lang::tr{'unlimited'} -",
+);
+
 my %selected = ();
 
 my $coupons = "${General::swroot}/captive/coupons";
@@ -129,12 +142,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
        }
 }
 
-if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive generate coupon'}") {
-       # Check expiry time
-       if ($cgiparams{'EXP_HOUR'} + $cgiparams{'EXP_DAY'} + $cgiparams{'EXP_WEEK'} + $cgiparams{'EXP_MONTH'} == 0 && $cgiparams{'UNLIMITED'} == '') {
-               $errormessage = $Lang::tr{'Captive noexpiretime'};
-       }
-
+if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive generate coupons'}") {
        #check valid remark
        if ($cgiparams{'REMARK'} ne '' && !&validremark($cgiparams{'REMARK'})){
                $errormessage=$Lang::tr{'fwhost err remark'};
@@ -142,7 +150,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive generate coupon'}") {
 
        if (!$errormessage) {
                # Remember selected values
-               foreach my $val (("UNLIMITED", "EXP_HOUR", "EXP_DAY", "EXP_WEEK", "EXP_MONTH")) {
+               foreach my $val (("SESSION_TIME", "COUNT", "REMARK")) {
                        $settings{$val} = $cgiparams{$val};
                }
                &General::writehash($settingsfile, \%settings);
@@ -150,17 +158,10 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive generate coupon'}") {
                &General::readhasharray($coupons, \%couponhash) if (-e $coupons);
                my $now = time();
 
-               # Calculate expiry time in seconds
-               my $expires = 0;
-
-               if ($settings{'UNLIMITED'} ne 'on') {
-                       $expires += $settings{'EXP_HOUR'};
-                       $expires += $settings{'EXP_DAY'};
-                       $expires += $settings{'EXP_WEEK'};
-                       $expires += $settings{'EXP_MONTH'};
-               }
+               # Expiry time in seconds
+               my $expires = $settings{'SESSION_TIME'};
 
-               my $count = $cgiparams{'COUNT'} || 1;
+               my $count = $settings{'COUNT'} || 1;
                while($count-- > 0) {
                        # Generate a new code
                        my $code = &gencode();
@@ -186,7 +187,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive generate coupon'}") {
                        $couponhash{$key}[0] = $now;
                        $couponhash{$key}[1] = $code;
                        $couponhash{$key}[2] = $expires;
-                       $couponhash{$key}[3] = $cgiparams{'REMARK'};
+                       $couponhash{$key}[3] = $settings{'REMARK'};
                }
 
                # Save everything to disk
@@ -317,12 +318,9 @@ END
 
 if ($settings{'AUTH'} eq 'TERMS') {
        $selected{'SESSION_TIME'} = ();
-       $selected{'SESSION_TIME'}{'0'} = "";
-       $selected{'SESSION_TIME'}{'3600'} = "";
-       $selected{'SESSION_TIME'}{'28800'} = "";
-       $selected{'SESSION_TIME'}{'86400'} = "";
-       $selected{'SESSION_TIME'}{'604800'} = "";
-       $selected{'SESSION_TIME'}{'18144000'} = "";
+       foreach my $session_time (keys %session_times) {
+               $selected{'SESSION_TIME'}{$session_time} = "";
+       }
        $selected{'SESSION_TIME'}{$settings{'SESSION_TIME'}} = "selected";
 
        print <<END;
@@ -330,12 +328,17 @@ if ($settings{'AUTH'} eq 'TERMS') {
                        <td>$Lang::tr{'Captive client session expiry time'}</td>
                        <td>
                                <select name="SESSION_TIME">
-                                       <option value="0"        $selected{'SESSION_TIME'}{'0'}>- $Lang::tr{'unlimited'} -</option>
-                                       <option value="3600"     $selected{'SESSION_TIME'}{'3600'}>$Lang::tr{'one hour'}</option>
-                                       <option value="28800"    $selected{'SESSION_TIME'}{'28800'}>$Lang::tr{'eight hours'}</option>
-                                       <option value="86400"    $selected{'SESSION_TIME'}{'86400'}>$Lang::tr{'24 hours'}</option>
-                                       <option value="604800"   $selected{'SESSION_TIME'}{'604800'}>$Lang::tr{'one week'}</option>
-                                       <option value="18144000" $selected{'SESSION_TIME'}{'18144000'}>$Lang::tr{'one month'}</option>
+END
+
+       foreach my $session_time (sort { $a <=> $b } keys %session_times) {
+               print <<END;
+                                       <option value="$session_time" $selected{'SESSION_TIME'}{$session_time}>
+                                               $session_times{$session_time}
+                                       </option>
+END
+       }
+
+       print <<END;
                                </select>
                        </td>
                </tr>
@@ -431,7 +434,14 @@ sub gencode(){
 }
 
 sub coupons() {
-       &Header::openbox('100%', 'left', $Lang::tr{'Captive generate coupon'});
+       &Header::openbox('100%', 'left', $Lang::tr{'Captive generate coupons'});
+
+       $selected{'SESSION_TIME'} = ();
+       foreach my $session_time (keys %session_times) {
+               $selected{'SESSION_TIME'}{$session_time} = "";
+       }
+       $selected{'SESSION_TIME'}{$settings{'SESSION_TIME'}} = "selected";
+
        print <<END;
                <form method='post' action='$ENV{'SCRIPT_NAME'}'>
                        <table border='0' width='100%'>
@@ -440,108 +450,51 @@ sub coupons() {
                                                $Lang::tr{'Captive vouchervalid'}
                                        </td>
                                        <td width='70%'>
-                                               <table class='tbl' border='0' width='100%'>
-                                                       <tr>
-                                                               <th>$Lang::tr{'hours'}</th>
-                                                               <th>$Lang::tr{'days'}</th>
-                                                               <th>$Lang::tr{'weeks'}</th>
-                                                               <th>$Lang::tr{'months'}</th>
-                                                               <th></th>
-                                                       </tr>
+                                               <select name="SESSION_TIME">
 END
 
-               #print hour-dropdownbox
-               my $hrs=3600;
-               print "<tr height='40px'><td><select name='EXP_HOUR' style='width:8em;'>";
-               print "<option value='0' ";
-               print " selected='selected'" if ($settings{'EXP_HOUR'} eq '0');
-               print ">--</option>";
-               for (my $i = 1; $i<25; $i++){
-                       my $exp_sec = $i * $hrs;
-                       print "<option value='$exp_sec' ";
-                       print " selected='selected'" if ($settings{'EXP_HOUR'} eq $exp_sec);
-                       print ">$i</option>";
-               }
-               print "</td><td>";
-
-               #print day-dropdownbox
-               my $days=3600*24;
-               print "<select name='EXP_DAY' style='width:8em;'>";
-               print "<option value='0' ";
-               print " selected='selected'" if ($settings{'EXP_DAY'} eq '0');
-               print ">--</option>";
-               for (my $i = 1; $i<8; $i++){
-                       my $exp_sec = $i * $days;
-                       print "<option value='$exp_sec' ";
-                       print " selected='selected'" if ($settings{'EXP_DAY'} eq $exp_sec);
-                       print ">$i</option>";
-               }
-               print "</td><td>";
-
-               #print week-dropdownbox
-               my $week=3600*24*7;
-               print "<select name='EXP_WEEK' style='width:8em;'>";
-               print "<option value='0' ";
-               print " selected='selected'" if ($settings{'EXP_WEEK'} eq '0');
-               print ">--</option>";
-               for (my $i = 1; $i<5; $i++){
-                       my $exp_sec = $i * $week;
-                       print "<option value='$exp_sec' ";
-                       print " selected='selected'" if ($settings{'EXP_WEEK'} eq $exp_sec);
-                       print ">$i</option>";
-               }
-               print "</td><td>";
-
-               #print month-dropdownbox
-               my $month=3600*24*30;
-               print "<select name='EXP_MONTH' style='width:8em;'>";
-               print "<option value='0' ";
-               print " selected='selected'" if ($settings{'EXP_MONTH'} eq '0');
-               print ">--</option>";
-               for (my $i = 1; $i<13; $i++){
-                       my $exp_sec = $i * $month;
-                       print "<option value='$exp_sec' ";
-                       print " selected='selected'" if ($settings{'EXP_MONTH'} eq $exp_sec);
-                       print ">$i</option>";
-               }
+       foreach my $session_time (sort { $a <=> $b } keys %session_times) {
                print <<END;
-                                                               </td>
-                                                               <td>
-                                                                       <label>
-                                                                               <input type='checkbox' name='UNLIMITED' $checked{'UNLIMITED'}{'on'} />
-                                                                               $Lang::tr{'Captive nolimit'}
-                                                                       </label>
-                                                               </td>
-                                                       </tr>
-                                               </table>
+                                                       <option value="$session_time" $selected{'SESSION_TIME'}{$session_time}>
+                                                               $session_times{$session_time}
+                                                       </option>
+END
+       }
+
+       print <<END;
+                                               </select>
                                        </td>
                                </tr>
                                <tr>
                                        <td>$Lang::tr{'remark'}</td>
                                        <td>
-                                               <input type='text' style='width: 98%;' name='REMARK' align='left'>
+                                               <input type='text' name='REMARK' size=40>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>$Lang::tr{'Captive generated coupon no'}</td>
+                                       <td>
+                                               <select name="COUNT">
+                                                       <option value="1">1</option>
+                                                       <option value="2">2</option>
+                                                       <option value="3">3</option>
+                                                       <option value="4">4</option>
+                                                       <option value="5">5</option>
+                                                       <option value="6">6</option>
+                                                       <option value="7">7</option>
+                                                       <option value="8">8</option>
+                                                       <option value="9">9</option>
+                                                       <option value="10">10</option>
+                                                       <option value="20">20</option>
+                                                       <option value="50">50</option>
+                                                       <option value="100">100</option>
+                                               </select>
                                        </td>
                                </tr>
                        </table>
 
                        <div align="right">
-                               <select name="COUNT">
-                                       <option value="1">1</option>
-                                       <option value="2">2</option>
-                                       <option value="3">3</option>
-                                       <option value="4">4</option>
-                                       <option value="5">5</option>
-                                       <option value="6">6</option>
-                                       <option value="7">7</option>
-                                       <option value="8">8</option>
-                                       <option value="9">9</option>
-                                       <option value="10">10</option>
-                                       <option value="20">20</option>
-                                       <option value="50">50</option>
-                                       <option value="100">100</option>
-                               </select>
-
-                               <input type="submit" name="ACTION" value="$Lang::tr{'Captive generate coupon'}">
+                               <input type="submit" name="ACTION" value="$Lang::tr{'Captive generate coupons'}">
                        </div>
                </form>
 END
index 1398329d35b697311dca27753608b5f717d79585..65af2bd18772be290bbbca79dcaae263f1e327f2 100644 (file)
@@ -30,7 +30,8 @@
 'Captive expire' => 'Ablauf',
 'Captive expiry time' => 'Ablaufzeit',
 'Captive export coupons' => 'Coupons exportieren',
-'Captive generate coupon' => 'Coupon generieren',
+'Captive generate coupons' => 'Coupons generieren',
+'Captive generated coupon no' => 'Anzahl der generierten Coupons',
 'Captive genvoucher' => 'Gutschein generieren',
 'Captive invalid logosize' => 'Die hochgeladene Datei entspricht nicht der vorgegeben Auflösung von mindestens 1280x400 und maximal 1920x800 Pixeln',
 'Captive invalid_voucher' => 'Dieser Code ist ungültig. Bitte versuchen Sie es erneut',
 'forwarding rule added' => 'Weiterleitungsregel hinzugefügt. Starte Weiterleitung neu',
 'forwarding rule removed' => 'Weiterleitungsregel entfernt. Starte Weiterleitung neu',
 'forwarding rule updated' => 'Weiterleitungsregel aktualisiert; starte Weiterleitung neu',
+'four hours' => '4 Stunden',
 'free' => 'Frei',
 'free memory' => 'Freier Speicher   ',
 'free swap' => 'Freier Swap',
 'ok' => 'OK',
 'older' => 'Älter',
 'on' => 'on',
+'one year' => 'Ein Jahr',
 'online help en' => 'Online-Hilfe (auf Deutsch)',
 'only digits allowed in holdoff field' => 'Im Holdoff-Feld sind nur Ziffern erlaubt',
 'only digits allowed in max retries field' => 'Im Feld &quot;Maximale Wiederholversuche&quot; sind nur Ziffern erlaubt.',
 'tripwirewarningkeys' => 'ACHTUNG - Sie löschen hiermit ihre bestehenden Schlüssel, ihre Konfiguration und Datenbank und legen alles neu an.',
 'tripwirewarningpolicy' => 'ACHTUNG - Ihr Policy wird neu erzeugt, anschließen wird die Datenbank neu initialisiert. Hierfür wird der Site-Key und Local-Key benötigt.',
 'tuesday' => 'Dienstag',
+'twelve hours' => '12 Stunden',
+'two weeks' => 'Zwei Wochen',
 'type' => 'Typ',
 'umount' => 'Abmelden',
 'umount removable media before to unplug' => 'Wechselmedien vor dem Entfernen unbedingt abmelden',
index 29c87dbd4089dbd09e5d8d4c890a4e92211dae03..915cb5dae9243d47b40f702023269c0445ad8515 100644 (file)
@@ -30,7 +30,8 @@
 'Captive expire' => 'Expire',
 'Captive expiry time' => 'Expiry Time',
 'Captive export coupons' => 'Export Coupons',
-'Captive generate coupon' => 'Generate Coupon',
+'Captive generate coupons' => 'Generate Coupons',
+'Captive generated coupon no' => 'Number of coupons',
 'Captive heading terms' => 'Terms &amp; Conditions',
 'Captive heading voucher' => 'Voucher or Access Code',
 'Captive invalid coupon' => 'You entered an invalid coupon code. Please try again.',
 'forwarding rule added' => 'Forwarding rule added; restarting forwarder',
 'forwarding rule removed' => 'Forwarding rule removed; restarting forwarder',
 'forwarding rule updated' => 'Forwarding rule updated; restarting forwarder',
+'four hours' => '4 Hours',
 'free' => 'Free',
 'free memory' => 'Free Memory    ',
 'free swap' => 'Free Swap',
 'one hour' => 'One Hour',
 'one month' => 'One Month',
 'one week' => 'One Week',
+'one year' => 'One Year',
 'online help en' => 'Online help (in english)',
 'only digits allowed in holdoff field' => 'Only digits allowed in holdoff field',
 'only digits allowed in max retries field' => 'Only digits allowed in max retries field.',
 'tripwirewarningkeys' => 'WARNING - This will erase your current keys, config, and database and generate them new.',
 'tripwirewarningpolicy' => 'WARNING - Your policy will be rebuild, after that your database will be reinitalised. Therefor the site-key and the local-key are neeeded.',
 'tuesday' => 'Tuesday',
+'twelve hours' => '12 Hours',
+'two weeks' => 'Two Weeks',
 'type' => 'Type',
 'umount' => 'Umount',
 'umount removable media before to unplug' => 'Umount removable media before unplugging the device',