mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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:
parent
14b237ac53
commit
d94a9e7299
1 changed files with 5 additions and 2 deletions
|
@ -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()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue