Forum plugin and CAPTCHA image issues

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Forum plugin and CAPTCHA image issues

Post by Timbalu »

Well no, I don't think it is possible that haven't enough box space, limits the output, without any errors or truncated output, or so.

OK, it seems you don't need the bee.
But I still think it must be some missing option or wrong order.
Did you check your spamblock options to have Captchas enabled and the following captchas_ttl ('Force captchas after how many days') option to have a value of 0. If set to 0, captchas will always be used.
And where is the spamblock plugin located in the list order vs. adduser and the re-captcha plugin?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
bdesanto
Regular
Posts: 18
Joined: Sun Apr 21, 2013 7:54 pm

Re: Forum plugin and CAPTCHA image issues

Post by bdesanto »

Ok, just a thought since nothing else seems to be working out.

I do have the Force CAPTCHAS setting at 0 and I made sure they are enabled everywhere that there is the option to enable them. As far as the order, it goes: ReCAPTCHA, Spam Blocker, User Self Registration, Discussion Forum, Markup, etc..

The strange part is, it doesn't even show a place holder for where the CAPTCHA image should be, but it expects a valid CAPTCHA to be entered. If you have a chance give it a try and you will see what I mean. It seems to think it is showing it, is expecting it, but it simply is not there.

http://www.barodsandperformance.com/serendipity/

And so the saga continues...

Thanks Again!!!!
Bill
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Forum plugin and CAPTCHA image issues

Post by Timbalu »

I thought we already had that....
Try ReCAPTCHA, User Self Registration, Spam Blocker, in this Order, or even User Self Registration, Spam Blocker, ReCAPTCHA.
The strange part indicates, it isn't even build and hooked into the $eventData stream, at this time. This is why changing the plugin order might be the real issue.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
bdesanto
Regular
Posts: 18
Joined: Sun Apr 21, 2013 7:54 pm

Re: Forum plugin and CAPTCHA image issues

Post by bdesanto »

Problem finally solved. It seems that all of it was related to the PHP version. I downgraded to the last 5.3 version and suddenly everything works. The Re-CAPTCHA image is too large to use in the sidebar User Self Registration box, but I can work around that. Thank you for all of your help!! Stay away from PHP 5.4, it is a real pain in the backside.

Thanks again!!

Bill
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Forum plugin and CAPTCHA image issues

Post by Timbalu »

bdesanto wrote:Stay away from PHP 5.4, it is a real pain in the backside.
No, it is just this problem of the imagick PECL package still being beta, elsewise PHP 5.4.x ist doing well with Serendipity!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
bdesanto
Regular
Posts: 18
Joined: Sun Apr 21, 2013 7:54 pm

Re: Forum plugin and CAPTCHA image issues

Post by bdesanto »

Well I might have spoke too soon as there is still something that is not working correctly.

Re-CAPTCHA and standard CAPTCHA images all appear and are readable, but all you get is "Error: Wrong captcha string provided! Entry not saved!"

The funny thing about all of this is that my main website, that I host, is using Re-CAPTCHA and it works with no issues but for some reason Serendipity pages, that are hosted on the same server, with Re-CAPTCHA or standard CAPTCHA do not.

So with one site working and the other not, am I still trying to resolve a PHP or PECL extension issue, or is this something to do with my Serendipity configuration? Any help is greatly appreciated!

Thanks in advance.
Bill
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Forum plugin and CAPTCHA image issues

Post by Timbalu »

Where, related to adduser, is the spamblock plugin in your Plugin list?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
bdesanto
Regular
Posts: 18
Joined: Sun Apr 21, 2013 7:54 pm

Re: Forum plugin and CAPTCHA image issues

Post by bdesanto »

Spam Protector is first then adduser.

It gives the same error when trying to comment in the Forum plugin also. Forum plugin is third in the list of plugins.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Forum plugin and CAPTCHA image issues

Post by Timbalu »

If you want spamblock to listen on sent captchas, place it after the sending plugins (and save the plugin list).
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
bdesanto
Regular
Posts: 18
Joined: Sun Apr 21, 2013 7:54 pm

Re: Forum plugin and CAPTCHA image issues

Post by bdesanto »

Ok, I moved the order of the plugins to : User Self-Reg, Discussion Forum, Spam Protector. Doing this solved 50% of the problem meaning that now the User Self-Reg works but the Forum plugin comments still give the same error about the CAPTCHA being incorrect. I tried moving the Forum plugin before and after the Spam Blocker plugin, but no change. I also just tried using the Spam Bee plugin with the same results. Any other ideas? Any help is much appreciated!!

