From d33c399b231a1d47a3fb94a770256369dbb32e6a Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 2 Oct 2014 19:09:30 +0200 Subject: Bug 1076155: Remove "?" from table columns and labels + code cleanup r=dkl a=justdave --- userprefs.cgi | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'userprefs.cgi') diff --git a/userprefs.cgi b/userprefs.cgi index bb57b56b3..ad5fb7d19 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -526,8 +526,8 @@ sub SaveApiKey { # Update any existing keys my $api_keys = Bugzilla::User::APIKey->match({ user_id => $user->id }); foreach my $api_key (@$api_keys) { - my $description = $cgi->param('description_'.$api_key->id); - my $revoked = $cgi->param('revoked_'.$api_key->id); + my $description = $cgi->param('description_' . $api_key->id); + my $revoked = $cgi->param('revoked_' . $api_key->id); if ($description ne $api_key->description || $revoked != $api_key->revoked) @@ -540,25 +540,19 @@ sub SaveApiKey { } } - # Was a new api key requested + # Create a new API key if requested. if ($cgi->param('new_key')) { - my $new_key = Bugzilla::User::APIKey->create({ + $vars->{new_key} = Bugzilla::User::APIKey->create({ user_id => $user->id, description => $cgi->param('new_description'), }); # As a security precaution, we always sent out an e-mail when # an API key is created - my $lang = $user->setting('lang') - // Bugzilla::User->new()->setting('lang'); - - my $template = Bugzilla->template_inner($lang); + my $template = Bugzilla->template_inner($user->setting('lang')); my $message; - $template->process( - 'email/new-api-key.txt.tmpl', - { user => $user, new_key => $new_key }, - \$message - ) || ThrowTemplateError($template->error()); + $template->process('email/new-api-key.txt.tmpl', $vars, \$message) + || ThrowTemplateError($template->error()); MessageToMTA($message); } -- cgit v1.2.3-65-gdbad