diff options
author | canyonknight <canyonknight@gmail.com> | 2012-10-08 21:22:20 -0400 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-10-10 17:22:22 +0200 |
commit | d94a9e72997b2ad87dbda8d050b3d5ad9f36bdde (patch) | |
tree | 93979c101b8d168c6cbc6d2b9271a3af95317834 | |
parent | 14b237ac53f13bc99d1f64f2e0cc21cd30b517b0 (diff) |
tu.php: Fix page showing a user hasn't voted when they have
An ended vote details page will report a user hasn't voted even when
they have. This is a result of faulty logic that only checks if a user
has voted if the vote is still running.
Regression with commit c15441762c6f6ab4438eaf2854c0ee3146a98b30
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r-- | web/html/tu.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/web/html/tu.php b/web/html/tu.php index 5e85e78..e2f7712 100644 --- a/web/html/tu.php +++ b/web/html/tu.php @@ -42,10 +42,13 @@ if ($atype == "Trusted User" || $atype == "Developer") { } else if ($row['User'] == username_from_sid($_COOKIE["AURSID"])) { $canvote = 0; $errorvote = __("You cannot vote in an proposal about you."); - } else if (tu_voted($row['ID'], uid_from_sid($_COOKIE["AURSID"]))) { + } + if (tu_voted($row['ID'], uid_from_sid($_COOKIE["AURSID"]))) { $canvote = 0; $hasvoted = 1; - $errorvote = __("You've already voted for this proposal."); + if ($isrunning) { + $errorvote = __("You've already voted for this proposal."); + } } if ($canvote == 1) { |