captive: Fix bug with multiple license clients

If one active client with a license existed, any other client
authenticating will overwrite the configuration line.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2016-09-04 09:57:26 +01:00
parent abc41f02dd
commit 11fc9575d7

View File

@@ -54,8 +54,6 @@ unless (-f $clients){ system("touch $clients"); }
#Actions
if ($cgiparams{'ACTION'} eq "$Lang::tr{'gpl i accept these terms and conditions'}"){
my $key = &General::findhasharraykey(\%clientshash);
#Get Clients IP-Address
my $ip_address = $ENV{X_FORWARDED_FOR} || $ENV{REMOTE_ADDR} ||"";
@@ -64,6 +62,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'gpl i accept these terms and conditions'
$mac_address =~ s/\n+\z//;
&General::readhasharray("$clients", \%clientshash);
my $key = &General::findhasharraykey(\%clientshash);
if (!$errormessage){
foreach my $i (0 .. 5) { $clientshash{$key}[$i] = "";}