Image Captcha displays in admin but not on forms

decibel.places - June 15, 2008 - 19:54
Project:CAPTCHA
Version:6.x-2.x-dev
Component:Image Captcha (image_captcha)
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Image Captcha displays in admin but not on forms - not even with "built-in" bitmap font (but tried ttf fonts too)

Other captchas display fine, math (Captcha module), css, ascii are all ok

http://hcshc.netsperience.org

no image captchas enabled now - ascii captcha on contact http://hcshc.netsperience.org/contact

using Drupal v 6.2

#1

soxofaan - June 15, 2008 - 20:17
Project:CAPTCHA Pack» CAPTCHA
Version:6.x-1.0-beta2» 6.x-1.0-rc2
Component:Code» Image Captcha (image_captcha)
Category:bug report» support request
Status:active» postponed (maintainer needs more info)

Image CAPTCHA is part of the base CAPTCHA module, not part of CAPTCHA pack. I guess you're using CAPTCHA module version 6.x-1.0-rc2.

So image CAPTCHA works on admin page but not on forms?
I assume you mean that the html elements for the CAPTCHA are there, but the image does not load in the form?
Can you also try if the image CAPTCHA works for authenticated users without the "skip CAPTCHA" permission?

#2

decibel.places - June 15, 2008 - 22:22

sorry I thought Image Captcha was part of Captcha Pack (obviously)

Tried CAPTCHA module version 6.x-1.0-rc2 now using 6.x-1.x-dev which is newer (I know it's not officially recommended yet, but same problem in both)

The image captcha displays for an auth user without skip captcha permission - but not for anonymous user (ie on registration or contact form, where it is most needed!)

S'ok I'll just use a different captcha there, like ascii or math.

Thanks for asking

#3

chipway-drupal - June 25, 2008 - 15:46

Hi,

I got exactly the same problem with same rc2 release.

Any new idea ?

Thanks

#4

waldmeister - June 30, 2008 - 08:28
Category:support request» bug report
Status:postponed (maintainer needs more info)» active

same here

drupal 6.2 - some modules installed.

no captcha image with anonymous user.
tried all permissions - no effect.

update:
did try to write out the image with:
imagejpeg  ($image  , "recheck.jpg");
works as user, not as anon
somewhere the image generation fails...

update2:
no, it is not the image generatien, CSS, Text, Image - all the same. Working als authenticated user but not as anonymous.
Text and CSS CAPTCHA say: wrong token

#5

soxofaan - June 30, 2008 - 08:27

Please try the following (based on http://drupal.org/node/271883#comment-887078)

disable line 21 in image_captcha.user.inc (v 6.x-1.x):

<?php
 
// unset the code from $_SESSION to prevent rerendering the CAPTCHA
  // unset($_SESSION['image_captcha'][$seed]);
?>

This makes it possible to request the image more than one time, which makes debugging easier

Now go to a form or the admin page where a CAPTCHA image should show up. Try to find out the url of the image, you can do this for example by looking in the html source or right clicking on the image and chose something as "view image" (depending on which browser you use). The url should be something like http://example.com/?q=image_captcha/715730387 .
Load this url by pasting it in the address bar of your browser and report the error message if any.

#6

waldmeister - June 30, 2008 - 08:42

as i found out - it has not to do with the image...its the whole module....

CSS, Text, Image - none of the capture modules works as anonymous.
Something different in the drupal6-api or just some kind of "deeper bug"?

update - some thoughts:

could it be the invoke of the image-captcha-module? does the external module load?
could it be session management? that sessions are not fully enabled as anon?

sorry...no facts...just darkness...

#7

soxofaan - June 30, 2008 - 09:00

I can't reproduce:
Drupal 6.2 + CAPTCHA 6.x-1.0-rc2
simple math CAPTCHA on comment form
wrong answers get blocked, right answers are let through
The image CAPTCHA also works just fine.

The 6.x-1.x branch of CAPTCHA is a straightforward port of the 5.x-3.x branch, there are no API changes

If no challenge type works, it's probably a session problem: check if you have a user with uid=0 in your users table

If your image CAPTCHA does not show up, please follow the istructions in #5 and report back

#8

waldmeister - June 30, 2008 - 09:01

Okay. one more:

I switched to text-captcha and enabled an output of the array $captcha, with solution etc.

Array ( [solution] => amiwe [form] => Array ( [captcha_response] => Array ( [#type] => textfield [#title] => What is the first word in the phrase "amiwe fucudeh meyek esoroxo etuj"? [#weight] => 0 [#size] => 15 [#required] => 1 ) ) )

yeah, i am anonym...getting the right display with the right solution.....
but trying to solve ends up in "Invalid CAPTCHA token."

While switching back to image, i realized, that the array is complete - witch characters etc... but the image is missing (yes, shown in the print_r($captcha) when logged in)

plz help...

#9

waldmeister - June 30, 2008 - 09:25

so this is the "known" uid=0 - Bug

i think we can ask for role=1 ?

http://api.drupal.org/api/function/drupal_anonymous_user/6 returns a full anonymous user-object, but i cannot find any is_anon_user funktion...hmmm

semms to be the only way to rename the uid in my table...

#10

soxofaan - June 30, 2008 - 09:39

so this is the "known" uid=0 - Bug
i think we can ask for role=1 ?

If you don't have a uid=0 in your users table, you should add one (there is no other way for CAPTCHA 5.x-3.x and CAPTCHA 6.x-1.x)
it has nothing to do with roles (CAPTCHA needs sessions, which are tied to users, not to roles)

#11

mistknight - February 7, 2009 - 22:05

What I'm seeing is the ALT part of the image captcha which reads "Image CAPTCHA" rather than the image itself.

If I paste the image URL in the browser it shows up ok... Just seems to be like the captcha URL isn't generating fast enough perhaps making ff3 think it's just invalid or something?

#12

decibel.places - February 8, 2009 - 01:52

@OP

I have moved the site (which is still in dev) in the original post - not sure if captcha is still a problem

new url is http://comhco.decibelplaces.com/

#13

Apollo610 - February 14, 2009 - 15:52

I'm having the same issue w/ captcha - however, on my localhost ImageCaptcha is displaying fine when I go to my new user registration page, but when I try doing it on my shared hosting box, I get the Alt Text result with no image.

I've temporarily switched over to the MATH captcha and I'm now getting invalid token as well. I'm using RC2.

Upgrading to 6.0-2.x-dev fixed these issues.

#14

Sandymaguire - March 3, 2009 - 12:44

Like Apollo610
i too having the same issue
to replicate that on my localhost ImageCaptcha is displaying fine when I go to my new user registration page, but when I try doing it on my shared hosting box, I get the Alt Text result with no image.

#15

Sandymaguire - March 4, 2009 - 09:09

This may sound as a rubbish solution.... But for not it worked great for me.

replace

$result['form']['captcha_image'] = array(
'#type' => 'markup',
'#value' => '',
'#weight' => -2,
);

on line 139 on image_captcha.module with the following

$result['form']['captcha_image'] = array(
'#type' => 'markup',
'#value' => 'http://www.istockphoto.com/file_thumbview_approve/1883946/2/istockphoto_...); background-image:url(http://www.example.com/pine-wood-texture.jpg); display:block; height:40px; text-align:center; width:100px;">',
'#weight' => -2,
);

1.U are setting the alternative text alt= "'.t('image CAPTCHA') with alt="'. t($code).
2.Strike through the text.
3.Also display a background image behind the code.

#16

Apollo610 - March 4, 2009 - 14:03

Just for the record, if you use the DEV package of CAPTCHA from 2/7 (and not the beta2 official release) the problems should be resolved.

At least, they were fixed for me...

#17

soxofaan - May 9, 2009 - 17:15
Version:6.x-1.0-rc2» 6.x-2.x-dev
Status:active» fixed

CAPTCHA version 6.x-2.x should fix the issues discussed in this thread, so I'm setting it as fixed (the branch 6.x-1.x not actively maintained anymore).
please reopen if you still experience problems

#18

System Message - May 23, 2009 - 17:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.