From: Michael Tremer Date: Sun, 4 Sep 2016 08:57:26 +0000 (+0100) Subject: captive: Fix bug with multiple license clients X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11fc9575d79644d7830eca59cf90b0d0393bf32b;p=people%2Fms%2Fipfire-2.x.git 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 --- diff --git a/html/cgi-bin/captive/index.cgi b/html/cgi-bin/captive/index.cgi index 30fd055d8b..c3f9d035f4 100755 --- a/html/cgi-bin/captive/index.cgi +++ b/html/cgi-bin/captive/index.cgi @@ -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] = "";}