all controllers is aok

This commit is contained in:
2021-03-12 14:05:31 +01:00
parent c6e002d464
commit 91e4d3df00
10 changed files with 68 additions and 43 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
require "../../../bootstrap.php";
use \Backend\Models\Group;
/**
* @param string $voteId
* @return bool
*/
function VoteCheck(string $voteId): bool
{
$votes = array();
if(isset($_COOKIE["VotingReg"])) {
$votes = unserialize($_COOKIE["VotingReg"]);
foreach ($votes as $vote){
if($voteId === $vote) {
return false;
}
}
}
array_push($votes,$voteId);
setcookie("VotingReg", serialize($votes), time() + 86400, "/");
return true;
}