Guestbook module & Captcha

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
wientanz

Guestbook module & Captcha

Post by wientanz »

Hi,

I'm currently using CMSMS 1.02 on www.wientanz.com.
My problem lies with the Guestbook module and the Captha module. When I activate Captcha for the Guestbook it tells me, that it's installed and everything, but when I call the page http://www.wientanz.com/index.php?page=gastebuch I see that there is a space for a captcha image, but it's missing. The link for the image is http://www.wientanz.com/hermes/web07/b2 ... 6d6834.jpg
and should be
http://www.wientanz.com/modules/Captcha ... 6d6834.jpg

It mixes the hostname with the absolute path! Is there any way to change that? Tried to run the Guestbook without captcha, but I get spam entries almost daily...
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: Guestbook module & Captcha

Post by Dee »

Strange one, haven't seen that before.
Check the $config['root_path'] value in config.php - it should be the full path to the server root. There were some issues on windows servers when this contains backslashes, but that doesn't seem the case here.

The URL is created by the b2evo library, from the $tempfolder setting (in lib/classes/class.captchalib_b2evo.php), which uses the $config['root_path'] and does a str_replace($_SERVER['DOCUMENT_ROOT'],'',$this->tempfolder) to get the url (function get_filename_url in lib/b2evo_captcha/b2evo_captcha.class.php).
wientanz

Re: Guestbook module & Captcha

Post by wientanz »

Hi!

Well, the root path seems to be correct as everything else works fine...

Code: Select all

#Document root as seen from the webserver.  No slash at the end
#e.g. http://blah.com
$config['root_url'] = 'http://www.wientanz.com';

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/hermes/web07/b2393/pow.wientanz/htdocs';
Changed the library from b2evo to hncaptcha with no result. Any ideas? Even if it's just a workaround it's fine by me!
hesbas

Re: Guestbook module & Captcha

Post by hesbas »

In an other CMSMS website I made, on a totaly other server (XS4ALL-unix in NL) I have exactly the same problem as Wietanz. The same configuration on my other servers works fine!  ???

I guess  it is some security issue, wicht I cant figure out yet. May be an other member has som ideas?

I use CMSMS 1.0.2, Captcha 0.1.1(with latesd SVN-files already) and Guestbook 1.1.5.

Thanx
baptiste
Forum Members
Forum Members
Posts: 15
Joined: Tue Dec 05, 2006 4:58 pm

Re: Guestbook module & Captcha

Post by baptiste »

The problem in our case is due to our hosting provider not reporting the correct document root:
according to our host the document root for our site is '/homepages/20/2020202/', however it is actually '/kunden/homepages/20/2020202/' ('kunden' is German for customers).

Changing our 'root_path', 'previews_path', 'uploads_path', 'image_uploads_path' in config.php to include this 'extra' directory has fixed the captcha problem, but hasn't broken the rest of the site.

(I think it is more likely that the homepages directory, or equivalent, is preceded with a 'users' directory)
Last edited by baptiste on Tue Jan 30, 2007 11:34 am, edited 1 time in total.
tholler
Forum Members
Forum Members
Posts: 104
Joined: Sat Jan 13, 2007 12:23 pm

Re: Guestbook module & Captcha

Post by tholler »

Hi all,
I had the same problem as you had; and I released it;

just have to set the umask in global settings to 002 and everything is fine.

Try it.
mungo
Forum Members
Forum Members
Posts: 12
Joined: Thu Feb 08, 2007 6:16 pm

Re: Guestbook module & Captcha

Post by mungo »

I have a similar problem on my server, the Captcha image is missing. If I look at the image path it is:
http://mysite/cms/cms/modules/Captcha/i ... ha_xxx.jpg

For some reason it has added and extra /cms into the path.

Any ideas for a workaround?

TIA
tkeil69575

Re: Guestbook module & Captcha

Post by tkeil69575 »

hi mungo,
im having exactly the same problem for the built in contact form. did you find a solution yet?
tina
Last edited by tkeil69575 on Fri Feb 09, 2007 9:32 am, edited 1 time in total.
baptiste
Forum Members
Forum Members
Posts: 15
Joined: Tue Dec 05, 2006 4:58 pm

Re: Guestbook module & Captcha

Post by baptiste »

there is a hack to fix this problem (http://forum.cmsmadesimple.org/index.ph ... l#msg49609).

But I think this is down to an incorrect 'root_path', our site was working fine apart from the capcha image, changed the path, and the site still works fine and now captcha is also working.
tkeil69575

Re: Guestbook module & Captcha

Post by tkeil69575 »

Hi babtise,
thanks for the link, i read that, but I'm not on a windows server and am 100% sure the root path is correct.
thanks anyway :)

tina
baptiste
Forum Members
Forum Members
Posts: 15
Joined: Tue Dec 05, 2006 4:58 pm

Re: Guestbook module & Captcha

Post by baptiste »

Hi Tina,

the hack will work on any server, it involves hard coding the path to the captcha images on those 2 lines in the captcha class.
tkeil69575

Re: Guestbook module & Captcha

Post by tkeil69575 »

thanks baptiste ... guess I'll have to read the thread again more carefully :)
mungo
Forum Members
Forum Members
Posts: 12
Joined: Thu Feb 08, 2007 6:16 pm

Re: Guestbook module & Captcha

Post by mungo »

OK that hack works for me. Thanks!  ;D
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: Guestbook module & Captcha

Post by Dee »

Version 0.2 should fix the captcha image not showing up in some cases. Let me know if this version works for you without hacks.

Regards,
D
Locked

Return to “CMSMS Core”