Voilà une implémentation de captcha (/Frameworks/captcha) pour les contributions anonymes dans le module news de herve t.
Fichiers modifiés :
/modules/news/includes/storyform.inc.php
/modules/news/submit.php
/modules/news/includes/storyform.inc.php
ligne 188 avant les boutons submit
//Hack Captcha
if (is_readable(XOOPS_ROOT_PATH."/Frameworks/captcha/formcaptcha.php")) {
include_once XOOPS_ROOT_PATH."/Frameworks/captcha/formcaptcha.php";
$sform->addElement(new XoopsFormCaptcha('', 'xoopscaptcha', true, 4, 12, 12, 1, 0));
}
/modules/news/submit.php
ligne 303. Dans le switch case post pour uid=0 :: anonyme
// HACK CAPTCHA (need Frameworks installed)
if (is_readable(XOOPS_ROOT_PATH."/Frameworks/captcha/formcaptcha.php")) {
require_once XOOPS_ROOT_PATH."/Frameworks/captcha/captcha.php";
$xoopsCaptcha = XoopsCaptcha::instance();
if(! $xoopsCaptcha->verify(true) ) {
redirect_header(XOOPS_URL.'/modules/news/submit.php', 2, $xoopsCaptcha->getMessage);
exit();
}
}
// hack captcha