Welcome Guest, Not a member yet? Register   Sign In
FreakAuth 1.1: Captcha not working and blank page when font is found
#1

[eluser]Unknown[/eluser]
EDIT: I meant to post this in the FreakAuth 1.1 section ... not sure how to move this there

I'm not sure if the two problems are related, but this is how it happened:

I opened the register page and it loaded fine, but said that the font couldn't be found and the captcha image never displayed. I could right click on the image and do a View Image and it would say that the image in the /tmp directory couldn't be found.

I noticed that I hadn't copied the fonts over, so I did that. Now the font is there, but when I reload the register page, it is now blank after I wait for about 30 seconds for it to load.

Permissions on the /tmp folder is set to 777 and I've used GD2 before in other apps to generate images, so I don't think it's a GD2 issue, but I could be wrong. My GD settings for PHP (I'm running PHP 5.2.5) are as follows:

GD Support: enabled
GD Version: 2.0 or higher
FreeType Support: enabled
FreeType Linkage: with freetype
FreeType Version: 2.3.5
GIF Read Support: enabled
GIF Create Support: enabled
JPG Support: enabled
PNG Support: enabled
WBMP Support: enabled

Any help would be appreciated. If you need more info from me, let me know.
#2

[eluser]Grahack[/eluser]
Well this post is quite old, just found it. Did you manage to make it work ? How ?
#3

[eluser]maesk[/eluser]
Grahack, I have a similar problem. It seems to be a file permissions problem but I don't know how to solve it. The JPGs for Captcha are created, but with permission set to rw- --- --- (the tmp directory has 777) - like this, the Captcha image can not be read by the script and only the alt="Captcha Image" text is displayed.
I tried all kind of things with chown and chgrp and chmod -R and so on but I can't make it work. So for now I just set $config['FAL_use_captcha_login'] = FALSE;
Like this I can still use FAL but without Captcha.
Any suggestions what to do to make it work?
#4

[eluser]Pascal Kriete[/eluser]
I've never used FAL, but just scanning the script you could try modifying the script so it changes the permissions:

Code:
//Freakauth_light.php line 1077

chmod($this->CI->config->item('FAL_captcha_image_path').$image, 0777);

Otherwise you could also look into creating a umask for the folder.
#5

[eluser]maesk[/eluser]
Thank you, inparo.
Solution a) seems very logical to me but I get this error message:
Code:
Message: chmod() [function.chmod]: No such file or directory
So I thought the path or filename may not be correct and I found that
Code:
echo($config['new_image']);
gives me the correct path and filename: tmp/1206955298.91.jpg
Then I tried to change your code to this:
Code:
chmod($config['new_image'], 0777);

but I get the same error message.

So I tried umask() and after some experimentation it works, if I put it on line 1072 (after $image->image_lib->initialize($config) and before $this->CI->db_session->set_userdata('FreakAuth_captcha', $securityCode);
Code:
$image->image_lib->initialize($config);
umask(022);
if ( ! $image->image_lib->watermark())
  {
  echo $image->image_lib->display_errors();
  };
...

Is this just changing the umask for the tmp directory? How would I do this on the shell?
I don't really understand what's going on here. FAL including Captcha worked without problems on other servers. Also, the default umask seems to be 022, so why does it create new files with 700?


Thanks again,
maesk
#6

[eluser]Pascal Kriete[/eluser]
What umask does is change php's standard umask to the value you specify.

Your apache user seems to be setup with an odd umask, that would be first place to look. Assuming that you're running apache in a chrooted jail (which you should), calling `umask 022` from the shell in that environment (as root) might do the trick as well.
#7

[eluser]maesk[/eluser]
I will check that, thanks inparo!
#8

[eluser]Adin[/eluser]
If you're running 10.5.X on intel, and you've made the appropriate 32bit changes, you might be running into the second part of this issue
http://ellislab.com/forums/viewthread/97277/




Theme © iAndrew 2016 - Forum software by © MyBB