From 1d057f02b277d29ad4d232d598c49b0344798b40 Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Tue, 3 Jun 2003 16:47:37 +0000 Subject: Bug 180635 - Enhance Bugzilla::User to store additional information r=myk,jake --- Bugzilla.pm | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index cded650d7..0ce6a5e72 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -77,17 +77,15 @@ sub login { # Compat stuff $::userid = $userid; - &::ConfirmGroup($userid); # Evil compat hack. The cookie stores the id now, not the name, but # old code still looks at this to get the current user's email # so it needs to be set. - $::COOKIE{'Bugzilla_login'} = $_user->{email}; - - $::vars->{'user'} = &::GetUserInfo($userid); + $::COOKIE{'Bugzilla_login'} = $_user->login; } else { # Old compat stuff + undef $_user; $::userid = 0; delete $::COOKIE{'Bugzilla_login'}; delete $::COOKIE{'Bugzilla_logincookie'}; @@ -97,7 +95,12 @@ sub login { # - use Bugzilla->user instead! } - return $userid || 0; + return $_user; +} + +sub logout { + undef $_user; + $::userid = 0; } my $_dbh; @@ -257,8 +260,16 @@ or if the login code has not yet been run. =item C -Logs in a user, returning the userid, or C<0> if there is no logged in user. -See L. +Logs in a user, returning a C object, or C if there is +no logged in user. See L and +L. + +=item C + +Logs out the current user. For the moment, this will just cause calls to +C to return C. Eventually this will handle deleting cookies from +the browser and values from the database, which is currently all handled +by C. =item C -- cgit v1.2.1