diff --git a/index.html b/index.html index f243189..b09c967 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,5 @@ + @@ -77,7 +78,7 @@ Le champ "De quelle matière s'agit-il ?" n'est là qu'a titre indicatif. Il va permettre à la personne qui valide votre question d'aller vérifier par lui même la véracité de votre réponse.
- Indiquez la matière sur laquelle porte la question lui permettre + Indiquez la matière sur laquelle porte la question lui permettra d'aller plus vite.

@@ -126,7 +127,10 @@

- +

+
+ +

diff --git a/questions.php b/questions.php index eac5e87..1df69a5 100755 --- a/questions.php +++ b/questions.php @@ -56,8 +56,29 @@ if (isset ($_POST['send'])) // @TODO: Send mail to the selected validator +// Get an email from the list + + $file = fopen('email.txt', 'r'); + $number = fgets($file); + + while (true) + { + $random = rand(1, $number); + + for ($i = 0; $i < $random; $i++) + { + $line = fgets($file); + } + if ($line != $_POST['email']) + { + break; + } + } + + fclose($file); + /* This code works, perhaps should be placed in a method in Question class? - $to = "bertrand.cournaud@gmail.com"; + $to = $line; $subject = "[Nemubot] Validation d'une question"; $headers = "From: Nemubot "; $message = 'Bonjour,\n Adresse de validation: