diff options
author | travis%sedsystems.ca <> | 2005-01-28 03:12:53 +0000 |
---|---|---|
committer | travis%sedsystems.ca <> | 2005-01-28 03:12:53 +0000 |
commit | a2a9bf47a40740e89673a6f398afaa76c4e5da92 (patch) | |
tree | 03f1f8d16cade760fdc136f090b819f0a8ca528d | |
parent | 8e9520eb5dd1623948ba8e8f09ef75fd0f8ffd83 (diff) | |
download | bugs-a2a9bf47a40740e89673a6f398afaa76c4e5da92.tar bugs-a2a9bf47a40740e89673a6f398afaa76c4e5da92.tar.gz bugs-a2a9bf47a40740e89673a6f398afaa76c4e5da92.tar.bz2 bugs-a2a9bf47a40740e89673a6f398afaa76c4e5da92.tar.xz bugs-a2a9bf47a40740e89673a6f398afaa76c4e5da92.zip |
Bug 276605 : Ignore vote changes when usevotes = 0
Patch by Frederic Buclin <LpSolit@gmail.com> r=wurblzap a=myk
-rw-r--r-- | template/en/default/bug/votes/list-for-user.html.tmpl | 9 | ||||
-rwxr-xr-x | votes.cgi | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/template/en/default/bug/votes/list-for-user.html.tmpl b/template/en/default/bug/votes/list-for-user.html.tmpl index 9bb3a1dd6..968c66862 100644 --- a/template/en/default/bug/votes/list-for-user.html.tmpl +++ b/template/en/default/bug/votes/list-for-user.html.tmpl @@ -23,13 +23,16 @@ [% IF !header_done %] [% h2 = voting_user.login FILTER html %] - [% PROCESS global/header.html.tmpl title = "Show Votes" %] + [% IF canedit %] + [% title = "Change Votes" %] + [% ELSE %] + [% title = "Show Votes" %] + [% END %] + [% PROCESS global/header.html.tmpl %] [% ELSE %] <hr> [% END %] -[% canedit = 1 IF voting_user.login == user.login %] - [% IF votes_recorded %] <p> <font color="red"> @@ -76,7 +76,7 @@ elsif ($action eq "show_user") { show_user(); } elsif ($action eq "vote") { - record_votes(); + record_votes() if Param('usevotes'); show_user(); } else { @@ -128,7 +128,7 @@ sub show_user { my $who = DBNameToIdAndCheck($name); my $userid = Bugzilla->user->id; - my $canedit = 1 if ($userid && $name eq Bugzilla->user->login); + my $canedit = (Param('usevotes') && $userid == $who) ? 1 : 0; SendSQL("LOCK TABLES bugs READ, products READ, votes WRITE, cc READ, bug_group_map READ, user_group_map READ, @@ -213,7 +213,8 @@ sub show_user { SendSQL("DELETE FROM votes WHERE vote_count <= 0"); SendSQL("UNLOCK TABLES"); - + + $vars->{'canedit'} = $canedit; $vars->{'voting_user'} = { "login" => $name }; $vars->{'products'} = \@products; |