Add more coverage tests for methods added to User.pm

for Friends.
Fix a bug in the isOnline method, which was looking sessions
exactly 600 seconds old.
This commit is contained in:
Colin Kuskie 2007-10-26 02:54:47 +00:00
parent c860bfdd10
commit b8a4033036
2 changed files with 75 additions and 6 deletions

View file

@ -421,7 +421,7 @@ Returns a boolean indicating whether this user is logged in and actively viewing
sub isOnline {
my $self = shift;
my ($flag) = $self->session->db->quickArray('select count(*) from userSession where userId=? and lastPageView=?',
my ($flag) = $self->session->db->quickArray('select count(*) from userSession where userId=? and lastPageView>=?',
[$self->userId, time() - 60*10]);
return $flag;
}