[pmwiki-users] fox: captcha for specific forms

noskule noskule at gmx.net
Tue Mar 11 08:36:26 CDT 2008


hi hans

I try to enable captcha for e specific form (comments). The captcha 
should only show if the user is not logged in. I tryied with

    if ( ! @$GLOBALS["AuthId"] > "" ) {
        $EnablePostCaptchaRequired = true;
        }

The probleme here, it seams to be enabled for all forms, with or without 
captcha, this is a problem when a known user get logged out of a session 
and be saving a page the "wrong captcha" message is prsented instead of 
the loginform.

So second aproach is:

    (:messages:)
    (:fox testform:)

    (:if ! authid:)
    Enter value {$Captcha} (:input captcha class=inputtext:)
    (:foxcheck access if='captcha' msg='Wrong Captcha':)
    (:ifend:)

    (:input submit post:)
    (:foxend testform:)

here I just get a "Please enter a valid input" instead of my defined 
message? Is it somehow possible to check captcha with the aproach above.
thanks for any hints
nos






More information about the pmwiki-users mailing list