]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
captive: Fix bug with multiple license clients
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 4 Sep 2016 08:57:26 +0000 (09:57 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Sep 2017 17:54:45 +0000 (18:54 +0100)
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>
html/cgi-bin/captive/index.cgi

index 30fd055d8bf0b4d6bd7bd055971864d6297db6f0..c3f9d035f40ad9c4eff32e0292b5fc39c0f669cb 100755 (executable)
@@ -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] = "";}