Thank you!
Bill
bdesanto
Regular
Posts: 18
Joined: Sun Apr 21, 2013 7:54 pm

Re: Forum plugin and CAPTCHA image issues

Post by bdesanto »

I think I found the issue. CAPTCHAS work fine on the main blog, but not on the forum plugin. Seems to be a user rights issue. If you do not have sufficient rights for the blog it simply does not show the option to comment, however the same is not true for the forum plugin. For some reason if you do not have the correct rights to post comments in the forum plugin it will still allow you to go all the way through the process including the CAPTCHA entry, but it will say the CAPTCHA was not correctly entered. By changing the rights I was able to get CAPTCHAS to authenticate in the blog, forum plugin and user self-reg plugin. Changing them back immediately causes the forum plugin to claim the CATCHAS were incorrect.

Is it possible to fix the forum plugin so that it does not give you the option to comment if the rights do not allow it, just like the blog does? Or is this going to be too involved to be worth it?

Hopefully all of this has been helpful to others that have run into similar issues. Thank you for all of your time and assistance.

Bill
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Forum plugin and CAPTCHA image issues

Post by Timbalu »

Bill, just to clear before - I never used the forum plugin before.

The Captcha check should be the same as in the contact form plugin. This does not rely on any Serendipity permissions, as far as I lnow.
So at the end, I did not really understand which kind of permissions you changed to get this to work. OR, what you did to get to this point.

About the new option ... you want to have an option to disable the forums guest access, right? So that a forums post and reply access is allowed to Serendipity members only, and these still need to use captchas, since you don't want to verify each member to have nice access, right? That should be possible, I think.

Maybe someone other drops in to clear things up here...
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
bdesanto
Regular
Posts: 18
Joined: Sun Apr 21, 2013 7:54 pm

Re: Forum plugin and CAPTCHA image issues

Post by bdesanto »

When I say permissions I mean user permissions. Example would be, if you go to my site and try to enter a comment on the blog, there is no place to click to do so because you are not a registered user. But if you log in, then the link to comment on the blog appears and you are able to comment.

Now with the Forum that is not the case. If you are not a registered user it will still allow you to enter a comment/reply to postings at least until you enter the CAPTCHA and click submit, then you get the CAPTCHA error. Now if you log in, then go through the same process, including the CAPTCHA entry, click submit, everything works.

It would be helpful if the Forum plugin removed or at very least gave a message to non-registered users that lets them no it is not possible to comment/reply if you are not registered. The blog simply hides the comment link which is effective.

I hope this clear things up a little.

Thank you...
Bill
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Forum plugin and CAPTCHA image issues

Post by Timbalu »

Yes, thats because the forum has a guest access enabled, but not as an option to turn it off.

I cannot install this plugin here, so I could not test anything, but please test this in your files

https://github.com/s9y/additional_plugi ... .php#L1814
replace

Code: Select all

if ($thread[0]['flag'] != 1) {
with

Code: Select all

if (serendipity_userLoggedIn() && $thread[0]['flag'] != 1) {

https://github.com/s9y/additional_plugi ... .php#L1496
add

Code: Select all

$serendipity['smarty']->assign('guestaccess', (serendipity_userLoggedIn() ? true : false));

https://github.com/s9y/additional_plugi ... ist.tpl#L7
and
https://github.com/s9y/additional_plugi ... st.tpl#L48
replace both

Code: Select all

<div align="right"><a href="{$newthreadurl}"><img src="{$relpath}/img/new_thread.png" alt="{$CONST.FORUM_PLUGIN_NEW_THREAD}" title="{$CONST.FORUM_PLUGIN_NEW_THREAD}" border="0" /></a></div>
on their place with

Code: Select all

{if $guestaccess}<div align="right"><a href="{$newthreadurl}"><img src="{$relpath}/img/new_thread.png" alt="{$CONST.FORUM_PLUGIN_NEW_THREAD}" title="{$CONST.FORUM_PLUGIN_NEW_THREAD}" border="0" /></a></div>{/if}
This should disable "reply", "quote" and "new thread" buttons to guest users and could be a temporary solution for you to live with, I assume.

The other solution via an option to disable guest access, would need some extra work, or, in an easy solution, would disable the forum showup for non-logged-in users in total.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
bdesanto
Regular
Posts: 18
Joined: Sun Apr 21, 2013 7:54 pm

Re: Forum plugin and CAPTCHA image issues

Post by bdesanto »

Ian,
I did all of the suggested code changes and after some testing it seems that you hit a home run.

Everything worked exactly as you thought it would! Thank you so much for all of your help, it is greatly appreciated!

Bill
Post Reply