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
|
|
@ -9,4 +9,5 @@ insert into international (internationalId,languageId,namespace,message,lastUpda
|
|||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (31,1,'MailForm','is not filled in correctly.', 1045210016);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (32,1,'MailForm','is not a valid email address.', 1045210016);
|
||||
update international set message="Possible Values" where namespace = "MailForm" and internationalId = 24 and languageId=1;
|
||||
alter table groups change ipFilter ipFilter text;
|
||||
|
||||
|
|
|
|||
|
|
@ -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