Firefox PHP

Non-graphical CAPTCHA when posting

Posted by sheik 
Re: Non-graphical CAPTCHA when posting
April 12, 2006 05:57PM
Sounds like a hook problem then, maybe something has changed between versions.
I'm happy to fix it (in fact I'll have to when I upgrade) but like I say, it will have to wait until I have free time :-(

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
tm
Re: Non-graphical CAPTCHA when posting
May 04, 2006 08:47PM
i had to add 1 line in post_captcha.php:

...
$_POST["preview"] = 1; // set preview so it is af if the user clicked "preview" instead of post
unset($_POST["finish"]); // unset finish so that preview could kick in


so far it seems working.
Re: Non-graphical CAPTCHA when posting
May 09, 2006 06:40AM
Hi, I just installed phorum (5.1.11) and I can't manage to get this to work... anybody got it to work on this version?



Edited 1 time(s). Last edit at 05/09/2006 06:40AM by nublaii.
Cleaning out old files
May 21, 2006 05:13PM
I just set up a version of this on my site - thanks!

There's a problem with your suggested cron handling for clearing out old tmp files, though -- there's always the possibility that you'll delete a file while a user is still typing in the code (and possibly editing the post, so there could be a 20 minute window in there where the file needs to stay active).

I'm getting around this by changing the cron entry to only delete *.txt files older than 30 minutes. Example cron entry:

0 * * * * find /home/username/forumROOT/tmp_post_captcha -type f -mmin +30 -name '*.txt' | xargs rm -f

That'll run once an hour.
By the way, there's a typo in that section of the readme also:

Quote

or every 30 minutes :
0,30 1 * * * rm <your CAPTCHA temp path>/*

Change the 1 to a *, otherwise this will run at 1:00am and 1:30am only.

Thanks for the mod!
Re: Non-graphical CAPTCHA when posting
May 24, 2006 12:52PM
Hi,

This module seems to be running great on our servers (thanks so much for developing it, it is a godsend). The problem is it is throwing a bunch of errors into our apache logs. I am copying two of them below as they seem to be the most common. Is there some additional configuring we need to do either in phorum or captcha?

thanks for any help in advance

PHP Notice: Use of undefined constant all_users - assumed 'all_users' in /www/phorum/mods/post_captcha/post_captcha.php on line 32


PHP Notice: Undefined index: ERROR in /www/phorum/mods/post_captcha/post_captcha.php on line 36
Re: Non-graphical CAPTCHA when posting
May 31, 2006 03:20PM
Okay, I added the following line

error_reporting(0);

and it appears to be supressing the error messages from the apache log. Is there any reason I would not want to do this?

I looked on php.net but couldn't tell if it would supress all php errors or just those from this particular program, anyone know?

james
Re: Non-graphical CAPTCHA when posting
June 01, 2006 04:29AM
The reason not to do this is that it's better to write code that doesn't spawn warnings at all. That's the first big step in writing bug free code. This will catch typos in variable names for example. So for quick-fixing a working script in a live environment it is allright, but developers should always use all the error reporting they can get while developing.

After calling this function, error reporting will stay disabled. So up to this call errors are logged and after this call they are not anymore.

Fixing hints (haven't got much time to look at the code myself right now)

Use of undefined constant all_users - assumed 'all_users'
There's most probably an array use somewhere, looking like $array[all_users], which should be changed to $array['all_users'].

Undefined index: ERROR
Probably caused by looking at some $array['ERROR'] without checking if it's defined. If there is something like this: if ($array['ERROR']) then use: if (isset($array['ERROR'])). If it is like: if ($array['ERROR'] == 'aloha') then use: if (isset($array['ERROR']) && $array['ERROR'] == 'aloha')

I hope this helps.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Non-graphical CAPTCHA when posting
June 01, 2006 11:59AM
Maurice,

Thanks for the reply, I don't want you to think I am a total noob with respect to this. If I had the time or the skills I would chase the error messages, but since I posted here about the errors and NO ONE replied to it I figured I was totally on my own. It also appears that the errors are more like warnings than serious issues. Hense this, less than perfect solution.

When I have the time I shall go back into the code and I am sure your suggestions will be helpful.

Again, thanks for taking the time to reply, it is much appreciated.

james
Re: Non-graphical CAPTCHA when posting
June 01, 2006 07:07PM
Sorry, I've only just seen this bug report.
Please enclose both instances of all_users in post_captcha.php with quote marks.
ie: Line 32 should be changed to:
if (($PHORUM["mod_post_captcha"]["all_users"] === false) && $PHORUM["user"]["user_id"] > 0){

and the same for line 94:

if (($PHORUM["mod_post_captcha"]["all_users"] === false) && $PHORUM["user"]["user_id"] > 0){

@jtheory - nice enhancement to the cronjob!

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Non-graphical CAPTCHA when posting
June 08, 2006 06:19AM
hello,

Sorry for this stupid question and my bad english.
I've installed the captcha module, but when i want to update settings, i have only this message
"There are no settings for this module"

My post_captcha_tmp directorie is on 777.

I'm not admin on serveur (ressources are partaged)

Thanks.
Jyhes
Sorry, only registered users may post in this forum.

Click here to login