mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-18 23:12:59 +02:00
captive: Rename "License" mode to "Terms & Conditions"
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -3,6 +3,7 @@ WARNING: translation string unused: Captive 1day
|
||||
WARNING: translation string unused: Captive 1month
|
||||
WARNING: translation string unused: Captive 1week
|
||||
WARNING: translation string unused: Captive activate
|
||||
WARNING: translation string unused: Captive auth_lic
|
||||
WARNING: translation string unused: Captive invalid_voucher
|
||||
WARNING: translation string unused: Captive ip
|
||||
WARNING: translation string unused: Captive nr
|
||||
@@ -675,8 +676,9 @@ WARNING: translation string unused: year-graph
|
||||
WARNING: translation string unused: yearly firewallhits
|
||||
WARNING: untranslated string: Captive GAIN ACCESS
|
||||
WARNING: untranslated string: Captive agree tac
|
||||
WARNING: untranslated string: Captive heading tac
|
||||
WARNING: untranslated string: Captive heading terms
|
||||
WARNING: untranslated string: Captive heading voucher
|
||||
WARNING: untranslated string: Captive terms
|
||||
WARNING: untranslated string: Scan for Songs
|
||||
WARNING: untranslated string: addons
|
||||
WARNING: untranslated string: bytes
|
||||
|
||||
@@ -3,6 +3,7 @@ WARNING: translation string unused: Captive 1day
|
||||
WARNING: translation string unused: Captive 1month
|
||||
WARNING: translation string unused: Captive 1week
|
||||
WARNING: translation string unused: Captive activate
|
||||
WARNING: translation string unused: Captive auth_lic
|
||||
WARNING: translation string unused: Captive invalid_voucher
|
||||
WARNING: translation string unused: Captive ip
|
||||
WARNING: translation string unused: Captive nr
|
||||
|
||||
@@ -623,7 +623,6 @@ WARNING: untranslated string: Captive GAIN ACCESS
|
||||
WARNING: untranslated string: Captive activated
|
||||
WARNING: untranslated string: Captive active on
|
||||
WARNING: untranslated string: Captive agree tac
|
||||
WARNING: untranslated string: Captive auth_lic
|
||||
WARNING: untranslated string: Captive auth_vou
|
||||
WARNING: untranslated string: Captive authentication
|
||||
WARNING: untranslated string: Captive brand color
|
||||
@@ -631,7 +630,7 @@ WARNING: untranslated string: Captive config
|
||||
WARNING: untranslated string: Captive err doublevoucher
|
||||
WARNING: untranslated string: Captive expire
|
||||
WARNING: untranslated string: Captive genvoucher
|
||||
WARNING: untranslated string: Captive heading tac
|
||||
WARNING: untranslated string: Captive heading terms
|
||||
WARNING: untranslated string: Captive heading voucher
|
||||
WARNING: untranslated string: Captive invalid logosize
|
||||
WARNING: untranslated string: Captive logo_set
|
||||
@@ -641,6 +640,7 @@ WARNING: untranslated string: Captive mac
|
||||
WARNING: untranslated string: Captive menu
|
||||
WARNING: untranslated string: Captive noexpiretime
|
||||
WARNING: untranslated string: Captive nolimit
|
||||
WARNING: untranslated string: Captive terms
|
||||
WARNING: untranslated string: Captive title
|
||||
WARNING: untranslated string: Captive voactive
|
||||
WARNING: untranslated string: Captive voucher
|
||||
|
||||
@@ -633,7 +633,6 @@ WARNING: untranslated string: Captive GAIN ACCESS
|
||||
WARNING: untranslated string: Captive activated
|
||||
WARNING: untranslated string: Captive active on
|
||||
WARNING: untranslated string: Captive agree tac
|
||||
WARNING: untranslated string: Captive auth_lic
|
||||
WARNING: untranslated string: Captive auth_vou
|
||||
WARNING: untranslated string: Captive authentication
|
||||
WARNING: untranslated string: Captive brand color
|
||||
@@ -641,7 +640,7 @@ WARNING: untranslated string: Captive config
|
||||
WARNING: untranslated string: Captive err doublevoucher
|
||||
WARNING: untranslated string: Captive expire
|
||||
WARNING: untranslated string: Captive genvoucher
|
||||
WARNING: untranslated string: Captive heading tac
|
||||
WARNING: untranslated string: Captive heading terms
|
||||
WARNING: untranslated string: Captive heading voucher
|
||||
WARNING: untranslated string: Captive invalid logosize
|
||||
WARNING: untranslated string: Captive logo_set
|
||||
@@ -651,6 +650,7 @@ WARNING: untranslated string: Captive mac
|
||||
WARNING: untranslated string: Captive menu
|
||||
WARNING: untranslated string: Captive noexpiretime
|
||||
WARNING: untranslated string: Captive nolimit
|
||||
WARNING: untranslated string: Captive terms
|
||||
WARNING: untranslated string: Captive title
|
||||
WARNING: untranslated string: Captive voactive
|
||||
WARNING: untranslated string: Captive voucher
|
||||
|
||||
@@ -700,7 +700,6 @@ WARNING: untranslated string: Captive GAIN ACCESS
|
||||
WARNING: untranslated string: Captive activated
|
||||
WARNING: untranslated string: Captive active on
|
||||
WARNING: untranslated string: Captive agree tac
|
||||
WARNING: untranslated string: Captive auth_lic
|
||||
WARNING: untranslated string: Captive auth_vou
|
||||
WARNING: untranslated string: Captive authentication
|
||||
WARNING: untranslated string: Captive brand color
|
||||
@@ -708,7 +707,7 @@ WARNING: untranslated string: Captive config
|
||||
WARNING: untranslated string: Captive err doublevoucher
|
||||
WARNING: untranslated string: Captive expire
|
||||
WARNING: untranslated string: Captive genvoucher
|
||||
WARNING: untranslated string: Captive heading tac
|
||||
WARNING: untranslated string: Captive heading terms
|
||||
WARNING: untranslated string: Captive heading voucher
|
||||
WARNING: untranslated string: Captive invalid logosize
|
||||
WARNING: untranslated string: Captive logo_set
|
||||
@@ -718,6 +717,7 @@ WARNING: untranslated string: Captive mac
|
||||
WARNING: untranslated string: Captive menu
|
||||
WARNING: untranslated string: Captive noexpiretime
|
||||
WARNING: untranslated string: Captive nolimit
|
||||
WARNING: untranslated string: Captive terms
|
||||
WARNING: untranslated string: Captive title
|
||||
WARNING: untranslated string: Captive voactive
|
||||
WARNING: untranslated string: Captive voucher
|
||||
|
||||
@@ -696,7 +696,6 @@ WARNING: untranslated string: Captive GAIN ACCESS
|
||||
WARNING: untranslated string: Captive activated
|
||||
WARNING: untranslated string: Captive active on
|
||||
WARNING: untranslated string: Captive agree tac
|
||||
WARNING: untranslated string: Captive auth_lic
|
||||
WARNING: untranslated string: Captive auth_vou
|
||||
WARNING: untranslated string: Captive authentication
|
||||
WARNING: untranslated string: Captive brand color
|
||||
@@ -704,7 +703,7 @@ WARNING: untranslated string: Captive config
|
||||
WARNING: untranslated string: Captive err doublevoucher
|
||||
WARNING: untranslated string: Captive expire
|
||||
WARNING: untranslated string: Captive genvoucher
|
||||
WARNING: untranslated string: Captive heading tac
|
||||
WARNING: untranslated string: Captive heading terms
|
||||
WARNING: untranslated string: Captive heading voucher
|
||||
WARNING: untranslated string: Captive invalid logosize
|
||||
WARNING: untranslated string: Captive logo_set
|
||||
@@ -714,6 +713,7 @@ WARNING: untranslated string: Captive mac
|
||||
WARNING: untranslated string: Captive menu
|
||||
WARNING: untranslated string: Captive noexpiretime
|
||||
WARNING: untranslated string: Captive nolimit
|
||||
WARNING: untranslated string: Captive terms
|
||||
WARNING: untranslated string: Captive title
|
||||
WARNING: untranslated string: Captive voactive
|
||||
WARNING: untranslated string: Captive voucher
|
||||
|
||||
@@ -623,7 +623,6 @@ WARNING: untranslated string: Captive GAIN ACCESS
|
||||
WARNING: untranslated string: Captive activated
|
||||
WARNING: untranslated string: Captive active on
|
||||
WARNING: untranslated string: Captive agree tac
|
||||
WARNING: untranslated string: Captive auth_lic
|
||||
WARNING: untranslated string: Captive auth_vou
|
||||
WARNING: untranslated string: Captive authentication
|
||||
WARNING: untranslated string: Captive brand color
|
||||
@@ -631,7 +630,7 @@ WARNING: untranslated string: Captive config
|
||||
WARNING: untranslated string: Captive err doublevoucher
|
||||
WARNING: untranslated string: Captive expire
|
||||
WARNING: untranslated string: Captive genvoucher
|
||||
WARNING: untranslated string: Captive heading tac
|
||||
WARNING: untranslated string: Captive heading terms
|
||||
WARNING: untranslated string: Captive heading voucher
|
||||
WARNING: untranslated string: Captive invalid logosize
|
||||
WARNING: untranslated string: Captive logo_set
|
||||
@@ -641,6 +640,7 @@ WARNING: untranslated string: Captive mac
|
||||
WARNING: untranslated string: Captive menu
|
||||
WARNING: untranslated string: Captive noexpiretime
|
||||
WARNING: untranslated string: Captive nolimit
|
||||
WARNING: untranslated string: Captive terms
|
||||
WARNING: untranslated string: Captive title
|
||||
WARNING: untranslated string: Captive voactive
|
||||
WARNING: untranslated string: Captive voucher
|
||||
|
||||
@@ -625,7 +625,6 @@ WARNING: untranslated string: Captive GAIN ACCESS
|
||||
WARNING: untranslated string: Captive activated
|
||||
WARNING: untranslated string: Captive active on
|
||||
WARNING: untranslated string: Captive agree tac
|
||||
WARNING: untranslated string: Captive auth_lic
|
||||
WARNING: untranslated string: Captive auth_vou
|
||||
WARNING: untranslated string: Captive authentication
|
||||
WARNING: untranslated string: Captive brand color
|
||||
@@ -633,7 +632,7 @@ WARNING: untranslated string: Captive config
|
||||
WARNING: untranslated string: Captive err doublevoucher
|
||||
WARNING: untranslated string: Captive expire
|
||||
WARNING: untranslated string: Captive genvoucher
|
||||
WARNING: untranslated string: Captive heading tac
|
||||
WARNING: untranslated string: Captive heading terms
|
||||
WARNING: untranslated string: Captive heading voucher
|
||||
WARNING: untranslated string: Captive invalid logosize
|
||||
WARNING: untranslated string: Captive logo_set
|
||||
@@ -643,6 +642,7 @@ WARNING: untranslated string: Captive mac
|
||||
WARNING: untranslated string: Captive menu
|
||||
WARNING: untranslated string: Captive noexpiretime
|
||||
WARNING: untranslated string: Captive nolimit
|
||||
WARNING: untranslated string: Captive terms
|
||||
WARNING: untranslated string: Captive title
|
||||
WARNING: untranslated string: Captive voactive
|
||||
WARNING: untranslated string: Captive voucher
|
||||
|
||||
@@ -708,7 +708,6 @@ WARNING: untranslated string: Captive GAIN ACCESS
|
||||
WARNING: untranslated string: Captive activated
|
||||
WARNING: untranslated string: Captive active on
|
||||
WARNING: untranslated string: Captive agree tac
|
||||
WARNING: untranslated string: Captive auth_lic
|
||||
WARNING: untranslated string: Captive auth_vou
|
||||
WARNING: untranslated string: Captive authentication
|
||||
WARNING: untranslated string: Captive brand color
|
||||
@@ -716,7 +715,7 @@ WARNING: untranslated string: Captive config
|
||||
WARNING: untranslated string: Captive err doublevoucher
|
||||
WARNING: untranslated string: Captive expire
|
||||
WARNING: untranslated string: Captive genvoucher
|
||||
WARNING: untranslated string: Captive heading tac
|
||||
WARNING: untranslated string: Captive heading terms
|
||||
WARNING: untranslated string: Captive heading voucher
|
||||
WARNING: untranslated string: Captive invalid logosize
|
||||
WARNING: untranslated string: Captive logo_set
|
||||
@@ -726,6 +725,7 @@ WARNING: untranslated string: Captive mac
|
||||
WARNING: untranslated string: Captive menu
|
||||
WARNING: untranslated string: Captive noexpiretime
|
||||
WARNING: untranslated string: Captive nolimit
|
||||
WARNING: untranslated string: Captive terms
|
||||
WARNING: untranslated string: Captive title
|
||||
WARNING: untranslated string: Captive voactive
|
||||
WARNING: untranslated string: Captive voucher
|
||||
|
||||
@@ -101,14 +101,15 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}"){
|
||||
|
||||
&General::writehash("$settingsfile", \%settings);
|
||||
|
||||
#write Licensetext if defined
|
||||
if ($cgiparams{'AGB'}){
|
||||
$cgiparams{'AGB'} = &Header::escape($cgiparams{'AGB'});
|
||||
open( FH, ">:utf8", "/var/ipfire/captive/agb.txt" ) or die("$!");
|
||||
print FH $cgiparams{'AGB'};
|
||||
close( FH );
|
||||
$cgiparams{'AGB'}="";
|
||||
# Save terms
|
||||
if ($cgiparams{'TERMS'}){
|
||||
$cgiparams{'TERMS'} = &Header::escape($cgiparams{'TERMS'});
|
||||
open(FH, ">:utf8", "/var/ipfire/captive/terms.txt") or die("$!");
|
||||
print FH $cgiparams{'TERMS'};
|
||||
close(FH);
|
||||
$cgiparams{'TERMS'} = "";
|
||||
}
|
||||
|
||||
#execute binary to reload firewall rules
|
||||
system("/usr/local/bin/captivectrl");
|
||||
|
||||
@@ -224,14 +225,16 @@ if ($cgiparams{'ACTION'} eq 'delvoucherinuse'){
|
||||
#call config() to display the configuration box
|
||||
&config();
|
||||
|
||||
sub getagb(){
|
||||
#open textfile from /var/ipfire/captive/agb.txt
|
||||
open( my $handle, "<:utf8", "/var/ipfire/captive/agb.txt" ) or die("$!");
|
||||
while(<$handle>){
|
||||
#read line by line and print on screen
|
||||
$cgiparams{'AGB'}.= HTML::Entities::decode_entities($_);
|
||||
}
|
||||
close( $handle );
|
||||
sub getterms(){
|
||||
my @ret;
|
||||
|
||||
open(FILE, "<:utf8", "/var/ipfire/captive/terms.txt");
|
||||
while(<FILE>) {
|
||||
push(@ret, HTML::Entities::decode_entities($_));
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
return join(/\n/, @ret);
|
||||
}
|
||||
|
||||
sub config(){
|
||||
@@ -282,12 +285,12 @@ print<<END
|
||||
$Lang::tr{'Captive authentication'}
|
||||
</td>
|
||||
<td><br>
|
||||
<select name='AUTH' style='width:8em;'>
|
||||
<select name='AUTH'>
|
||||
END
|
||||
;
|
||||
print "<option value='LICENSE' ";
|
||||
print " selected='selected'" if ($settings{'AUTH'} eq 'LICENSE');
|
||||
print ">$Lang::tr{'Captive auth_lic'}</option>";
|
||||
print "<option value='TERMS' ";
|
||||
print " selected='selected'" if ($settings{'AUTH'} eq 'TERMS');
|
||||
print ">$Lang::tr{'Captive terms'}</option>";
|
||||
|
||||
print "<option value='VOUCHER' ";
|
||||
print " selected='selected'" if ($settings{'AUTH'} eq 'VOUCHER');
|
||||
@@ -299,7 +302,17 @@ END
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
if ($settings{'AUTH'} eq 'LICENSE'){ &agbbox(); };
|
||||
if ($settings{'AUTH'} eq 'TERMS') {
|
||||
my $terms = &getterms();
|
||||
print <<END;
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<textarea cols="50" rows="10" name="TERMS">$terms</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
END
|
||||
}
|
||||
|
||||
#Logo Upload
|
||||
print "<tr><td><br>$Lang::tr{'Captive logo_upload'}<br>$Lang::tr{'Captive logo_upload1'}</td><td><br><INPUT TYPE='file' NAME='uploaded_file' SIZE=30 MAXLENGTH=80></td></tr><tr>";
|
||||
@@ -343,22 +356,6 @@ END
|
||||
}
|
||||
}
|
||||
|
||||
sub agbbox(){
|
||||
&getagb();
|
||||
print<<END
|
||||
<tr>
|
||||
<td>
|
||||
License agreement
|
||||
</td>
|
||||
<td>
|
||||
<br>
|
||||
<textarea cols="50" rows="10" name="AGB">$cgiparams{'AGB'}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
|
||||
sub gencode(){
|
||||
#generate a random code only letters from A-Z except 'O' and 0-9
|
||||
my @chars = ("A".."N", "P".."Z", "0".."9");
|
||||
|
||||
@@ -151,12 +151,12 @@ $tmpl->param(TITLE => $settings{'TITLE'});
|
||||
$tmpl->param(COLOR => $settings{'COLOR'});
|
||||
$tmpl->param(ERROR => $errormessage);
|
||||
|
||||
$tmpl->param(TAC => &gettac());
|
||||
$tmpl->param(TERMS => &getterms());
|
||||
|
||||
# Some translated strings
|
||||
$tmpl->param(L_ACTIVATE => $Lang::tr{'Captive ACTIVATE'});
|
||||
$tmpl->param(L_GAIN_ACCESS => $Lang::tr{'Captive GAIN ACCESS'});
|
||||
$tmpl->param(L_HEADING_TAC => $Lang::tr{'Captive heading tac'});
|
||||
$tmpl->param(L_HEADING_TERMS => $Lang::tr{'Captive heading terms'});
|
||||
$tmpl->param(L_HEADING_VOUCHER => $Lang::tr{'Captive heading voucher'});
|
||||
$tmpl->param(L_AGREE_TAC => $Lang::tr{'Captive agree tac'});
|
||||
|
||||
@@ -201,20 +201,20 @@ sub getcgihash {
|
||||
return;
|
||||
}
|
||||
|
||||
sub gettac() {
|
||||
my @tac = ();
|
||||
sub getterms() {
|
||||
my @terms = ();
|
||||
|
||||
open(my $handle, "<:utf8", "/var/ipfire/captive/agb.txt" ) or die("$!");
|
||||
open(my $handle, "<:utf8", "/var/ipfire/captive/terms.txt");
|
||||
while(<$handle>) {
|
||||
$_ = HTML::Entities::decode_entities($_);
|
||||
push(@tac, $_);
|
||||
push(@terms, $_);
|
||||
}
|
||||
close($handle);
|
||||
|
||||
my $tac = join("\n", @tac);
|
||||
my $terms = join("\n", @terms);
|
||||
|
||||
# Format paragraphs
|
||||
$tac =~ s/\n\n/<\/p>\n<p>/g;
|
||||
$terms =~ s/\n\n/<\/p>\n<p>/g;
|
||||
|
||||
return $tac;
|
||||
return $terms;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<TMPL_IF NAME="VOUCHER">
|
||||
<h4><TMPL_VAR NAME="L_HEADING_VOUCHER"></h4>
|
||||
<TMPL_ELSE>
|
||||
<h4><TMPL_VAR NAME="L_HEADING_TAC"></h4>
|
||||
<h4><TMPL_VAR NAME="L_HEADING_TERMS"></h4>
|
||||
</TMPL_IF>
|
||||
|
||||
<form action="" method="POST">
|
||||
@@ -50,19 +50,19 @@
|
||||
value="<TMPL_VAR NAME="L_GAIN_ACCESS">">
|
||||
</TMPL_IF>
|
||||
|
||||
<TMPL_IF NAME="TAC">
|
||||
<TMPL_IF NAME="TERMS">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input class="form-checkbox" type="checkbox">
|
||||
<TMPL_VAR NAME="L_AGREE_TAC">
|
||||
<TMPL_VAR NAME="L_AGREE_TERMS">
|
||||
</label>
|
||||
</div>
|
||||
</TMPL_IF>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<TMPL_IF NAME="TAC">
|
||||
<TMPL_VAR NAME="TAC">
|
||||
<TMPL_IF NAME="TERMS">
|
||||
<TMPL_VAR NAME="TERMS">
|
||||
</TMPL_IF>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
'Captive err doublevoucher' => 'A voucher with this code already exists',
|
||||
'Captive expire' => 'Expire',
|
||||
'Captive genvoucher' => 'Generate voucher',
|
||||
'Captive heading tac' => 'Terms & Conditions',
|
||||
'Captive heading terms' => 'Terms & Conditions',
|
||||
'Captive heading voucher' => 'Voucher or Access Code',
|
||||
'Captive invalid logosize' => 'The uploaded image file does not meet the required resolution of at least 1280x400 but not larger than 1920x800 pixels',
|
||||
'Captive invalid_voucher' => 'Invalid code. Please try again',
|
||||
@@ -37,6 +37,7 @@
|
||||
'Captive noexpiretime' => 'No valid connection time range given',
|
||||
'Captive nolimit' => 'unlimited',
|
||||
'Captive nr' => 'Number',
|
||||
'Captive terms' => 'Terms & Conditions',
|
||||
'Captive time' => 'Access time post activation (hours)',
|
||||
'Captive title' => 'Title of Login Page',
|
||||
'Captive voactive' => 'Active Vouchers',
|
||||
|
||||
Reference in New Issue
Block a user