Added group expiration notifications.
This commit is contained in:
parent
3f2d2c63f9
commit
226ed9abcf
10 changed files with 241 additions and 31 deletions
|
|
@ -103,18 +103,17 @@ An array reference containing a list of groups.
|
|||
|
||||
sub addUsersToGroups {
|
||||
foreach my $gid (@{$_[1]}) {
|
||||
my ($expireAfter) = WebGUI::SQL->quickArray("select expireAfter from groups where groupId=$gid");
|
||||
my ($expireOffset) = WebGUI::SQL->quickArray("select expireOffset from groups where groupId=$gid");
|
||||
foreach my $uid (@{$_[0]}) {
|
||||
my ($isIn) = WebGUI::SQL->quickArray("select count(*) from groupings where groupId=$gid and userId=$uid");
|
||||
unless ($isIn) {
|
||||
WebGUI::SQL->write("insert into groupings (groupId,userId,expireDate)
|
||||
values ($gid, $uid, ".(time()+$expireAfter).")");
|
||||
values ($gid, $uid, ".(time()+$expireOffset).")");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 deleteGroupsFromGroups ( groups, fromGroups )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue