1
My Liaise contact form is getting spammed, so I am trying to add the security image hack to Liaise 1.23. I installed the files and followed the instructions to add code snippet part one (the image generation code) before the 'submit' button. This appears to be in:
include/form_render.php
around line 58:
$form_output->addElement(new XoopsFormHidden('form_id',
$form->getVar('form_id'))); // line 58
// Hack SecurityImage by DuGris -------------
if (defined('SECURITYIMAGE_INCLUDED')) {
$security_image = new SecurityImage( _SECURITYIMAGE_GETCODE );
if ($security_image->render()) {
$form_output->addElement($security_image, true);
}
}
// Hack SecurityImage by DuGris -------------
$form_output->addElement(new XoopsFormButton('', 'submit',
$form->getVar('form_submit_text'), 'submit')); // the submit button
This works perfectly, but... I don't know where to put code snippet part two, which checks the code is correct before submitting the form and redirects if it isn't:
The example given for another form module, Formulaire (shown below) puts the code after the footer.php include statement, but that is in a different file in Liaise.
include_once XOOPS_ROOT_PATH.'/footer.php';
}else{ // Line 376
// Hack 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 , 2, _SECURITYIMAGE_ERROR ) ;
exit();
}
// Hack SecurityImage by DuGris --------------------------------
Anyone got security image working with Liaise?
A thread is for life. Not just for Christmas.