Je ne suis malheureusement pas un expert en php, il est donc tout à fait possible qu'il y ait une meilleur méthode pour parvenir au même résultat, voir même pour faire mieux. N'hésitez pas à partager vos informations ou remarques le cas échéant. Cela dit, ce système a fonctionné à merveille sur le site http://www.pyromaths.org pendant deux ans.
Télécharger Cryptograph
Ce site faisait tourner la version 1.4 de Cryptographp. Vous trouverez cette version sur le site des auteurs.
Il vous faudra extraire le contenu de cette archive dans le dossier manager/tools de votre installation de plume. Vous obtenez ainsi un dossier script dans le dossier tools.
Modification du fichier manager/tools/crypt/cryptographp.fct.php
Remplacer la ligne
Code : Tout sélectionner
$_SESSION['cryptdir']= dirname($cryptinstall);
Code : Tout sélectionner
$_SESSION['cryptdir']= "/manager/tools/crypt/";
- Vers la ligne 29, après
insérer ces deux lignes :
Code : Tout sélectionner
define('PX_RESOURCE_STATUS_JUNK', 6);
Code : Tout sélectionner
$cryptinstall=dirname(__FILE__)."/../tools/crypt/cryptographp.fct.php"; include_once $cryptinstall;
- Vers la ligne 95, modifier la ligne
en :
Code : Tout sélectionner
function set($author, $email, $website, $content, $resource_id, $ip,
Code : Tout sélectionner
function set($author, $email, $website, $content, $captcha, $resource_id, $ip,
- Vers la ligne 110, ajouter :
après
Code : Tout sélectionner
$this->setField('comment_captcha', $captcha);
Code : Tout sélectionner
$this->setField('comment_email', $email); $this->setField('comment_website', $website); $this->setField('comment_content', $content);
- Vers la ligne 130, ajouter :
après
Code : Tout sélectionner
if (! chk_crypt($this->f('comment_captcha'))) { $this->setError(__('le code saisi est incorrect.'), 400); }
Code : Tout sélectionner
function check() {
- Vers la ligne 225, ajouter :
après :
Code : Tout sélectionner
$captcha = form::getPostField('c_captcha');
Code : Tout sélectionner
$author = form::getPostField('c_author'); $email = form::getPostField('c_email'); $website = form::getPostField('c_website');
- En tout début de fichier, insérer les lignes :
Code : Tout sélectionner
<?php %%%$cryptinstall=$_SERVER["DOCUMENT_ROOT"]."/manager/tools/crypt/cryptographp.fct.php"; %include_once $cryptinstall; ?>
- Vers la ligne 70, juste avant :
insérer les lignes :
Code : Tout sélectionner
<div class="news-infos_foot"></div>
Code : Tout sélectionner
<table><tr> <td><h3 class="comment-captcha">Recopier le code : </h3></td> <td><?php dsp_crypt(0,1); ?></td> <td><input type="text" id="c_captcha" name="c_captcha"></td> </tr></table>
Vers la ligne 74, juste avant :
Code : Tout sélectionner
<div class="news-infos_foot"></div>
Code : Tout sélectionner
<table><tr>
<td><h3 class="comment-captcha">Recopier le code : </h3></td>
<td><?php dsp_crypt(0,1); ?></td>
<td><input type="text" id="c_captcha" name="c_captcha"></td>
</tr></table>