Titre du sujet : Re: Securityimage dans smartpartner par Ghia sur 03/07/2008 20:47:25
comme en formulaire.php:
Apres
include "footer.php";
// If security image is installed .. include the class
if (file_exists (XOOPS_ROOT_PATH."/class/xoopsform/securityimage.php")) {
include_once XOOPS_ROOT_PATH.'/class/xoopsform/securityimage.php';
} elseif (file_exists (XOOPS_ROOT_PATH."/Frameworks/captcha/formcaptcha.php")) {
include_once XOOPS_ROOT_PATH.'/Frameworks/captcha/formcaptcha.php';
$framework = true;
}
Avant
// BUTTONS
// SecurityImage by DuGris
if (defined('SECURITYIMAGE_INCLUDED')) {
$security_image = new SecurityImage( _SECURITYIMAGE_GETCODE );
if ($security_image->render()) {
$form->addElement($security_image, true);
}
} elseif(!empty($framework)) {
$form->addElement(new XoopsFormCaptcha('', 'xoopscaptcha', true, 4, 12, 12, 0,0),true);
}
// SecurityImage by DuGris
Apres
case "submitPartner" :
// SecurityImage by DuGris
include_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
if ( defined('SECURITYIMAGE_INCLUDED') && !SecurityImage::CheckSecurityImage() ) {
$redirect = XOOPS_URL . "/modules/" . $modversion["dirname"] . "/formulaire.php?id=" . $_GET['id'] . "&qcm=" . $_GET['qcm'];
redirect_header( $redirect , 5, _SECURITYIMAGE_ERROR ) ;
exit();
} elseif(!empty($framework)) {
include_once XOOPS_ROOT_PATH.'/Frameworks/captcha/captcha.php';
$security = new XoopsCaptcha();
if (!$security->verify(true)) {
if (!empty($_POST['pical_eventid'])) {
$redirect = XOOPS_URL . "/modules/piCal/?event_id=".intval($_POST['pical_eventid']);
} else {
$redirect = XOOPS_URL . "/modules/" . $modversion["dirname"] . "/formulaire.php?id=" . $_GET['id'] . "&qcm=" . $_GET['qcm'];
}
redirect_header( $redirect , 5, XOOPS_CAPTCHA_INVALID_CODE ) ;
exit();
}
}
// SecurityImage by DuGris
Bonne chance!
|