Les archives de FluxBB.fr
Vous n'êtes pas identifié(e).
Bonsoir,
J'ai cherché durant presque une heure un captcha qui fonctionne pour la 1.2.23 avec des questions. J'ai rassemblé quelques bouts de code afin d'en avoir un de fonctionnel, je vous en fait part.
1 - Ouvrir votre register.php
2 - Chercher
<?php
/***********************************************************************
Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/3 - Ajouter après
$captcha_questions = array(
'Combien font dix plus deux ?' => 12,
'Combien font deux plus deux ?' => 4,
'Combien font quatre moins un ?' => 3,
'Combien font trois plus deux ?' => 5,
'Combien font deux fois quatre ?' => 8,
'Combien font cinq moins deux ?' => 3,
'Combien font six plus trois ?' => 9,
'Combien font sept moins un ?' => 6,
'Combien font huit fois deux ?' => 16,
'Combien font six fois deux ?' => 12,
'Combien font neuf moins sept ?' => 2,
'Combien font cent moins dix ?' => 90
);
$captcha_index = rand(0,count($captcha_questions)-1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';4 - Chercher
else if (isset($_POST['form_sent']))
{5 - Ajouter après
// Verification du code
$p_question = trim($_POST['captcha_q']);
$p_answer = trim($_POST['captcha']);
$questions_arry = array();
foreach ($captcha_questions as $k => $v)
$questions_arry[md5($k)] = $v;
if (empty($questions_arry[$p_question]) || $questions_arry[$p_question] != $p_answer)
message('Vous vous êtes trompé à la question ou vous n\'etes peut-être pas un humain ...');6 - Chercher
<div class="inform">
<fieldset>
<legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
<div class="infldset">
<p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
<div class="rbox">
<label><input type="radio" name="email_setting" value="0" /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
<label><input type="radio" name="email_setting" value="1" checked="checked" /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
<label><input type="radio" name="email_setting" value="2" /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
</div>
<p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
<div class="rbox">
<label><input type="checkbox" name="save_pass" value="1" checked="checked" /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
</div>
</div>
</fieldset>
</div>7 - Ajouter après
<?php
$question = array_keys($captcha_questions);
$qencoded = md5($question[$captcha_index]);
?>
<p>Afin de terminer votre inscription, veuillez répondre à la question suivante et envoyer le formulaire :</p>
<p><label><strong><?php echo $question[$captcha_index] ?></strong><br />
<input name="captcha" id="captcha" type="text" size="5" maxlength="10" />
<input name="captcha_q" value="<?php echo $qencoded ?>" type="hidden" /><br /></label></p>J'espère que cette astuce vous sera utile...
Je préviens qu'elle n'est pas de moi.
Hors ligne
C'est le même que celui proposé par vin100 non ? http://fluxbb.fr/forums/viewtopic.php?id=2621
Nous ne faisons pas le travail à votre place mais nous prenons le temps de vous montrer le chemin. Merci de lire ce que l'on vous dit et de réfléchir avant de re-demander une explication.
Hors ligne
Je pense oui.
Hors ligne
ah oui en effet, merci je n'avais pas vu.
Hors ligne