Merge branch 'collisions' into 'master'

Fix Collisions

See merge request !34
This commit is contained in:
JosephK 2015-03-02 19:33:12 +01:00
commit 312272b1d0
3 changed files with 32 additions and 11 deletions

View File

@ -1,12 +1,3 @@
[![](https://git.framasoft.org/assets/logo-black-f52905a40830b30aa287f784b537c823.png)](https://git.framasoft.org)
![English:](http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png) **Framasoft uses GitLab** for the development of its free softwares. Our Github repositories are only mirrors.
If you want to work with us, **fork us on [git.framasoft.org](https://git.framasoft.org)**. (no registration needed, you can sign in with your Github account)
![Français :](http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/20px-Flag_of_France.svg.png) **Framasoft utilise GitLab** pour le développement de ses logiciels libres. Nos dépôts Github ne sont que des mirroirs.
Si vous souhaitez travailler avec nous, **forkez-nous sur [git.framasoft.org](https://git.framasoft.org)**. (l'inscription n'est pas nécessaire, vous pouvez vous connecter avec votre compte Github)
* * *
![English:](http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png) ![English:](http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png)
This software is governed by the CeCILL-B license. If a copy of this license This software is governed by the CeCILL-B license. If a copy of this license
is not distributed with this file, you can obtain one at is not distributed with this file, you can obtain one at

View File

@ -1,3 +1,12 @@
[![](https://git.framasoft.org/assets/logo-black-f52905a40830b30aa287f784b537c823.png)](https://git.framasoft.org)
![English:](http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png) **Framasoft uses GitLab** for the development of its free softwares. Our Github repositories are only mirrors.
If you want to work with us, **fork us on [git.framasoft.org](https://git.framasoft.org)**. (no registration needed, you can sign in with your Github account)
![Français :](http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/20px-Flag_of_France.svg.png) **Framasoft utilise GitLab** pour le développement de ses logiciels libres. Nos dépôts Github ne sont que des mirroirs.
Si vous souhaitez travailler avec nous, **forkez-nous sur [git.framasoft.org](https://git.framasoft.org)**. (l'inscription n'est pas nécessaire, vous pouvez vous connecter avec votre compte Github)
* * *
![English:](http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png) ![English:](http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png)
This software is governed by the CeCILL-B license. If a copy of this license This software is governed by the CeCILL-B license. If a copy of this license
is not distributed with this file, you can obtain one at is not distributed with this file, you can obtain one at

View File

@ -38,13 +38,34 @@ function random($car)
return $string; return $string;
} }
// Like function get_sondage_from_id()
function check_poll_id($id)
{
global $connect;
$sql = 'SELECT `id_sondage` FROM sondage`id_sondage` = ' . $connect->Param('id_sondage') ;
$sql = $connect->Prepare($sql);
$poll = $connect->Execute($sql, [$id]);
if ($poll === false) {
return false;
}
$dbpoll = $poll->FetchObject(false);
return $dbpoll->id_sondage;
}
function ajouter_sondage() function ajouter_sondage()
{ {
global $connect; global $connect;
global $config; global $config;
$sondage=random(16); $sondage = random(16);
$sondage_admin=$sondage.random(8); while(check_poll_id($sondage) == $sondage) {
$sondage = random(16);
}
$sondage_admin = $sondage.random(8);
$date_fin = $_SESSION["champdatefin"]; // provided by choix_autre.php or choix_date.php $date_fin = $_SESSION["champdatefin"]; // provided by choix_autre.php or choix_date.php
$_SESSION["champdatefin"]=""; //clean param cause 2 polls created by the same user in the same session can be affected by this param during the 2nd creation. $_SESSION["champdatefin"]=""; //clean param cause 2 polls created by the same user in the same session can be affected by this param during the 2nd creation.