summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2013-08-27 10:52:38 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2013-08-27 10:52:38 +0200
commit86d2efaaa0e5761a5118004f861ff46209da3715 (patch)
tree7693942a38e74c29071ffa5186cf8ed961ed6660 /web/lib
parent7b0495cee23b14d4315a48962f86ad36ba097233 (diff)
downloadaurweb-86d2efaaa0e5761a5118004f861ff46209da3715.tar.xz
Exclude running votes from "Last Votes by TU"
Showing running votes potentially allows for tracking votes and associating yes/no/abstain votes with specific TUs. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/acctfuncs.inc.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index f52dfc3..d8a44f8 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -1003,7 +1003,10 @@ function past_proposal_list($order, $lim) {
function last_votes_list() {
$dbh = DB::connect();
- $q = "SELECT UserID, MAX(VoteID) AS LastVote FROM TU_Votes GROUP BY UserID ORDER BY VoteID DESC";
+ $q = "SELECT UserID, MAX(VoteID) AS LastVote FROM TU_Votes, ";
+ $q .= "TU_VoteInfo WHERE TU_VoteInfo.ID = TU_Votes.VoteID AND ";
+ $q .= "TU_VoteInfo.End < UNIX_TIMESTAMP() GROUP BY UserID ";
+ $q .= "ORDER BY VoteID DESC";
$result = $dbh->query($q);
$details = array();