WebsiteBaker Community Forum

WebsiteBaker Support (2.13.x) => Modules => Topic started by: RonR on November 04, 2023, 10:52:06 AM

Title: Guestbook verification (captcha) fails always
Post by: RonR on November 04, 2023, 10:52:06 AM
Just updated WB and the guestbook.
Guestbook v2.10.3 on WB-Version 2.13.4 r199  PHP8.1

Now, I am not a mathematician, but those easy calculations are doable, even for me!
Website baker disagrees everytime! Verification fails always.

I can set without captcha, but there is a risk its gets spammed.
Another thing is that also maybe caused by this captcha, it refers me to /pages/ while that directory is not accessable.


By the way, as the module gets slow on backend with over 2000 entries, I made a pagination system on the backend like there is on the frontend.

Any help appreciated.

Regards, Ron
Title: Re: Guestbook verification (captcha) fails always
Post by: ruebenwurzel on November 04, 2023, 11:44:36 AM
Hello,

attached Guestbook 2.10.4 wich works for me with the upcoming WB 2.13.5 PHP 8.2. Maybe it solves also your problem.

Please also test different captchas. You can change in WB-Backend under Admin-Tools, Captcha. I use the Secureimage Captcha wich works.

Matthias
Title: Re: Guestbook verification (captcha) fails always
Post by: RonR on November 04, 2023, 03:39:28 PM
Thank you Matthias,

but I can not get it to work.
Whatever style captchas or guestbook version: Verification failed....

Been looking at the code:

if I turn off captcha, but enable ASP, the form gets a honeypot spam prevention....
For now, that will do...

Thank you.
Title: Re: Guestbook verification (captcha) fails always
Post by: sternchen8875 on November 05, 2023, 02:40:30 PM
honeypot-fields are only for robots and bot. the "trick" is: use renamed field in your form instead of the standard field names like name, email etc. So ASP will only work, ist a "guest" is a robot or bot

#1: to the captcha: every module for WB use the same captcha-solution, news-comments, form-module, guestbook or registration, everywhere the same captcha-method.
"For a good job", captcha need a working session and for that, it needs working path's on the server, to store the session path's.

#2: next point: with the form, doesn't matter, what kind of module it send's, captcha "produce" some special fields. if the script dont receive fields like this, it send's the verification-error, the same, if the script cannot found the admin-mail-adress from the sended form && and from the WB-settings

#3: some other things: in the past, i get from time to time problems on some special servers, specially, if i work in sub-domains or in sub-folders, in my case on strato-servers (a german provider). they use aliases for sub-domain and it was a problem there, to read the adresses like document-root, because, php sends the ral folder adress, not the alias. in the result, it cannot check the verification and my answer was wrong

things, to test:
if you want, try at first with another modul like form or news on a hidden or private page, must be the same result: Verification error
add the follow code in the index.php of the used frontend-template or (recommended) of the index.php from the DefaultTemplate for a test. Add this nearly to the <body>-Tag
Code: [Select]
<?php    
echo "<pre>";
print_r($_GET);
echo 
"</pre>";
echo 
"<pre>";
print_r($_SESSION);
echo 
"</pre>";
?>

Then add a private or hidden page, so that the test is not public. add on this page a guestbook-section. if you used thos code from the top in the DefaultTemplate, change the template in the page-setting from this added new page from standard (default) to DefaultTemplate. Your visitors see's the your real frontend-template and you test with the DefaultTemplate

Result is a long list of all session variables in the front. if you get now the error, after this test, search the page for the word "captcha". On windows-pc, use STRG + F, to activate this search

(https://i.gyazo.com/523f41fa8955b0f5ed6a2944f1b73585.png)

I test it by myself and now, i understand: i get this verification-error as js-popup

(https://i.gyazo.com/cece7c254ff8186632afd88085635741.png)

Problem from my view: the guestbook make's a short test after sending, like this in the file gstbk_page.php, Ln 67 ff

Code: [Select]
if (isset($_GET['captcha']) && $_GET['captcha'] =="true"){ ?>
    <script>
        alert( "<?php echo $MOD_GUESTBOOK[&#39;INCORRECT_VERIFICATION&#39;] ?>" );
    </script>

but the actual captcha-code send no field with the name "captcha", it send's a field, named the word "captcha" and the actual section-id, in my last picture captcha99 (nearly to the bottom)

if i make a "hardcode-fixing" and add my section-id to the function, it works - like this
Code: [Select]
if (isset($_GET['captcha99']) && $_GET['captcha99'] =="true"){ ?>
i remember, that WB has a captcha-field, named with "captcha" in the past and i'll check some other modules like mpform, form, news etc for a field like this,
but i wondering, why its work for matthias (ruebenwurzel) in the posted version
Title: Re: Guestbook verification (captcha) fails always
Post by: ruebenwurzel on November 05, 2023, 10:05:52 PM
Hello,

can confirm, that captcha didn't work with guestbook.

I use the guestbook only on one old private Page with captcha deactivatet. When i activate Captcha, Verification always fails.

Sorry for the wrong info in my post above. I hope on of the developpers can look to this old module. Would be nice if captcha could get to work.

Matthias