Changed ip groups to support more ip addresses and be more forgiving about formatting.
This commit is contained in:
parent
73ff7fb959
commit
de1d5834ac
3 changed files with 6 additions and 1 deletions
|
|
@ -132,7 +132,7 @@ sub www_editGroup {
|
|||
if ($session{setting}{useKarma}) {
|
||||
$f->integer("karmaThreshold",WebGUI::International::get(538),$g->karmaThreshold);
|
||||
}
|
||||
$f->text(
|
||||
$f->textarea(
|
||||
-name=>"ipFilter",
|
||||
-value=>$g->ipFilter,
|
||||
-label=>WebGUI::International::get(857)
|
||||
|
|
|
|||
|
|
@ -236,6 +236,10 @@ sub isInGroup {
|
|||
%group = WebGUI::SQL->quickHash("select karmaThreshold,ipFilter from groups where groupId='$gid'");
|
||||
### Check IP Address
|
||||
if ($group{ipFilter} ne "") {
|
||||
$group{ipFilter} =~ s/\t//g;
|
||||
$group{ipFilter} =~ s/\r//g;
|
||||
$group{ipFilter} =~ s/\n//g;
|
||||
$group{ipFilter} =~ s/\s//g;
|
||||
my @ips = split(";",$group{ipFilter});
|
||||
foreach my $ip (@ips) {
|
||||
if ($session{env}{REMOTE_ADDR} =~ /^$ip/) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue