forward port of becoming illegal userId bugfix

This commit is contained in:
Colin Kuskie 2006-02-14 06:50:14 +00:00
parent 32169aebbf
commit 0c69c93f41
2 changed files with 17 additions and 0 deletions

View file

@ -45,6 +45,8 @@ This package provides an object-oriented way of managing WebGUI users as well as
$u->deleteFromGroups(\@arr);
$u->delete;
WebGUI::User->validUserId($session, $userId);
=head1 METHODS
These methods are available from this class:
@ -654,4 +656,18 @@ sub userId {
return $_[0]->{_userId};
}
#-------------------------------------------------------------------
=head2 validUserId ( userId )
Returns true if the userId exists in the users table.
=cut
sub validUserId {
my ($class, $session, $userId) = @_;
my $sth = $session->db->read('select userId from users where userId='.$session->db->quote($userId));
return ($sth->rows == 1);
}
1;