1
Peekay
Has anyone got Security Image working with Liaise?
  • 2006/9/7 16:28

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


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_imagetrue);
        }
   }

// 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.

2
McDonald
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/7 16:37

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


I've never tried this with Liaise.
Try otherwise XoopsContact because this is having a security check built in already.

I am also not sure if the securty image from DuGris works with XOOPS 2.2.x.

Latest version of Liaise for XOOPS 2.0.x is version 1.26.

3
Peekay
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/7 17:57

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Thx McDonald.

I already have the new Contact form which is great for general enquiries, especially the department feature. Liaise however offers a wider range of form elements. I have downloaded the 1.26 version, but sadly, there's no 'captcha' built-in.
A thread is for life. Not just for Christmas.

4
Peekay
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/11 16:36

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Tiny bump.
A thread is for life. Not just for Christmas.

5
zyspec
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/11 18:49

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Let me preface this with a "I HAVEN'T TRIED THIS BUT IT SHOULD WORK (OR BE VERY CLOSE)".

I believe what you need to do is add some code around line 52 of /include/form_execute.php - right after:
foreach( $_POST as $k => $v ){
    if( 
preg_match('/^ele_[0-9]+$/'$k) ){
        
$n explode("_"$k);
        
$ele[$n[1]] = $v;
    }
}


ADD:
// Hack SecurityImage by DuGris --------------------------------
include_once(XOOPS_ROOT_PATH "/class/xoopsformloader.php");
if ( isset(
$security_image) && !SecurityImage::CheckSecurityImage() ) { 
  
$redirect LIAISE_URL "/index.php; 
  redirect_header( 
$redirect , 2, _SECURITYIMAGE_ERROR ) ; 
  exit();
}
// Hack SecurityImage by DuGris --------------------------------

6
Peekay
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/11 20:45

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Many, many thx Zyspec!

For the 1.23 version (may differ slightly with 1.26)
Add this code at line 63:
// line 60
        
// line 61
// line 62

// Hack SecurityImage by DuGris --------------------------------
        
include_once(XOOPS_ROOT_PATH "/class/xoopsformloader.php");
        if ( 
defined('SECURITYIMAGE_INCLUDED') && !SecurityImage::CheckSecurityImage() ) {
        
$redirect LIAISE_URL "/index.php" ;
        
redirect_header$redirect 2_SECURITYIMAGE_ERROR ) ;
        exit();
        }
// Hack SecurityImage by DuGris --------------------------------


Nice one Zyspec. Have a virtual beer on me
A thread is for life. Not just for Christmas.

7
BDW
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/12 10:40

  • BDW

  • Quite a regular

  • Posts: 280

  • Since: 2002/9/28


This isnt working for me, it isnt showing the security image thing. I'm using 1.26.

8
Peekay
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/12 11:30

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


@unhardcore
Have you added the first bit of code to 'form_render.php'? I assume you have of course added the core files from the Security Image hack by Dugris.
A thread is for life. Not just for Christmas.

9
BDW
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/12 11:35

  • BDW

  • Quite a regular

  • Posts: 280

  • Since: 2002/9/28


Quote:

Peekay wrote:
@unhardcore
Have you added the first bit of code to 'form_render.php'?


yes

Quote:
I assume you have of course added the core files from the Security Image hack by Dugris.


oh, erm, dont know. Went to his site but the hacks where for 2.0.13.

10
Peekay
Re: Has anyone got Security Image working with Liaise?
  • 2006/9/12 11:40

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I haven't tried this with XOOPS 2.0.14 or 15. There are only a few changes, so worth a try as long as you make backups. I can't use 2.0.14 so would be interested to know if you get it working.

Liaise 1.26 may have slightly different file code too. If I get a chance I'll post an update for that version, assuming it works.
A thread is for life. Not just for Christmas.

Login

Who's Online

404 user(s) are online (268 user(s) are browsing Support Forums)


Members: 0


Guests: 404


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits