mirror of
https://github.com/standardebooks/web.git
synced 2025-07-10 00:30:28 -04:00
Redirect ended polls to the results page
This commit is contained in:
parent
7201081aed
commit
35565d90f6
1 changed files with 6 additions and 0 deletions
|
@ -9,6 +9,12 @@ $canVote = true; // Allow non-logged-in users to see the 'vote' button
|
|||
try{
|
||||
$poll = Poll::GetByUrlName(HttpInput::Str(GET, 'pollurlname', false));
|
||||
|
||||
if(!$poll->IsActive() && $poll->End !== null && $poll->End < new DateTime()){
|
||||
// If the poll ended, redirect to the results
|
||||
header('Location: ' . $poll->Url . '/votes');
|
||||
exit();
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['User'])){
|
||||
$canVote = false; // User is logged in, hide the vote button unless they haven't voted yet
|
||||
try{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue