show_activity.cgi: code style

hinted-selects
Vitaliy Filippov 2014-08-28 17:59:01 +04:00
parent 52885bc2af
commit 2b44c2da4f
1 changed files with 7 additions and 20 deletions

View File

@ -1,6 +1,4 @@
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public # The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file # License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of # except in compliance with the License. You may obtain a copy of
@ -29,40 +27,29 @@ use lib qw(. lib);
use Bugzilla; use Bugzilla;
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::Diff;
use Bugzilla::Constants; use Bugzilla::Constants;
my $cgi = Bugzilla->cgi; my $ARGS = Bugzilla->input_params;
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
############################################################################### # Check whether or not the user is currently logged in.
# Begin Data/Security Validation
###############################################################################
# Check whether or not the user is currently logged in.
Bugzilla->login(); Bugzilla->login();
# Make sure the bug ID is a positive integer representing an existing # Make sure the bug ID is a positive integer representing an existing
# bug that the user is authorized to access. # bug that the user is authorized to access.
my $id = $cgi->param('id'); my $bug = Bugzilla::Bug->check($ARGS->{id});
my $bug = Bugzilla::Bug->check($id);
###############################################################################
# End Data/Security Validation
###############################################################################
# Run queries against the shadow DB. In the worst case, new changes are not # Run queries against the shadow DB. In the worst case, new changes are not
# visible immediately due to replication lag. # visible immediately due to replication lag.
Bugzilla->switch_to_shadow_db; Bugzilla->switch_to_shadow_db;
my $operations; my $operations;
($operations, $vars->{'incomplete_data'}) = ($operations, $vars->{incomplete_data}) = Bugzilla::Bug::GetBugActivity($bug->id);
Bugzilla::Bug::GetBugActivity($bug->id);
$vars->{'operations'} = $operations; $vars->{operations} = $operations;
$vars->{'bug'} = $bug; $vars->{bug} = $bug;
$template->process("bug/activity/show.html.tmpl", $vars) $template->process("bug/activity/show.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
exit; exit;