Added group expiration notifications.

This commit is contained in:
JT Smith 2003-02-02 03:43:45 +00:00
parent 3f2d2c63f9
commit 226ed9abcf
10 changed files with 241 additions and 31 deletions

View file

@ -56,7 +56,7 @@ $|=1;
print "Starting...\n";
my ($i, $dbh, @row, %user, @field, $userId, $first, $dup, $lineNumber, $expireAfter, @group);
my ($i, $dbh, @row, %user, @field, $userId, $first, $dup, $lineNumber, $expireOffset, @group);
$first = 1;
$dbh = connectToDb();
open(FILE,"<".$usersFile);
@ -109,13 +109,13 @@ while(<FILE>) {
values ($user{userId},'LDAP','$_',".$dbh->quote($user{$_}).")");
}
}
($expireAfter) = WebGUI::SQL->quickArray("select expireAfter from groups where groupId=2",$dbh);
($expireOffset) = WebGUI::SQL->quickArray("select expireOffset from groups where groupId=2",$dbh);
$user{groups} =~ s/ //g;
@group = split(/,/,$user{groups});
foreach (@group) {
($expireAfter) = WebGUI::SQL->quickArray("select expireAfter from groups where groupId=$_",$dbh);
($expireOffset) = WebGUI::SQL->quickArray("select expireOffset from groups where groupId=$_",$dbh);
WebGUI::SQL->write("insert into groupings (groupId,userId,expireDate) values
($user{userId},$_,".(time()+$expireAfter).")",$dbh);
($user{userId},$_,".(time()+$expireOffset).")",$dbh);
}
}
}