summaryrefslogtreecommitdiffstats
path: root/chart.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-10-31 06:31:27 +0100
committerlpsolit%gmail.com <>2005-10-31 06:31:27 +0100
commit1254fcb8c43defcbce99713f5cd85a104670895e (patch)
tree3b842a5b96f429d0db2d5ade3ba409cf1fae7e5a /chart.cgi
parentcf3aa532ea51a41b02c8ea73db254d01c03280ba (diff)
downloadbugzilla-1254fcb8c43defcbce99713f5cd85a104670895e.tar.gz
bugzilla-1254fcb8c43defcbce99713f5cd85a104670895e.tar.xz
Bug 304075: Eliminate use of $::userid from Bugzilla - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=justdave
Diffstat (limited to 'chart.cgi')
-rwxr-xr-xchart.cgi11
1 files changed, 6 insertions, 5 deletions
diff --git a/chart.cgi b/chart.cgi
index 2835bcaa2..c60eedac4 100755
--- a/chart.cgi
+++ b/chart.cgi
@@ -86,7 +86,7 @@ if ($action eq "search") {
exit;
}
-Bugzilla->login(LOGIN_REQUIRED);
+my $user = Bugzilla->login(LOGIN_REQUIRED);
UserInGroup(Param("chartgroup"))
|| ThrowUserError("auth_failure", {group => Param("chartgroup"),
@@ -103,7 +103,7 @@ if ($action =~ /^(assemble|add|remove|sum|subscribe|unsubscribe)$/) {
if ($action =~ /^subscribe|unsubscribe$/) {
detaint_natural($series_id) || ThrowCodeError("invalid_series_id");
my $series = new Bugzilla::Series($series_id);
- $series->$action($::userid);
+ $series->$action($user->id);
}
my $chart = new Bugzilla::Chart($cgi);
@@ -203,14 +203,15 @@ sub getSelectedLines {
# Check if the user is the owner of series_id or is an admin.
sub assertCanEdit {
my ($series_id) = @_;
-
- return if UserInGroup("admin");
+ my $user = Bugzilla->user;
+
+ return if $user->in_group('admin');
my $dbh = Bugzilla->dbh;
my $iscreator = $dbh->selectrow_array("SELECT CASE WHEN creator = ? " .
"THEN 1 ELSE 0 END FROM series " .
"WHERE series_id = ?", undef,
- $::userid, $series_id);
+ $user->id, $series_id);
$iscreator || ThrowUserError("illegal_series_edit");
}