From e15dcf488f8bbf1fef2cd0a7001385f7a95e8d59 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 17 Aug 2011 00:45:22 +0200 Subject: Bug 678970: Use $user and $cgi instead of Bugzilla->user and Bugzilla->cgi r=timello a=LpSolit --- userprefs.cgi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'userprefs.cgi') diff --git a/userprefs.cgi b/userprefs.cgi index f411326a2..485ceb54f 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -51,8 +51,7 @@ sub DoAccount { ($vars->{'realname'}) = $dbh->selectrow_array( "SELECT realname FROM profiles WHERE userid = ?", undef, $user->id); - if(Bugzilla->params->{'allowemailchange'} - && Bugzilla->user->authorizer->can_change_email) { + if (Bugzilla->params->{'allowemailchange'} && $user->authorizer->can_change_email) { # First delete old tokens. Bugzilla::Token::CleanTokenTable(); @@ -493,9 +492,9 @@ $cgi->delete('Bugzilla_login', 'Bugzilla_password') if ($cgi->cookie('sudo')); $cgi->delete('GoAheadAndLogIn'); # First try to get credentials from cookies. -Bugzilla->login(LOGIN_OPTIONAL); +my $user = Bugzilla->login(LOGIN_OPTIONAL); -if (!Bugzilla->user->id) { +if (!$user->id) { # Use credentials given in the form if login cookies are not available. $cgi->param('Bugzilla_login', $cgi->param('old_login')); $cgi->param('Bugzilla_password', $cgi->param('old_password')); -- cgit v1.2.3-24-g4f1b