From d94a9e72997b2ad87dbda8d050b3d5ad9f36bdde Mon Sep 17 00:00:00 2001 From: canyonknight Date: Mon, 8 Oct 2012 21:22:20 -0400 Subject: 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 Signed-off-by: Lukas Fleischer --- web/html/tu.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'web') 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) { -- cgit v1.2.3-70-g09d2