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>
This commit is contained in:
canyonknight 2012-10-08 21:22:20 -04:00 committed by Lukas Fleischer
parent 14b237ac53
commit d94a9e7299

View file

@ -42,11 +42,14 @@ if ($atype == "Trusted User" || $atype == "Developer") {
} else if ($row['User'] == username_from_sid($_COOKIE["AURSID"])) { } else if ($row['User'] == username_from_sid($_COOKIE["AURSID"])) {
$canvote = 0; $canvote = 0;
$errorvote = __("You cannot vote in an proposal about you."); $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; $canvote = 0;
$hasvoted = 1; $hasvoted = 1;
if ($isrunning) {
$errorvote = __("You've already voted for this proposal."); $errorvote = __("You've already voted for this proposal.");
} }
}
if ($canvote == 1) { if ($canvote == 1) {
if (isset($_POST['doVote']) && check_token()) { if (isset($_POST['doVote']) && check_token()) {