Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#1
Just popping in
Just popping in


See User information
Xoops Version: 2.4.1
Liaise Version: 1.5

Only tested with the above versions.

Captcha is built into XOOPS 2.4.1 so only two small changes required in Liaise form handlers. I've set it up so that only anonymous users will be prompted for the captcha security code. Logged in users will not see it.

Future development: Enable per-form disabling of the captcha security code. For now it appears on all forms for anonymous users.

One known bug: Errors on the form including captcha errors are handled properly and redirected back to the form for correction. The captcha security code must be re-entered even though the captcha code may have been correct and still appears to match.

All comments welcome.
Rob

modules/liaise/include/form_render.php following line 57
$form_output->addElement(new XoopsFormHidden('form_id'$form->getVar('form_id')));

# Captcha Security Hack by Rob Stockley ------------------------------------
xoops_load("XoopsFormCaptcha");
if( !
is_object($GLOBALS['xoopsUser'])) {
    
$form_output->addElement(new XoopsFormCaptcha(), true);
}
# Captcha Security Hack by Rob Stockley ------------------------------------

$form_output->addElement(new XoopsFormButton('''submit'$form->getVar('form_submit_text'), 'submit'));


modules/liaise/include/form_execute.php following line 58
if( isset($_POST['xoops_upload_file']) && is_array($_POST['xoops_upload_file']) ){
    foreach( 
$_POST['xoops_upload_file'] as $k => $v ){
        
$n explode("_"$v);
        
$ele[$n[1]] = $v;
    }
}

# Captcha Security Hack by Rob Stockley ------------------------------------
xoops_load("captcha");
$xoopsCaptcha XoopsCaptcha::getInstance();
if (!
$xoopsCaptcha->verify()) {
    
$err[] = $xoopsCaptcha->getMessage();
}
# Captcha Security Hack by Rob Stockley ------------------------------------

foreach( $elements as $i ){
    
$ele_id $i->getVar('ele_id');
    
$ele_type $i->getVar('ele_type');


Posted on: 2009/12/11 1:55
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#2
Just popping in
Just popping in


See User information
Oh yeah. To get the admin pages in Liaise 1.5 to work under 2.4.1 I had to comment out line 41 in modules/liaise/admin/admin_header.php in accordance with this post.
Rob

Posted on: 2009/12/11 2:02
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#3
Just can't stay away
Just can't stay away


See User information
Why don't you use xForms module? It's Liaise clone, but it works well to me. :)

Posted on: 2009/12/11 15:16
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#4
Just popping in
Just popping in


See User information
Thanks for the tip regards xForms. I've been away from XOOPS for a long time so simply went with what I've used before. I just downloaded xForms from here and installed it on my test site. Captcha is displayed on the form alright but there is no code in form_execute.php to check whether the key entered is correct. The form succeeds regardless of the captcha element. The code in form_render.php is close to what I came up with.

I don't speak German so perhaps the link was a development version. I couldn't find xForms in the module repository.

licence.txt points to http://www.dylian.melgert.net/ but I can't find a copy of xForms there either. Again that could be my lack of language skills.

I prefer main trunk modules in active development to (potentially) version specific clones. Only exception is where the necessary hacks are significant.

Posted on: 2009/12/11 18:19
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#5
Community Support Member
Community Support Member


See User information
See this.

Posted on: 2009/12/12 1:53
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#6
Just popping in
Just popping in


See User information
Thanks. That's a different version of xForms than the one I found searching this forum. Perhaps I'm going blind but I still can't find any code to authenticate the captcha element. All I see is the element included on the form.

Posted on: 2009/12/12 4:02
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#7
Just can't stay away
Just can't stay away


See User information
A bit OT: I found somewhere an interesting discussion (can't remember where) about the benefits and drawbacks of javascript based captchas. Since my module is nearly one third javascript I thought it would be a good idea to build in a javascript solution.

Benefit: bots don't know javascript (yet) and don't click (yet)
Drawback: you need javascript and you have to click

I found another (more nice) solution, but THIS is working without a flaw. I adapted it for my use. If anyone wants to have code examples, just tell me.

HERE is the other captcha

Posted on: 2009/12/12 7:43
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#8
Just popping in
Just popping in


See User information
That is way cool. I've just implemented recaptcha from here and here.

I especially like the second one where you drag the object. Looks as though I'm not finished for the evening yet.

Posted on: 2009/12/12 8:33
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Xoops 2.4.1 + Liaise 1.5 + Captcha = Working
#9
Friend of XOOPS
Friend of XOOPS


See User information
Updated the package (Thanks for reporting).

DOWNLOAD: http://www.dylian.eu/downloads/xoops.modules/xforms

Greets Dylian.

BTW Final version of xforms will have rewrite options (somelike in my download url)

Posted on: 2009/12/13 14:04
 Top  Twitter  Facebook    Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You can post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Login
Username:

Password:

Remember me



Lost Password?

Register now!
Search
Recent Posts
Who's Online
138 user(s) are online (104 user(s) are browsing Support Forums)

Members: 0
Guests: 138

more...
Donat-O-Meter
Make donations with PayPal!
Stats
Goal: AU$15.00
Due Date: Jul 31
Gross Amount: AU$0.00
Net Balance: AU$0.00
Left to go: AU$15.00
Latest GitHub Commits
Recent forum posts
Recent Comments
About us
Learn
Use
Develop GitHub
Contribute
Connect
Terms of Use | Privacy Policy | Hosted by Arvixe Hosting | RSS 2.0 Button