Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
a2a9bf47
Commit
a2a9bf47
authored
Jan 28, 2005
by
travis%sedsystems.ca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 276605 : Ignore vote changes when usevotes = 0
Patch by Frederic Buclin <LpSolit@gmail.com> r=wurblzap a=myk
parent
8e9520eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
list-for-user.html.tmpl
template/en/default/bug/votes/list-for-user.html.tmpl
+6
-3
votes.cgi
votes.cgi
+4
-3
No files found.
template/en/default/bug/votes/list-for-user.html.tmpl
View file @
a2a9bf47
...
@@ -23,13 +23,16 @@
...
@@ -23,13 +23,16 @@
[% IF !header_done %]
[% IF !header_done %]
[% h2 = voting_user.login FILTER html %]
[% 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 %]
[% ELSE %]
<hr>
<hr>
[% END %]
[% END %]
[% canedit = 1 IF voting_user.login == user.login %]
[% IF votes_recorded %]
[% IF votes_recorded %]
<p>
<p>
<font color="red">
<font color="red">
...
...
votes.cgi
View file @
a2a9bf47
...
@@ -76,7 +76,7 @@ elsif ($action eq "show_user") {
...
@@ -76,7 +76,7 @@ elsif ($action eq "show_user") {
show_user
();
show_user
();
}
}
elsif
(
$action
eq
"vote"
)
{
elsif
(
$action
eq
"vote"
)
{
record_votes
();
record_votes
()
if
Param
(
'usevotes'
)
;
show_user
();
show_user
();
}
}
else
{
else
{
...
@@ -128,7 +128,7 @@ sub show_user {
...
@@ -128,7 +128,7 @@ sub show_user {
my
$who
=
DBNameToIdAndCheck
(
$name
);
my
$who
=
DBNameToIdAndCheck
(
$name
);
my
$userid
=
Bugzilla
->
user
->
id
;
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,
SendSQL
(
"LOCK TABLES bugs READ, products READ, votes WRITE,
cc READ, bug_group_map READ, user_group_map READ,
cc READ, bug_group_map READ, user_group_map READ,
...
@@ -213,7 +213,8 @@ sub show_user {
...
@@ -213,7 +213,8 @@ sub show_user {
SendSQL
(
"DELETE FROM votes WHERE vote_count <= 0"
);
SendSQL
(
"DELETE FROM votes WHERE vote_count <= 0"
);
SendSQL
(
"UNLOCK TABLES"
);
SendSQL
(
"UNLOCK TABLES"
);
$vars
->
{
'canedit'
}
=
$canedit
;
$vars
->
{
'voting_user'
}
=
{
"login"
=>
$name
};
$vars
->
{
'voting_user'
}
=
{
"login"
=>
$name
};
$vars
->
{
'products'
}
=
\
@products
;
$vars
->
{
'products'
}
=
\
@products
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment