Fix User.t so that it assigns IPs in a way that works with the new isInGroup code.

User.pm: Collapse all methods into getUsers(1) inside isInGroup
Group.pm: Disable the cache whenever a scratchFilter or ipFilter is assigned.
Begin updating Group documentation for changes to dbQuery
This commit is contained in:
Colin Kuskie 2006-04-12 23:33:11 +00:00
parent 649e5bac06
commit ad694fb030
4 changed files with 27 additions and 19 deletions

View file

@ -536,6 +536,7 @@ sub getIpUsers {
my $sth = $self->session->db->read($query, [ $self->session->datetime->time() ]);
my %localCache = ();
my @ipUsers = ();
$self->session->errorHandler->warn("Fetching IP users");
while (my ($userId, $lastIP) = $sth->array() ) {
if (!exists $localCache{$lastIP}) {
$localCache{$lastIP} = isInSubnet($lastIP, \@filters);
@ -754,6 +755,8 @@ sub karmaThreshold {
my $self = shift;
my $value = shift;
if (defined $value) {
$self->session->stow->delete('isInGroup');
$self->session->stow->delete("gotGroupsInGroup");
$self->set("karmaThreshold",$value);
}
return $self->get("karmaThreshold");
@ -776,6 +779,8 @@ sub ipFilter {
my $self = shift;
my $value = shift;
if (defined $value) {
$self->session->stow->delete("gotGroupsInGroup");
$self->session->stow->delete('isInGroup');
$self->set("ipFilter",$value);
}
return $self->get("ipFilter");