Patch for bug 323627: Setting "loginnetmask" to 0 should disable IP checking; patch by Jesse Erlbaum <jesse@erlbaum.net>, r=vladd, a=justdave.
git-svn-id: svn://10.0.0.236/trunk@190675 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f61e4e42c5
commit
2d07f5f5a5
@ -55,7 +55,7 @@ sub has_db {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# Returns the network address for a given ip
|
||||
# Returns the network address for a given IP
|
||||
sub get_netaddr {
|
||||
my $ipaddr = shift;
|
||||
|
||||
@ -68,6 +68,9 @@ sub get_netaddr {
|
||||
|
||||
my $maskbits = Param('loginnetmask');
|
||||
|
||||
# Make Bugzilla ignore the IP address if loginnetmask is set to 0
|
||||
return "0.0.0.0" if ($maskbits == 0);
|
||||
|
||||
$addr >>= (32-$maskbits);
|
||||
$addr <<= (32-$maskbits);
|
||||
return join(".", unpack("CCCC", pack("N", $addr)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user