From: Michal Vaner Date: Mon, 8 Sep 2008 14:31:36 +0000 (+0200) Subject: Do not check login IP X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=96fd18c136c5d0b199d71170d67205c7f0165b9c;p=pciids.git Do not check login IP --- diff --git a/PciIds/Users.pm b/PciIds/Users.pm index 1e50607..c44bc3b 100644 --- a/PciIds/Users.pm +++ b/PciIds/Users.pm @@ -91,16 +91,14 @@ sub genAuthToken( $$$$$ ) { } my $haveRights = scalar @{$rights}; my $time = time; - my $ip = $req->connection()->remote_ip(); - return "$id:$haveRights:$time:".md5_hex( "$id:$time:$ip:".$config{'authsalt'} ).":$name"; + return "$id:$haveRights:$time:".md5_hex( "$id:$time:".$config{'authsalt'} ).":$name"; } sub checkAuthToken( $$$ ) { my( $tables, $req, $token ) = @_; my( $id, $haveRights, $time, $hex, $name ) = defined( $token ) ? split( /:/, $token ) : (); return ( 0, 0, 0, [], "Not logged in", undef ) unless( defined $hex ); - my $ip = $req->connection()->remote_ip(); - my $expected = md5_hex( "$id:$time:$ip:".$config{'authsalt'} ); + my $expected = md5_hex( "$id:$time:".$config{'authsalt'} ); my $actTime = time; my $tokOk = ( $expected eq $hex ); my $authed = ( $tokOk && ( $time + $config{'authtime'} > $actTime ) );