Enable poll deletion + improve random generator
This commit is contained in:
parent
9ed0043569
commit
98f14c487a
@ -77,10 +77,12 @@ class AdminPollService {
|
||||
function deleteEntirePoll($poll_id) {
|
||||
$poll = $this->connect->findPollById($poll_id);
|
||||
$this->logService->log("DELETE_POLL", "id:$poll->poll_id, format:$poll->format, admin:$poll->admin_name, mail:$poll->admin_mail");
|
||||
/*$this->connect->deleteVotesByPollId($poll_id);
|
||||
|
||||
// Delete the entire poll
|
||||
$this->connect->deleteVotesByPollId($poll_id);
|
||||
$this->connect->deleteCommentsByPollId($poll_id);
|
||||
$this->connect->deleteSlotsByPollId($poll_id);
|
||||
$this->connect->deleteByPollId($poll_id);*/
|
||||
$this->connect->deleteByPollId($poll_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -176,9 +176,9 @@ class PollService {
|
||||
// TODO Better random ?
|
||||
$string = '';
|
||||
$chaine = 'abcdefghijklmnopqrstuvwxyz123456789';
|
||||
srand((double)microtime() * 1000000);
|
||||
mt_srand();
|
||||
for ($i = 0; $i < $car; $i++) {
|
||||
$string .= $chaine[rand() % strlen($chaine)];
|
||||
$string .= $chaine[mt_rand() % strlen($chaine)];
|
||||
}
|
||||
|
||||
return $string;
|
||||
|
Loading…
Reference in New Issue
Block a user