Login Security Code Blank
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexFAQ (Frequently Answered Questions)
Author Message
halt
Newbie


Joined: Oct 20, 2004
Posts: 17

PostPost subject: Login Security Code Blank
Posted: Tue Dec 07, 2004 9:19 pm
Reply with quote

I am playing around with Dragonfly on a test site. It looks great, but the security code generates a blank blue box. I have an operational site running 8.2b where the security code works just fine. For my Dragonfly test site, however, all I see is a blank blue box (see links below).

8.2b:
example.com/index.php?name=gfx&random_num=97610

Dragonfly:
example.com/dragonfly/index.php?name=gfx&random_num=97610

I have looked at config.php and the others for extra returns at the end (as per the FAQ), but that didn't seem to fix anything. I an not very familiar with php, so "closing PHP tag" may be different from what I expect, but I've noticed that several of the files (eg. config.php, admin.php, index.php) don't terminate with "?>" in my 9.0 version as they do in 8.2b. I have experimented with this briefly with no success.

As this is a test site, re-installing is not a problem (I've done it a couple of times already), but I can't get the security code to work. Any suggestions would be appreciated.


halt please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
xfsunoles
XHTML Specialist


Joined: Apr 30, 2004
Posts: 2502
Location: Melbourne, Florida

PostPost subject: Re: Login Security Code Blank
Posted: Tue Dec 07, 2004 9:27 pm
Reply with quote

make sure there is no space after ?>
_________________

Firefox is my Favorite Browser

xfsunoles's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS
Back to top
View user's profile Visit poster's website AIM Address MSN Messenger Yahoo Messenger
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5668
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Login Security Code Blank
Posted: Tue Dec 07, 2004 10:06 pm
Reply with quote

If the security code image is empty then it could mean 2 things:

- session isn't stored properly on the server (could be related to PHP 4.2.x)
- Your server says it supports TTF but actualy it doesn't


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger
halt
Newbie


Joined: Oct 20, 2004
Posts: 17

PostPost subject: Re: Login Security Code Blank
Posted: Tue Dec 07, 2004 10:39 pm
Reply with quote

Thank you for your suggestions.

xfsunoles:
I verified that there are no spaces (or returns) after the ?> (which I added) at the end of the .php files. This didn't solve the problem. I'm confused as to why the 9.0 files do not terminate with ?>, whereas the 8.2b files did. Does this not matter?

DJMaze:
I wonder why these server related possibilities would affect 9.0 but not 8.2b. Both sites are on the same server. Are there an intricacy involved in that regard that I'm not catching?


halt please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
poldo
Dragonfly addicted


Joined: Oct 20, 2004
Posts: 381
Location: Philippines

PostPost subject: Re: Login Security Code Blank
Posted: Tue Dec 07, 2004 10:49 pm
Reply with quote

i had this problem with 8.2b before, ah, DJ asked me to verify if the bg.jpg file isnt corrupted and hola! it really was, please verify yours.
_________________
12715014116404015116304016415014
5040042115141164162151170042077

poldo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.31 (Unix)/4.0.22-standard/4.3.9/CVS
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5668
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Login Security Code Blank
Posted: Tue Dec 07, 2004 11:03 pm
Reply with quote

No this problem is related to the version of GD that is installed and if the TTF module in PHP is running.

And as i expected this is true after using the "test" function.
example.com/dragonfly/index.php?name=gfx&random_num=97610&test
example.com/dragonfly/index.php?name=gfx&test

The first image is blank and the second shows the text "test" terrible small while it should look like this cpgnuke.com/index.php?name=gfx&test (thisone is grey on black)


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger
halt
Newbie


Joined: Oct 20, 2004
Posts: 17

PostPost subject: Re: Login Security Code Blank
Posted: Wed Dec 08, 2004 5:32 am
Reply with quote

DJMaze:
Thank you as always for your quick response. I am admittedly very new with cpgNuke and php in general, but I still think it may not be as simple as a server side problem. I have installed 8.2b over top of my 9.0 test site. The security code works just fine:
example.com/dragonfly/index.php?name=gfx&random_num=97610

Also, my phpinfo indicates that GD and TTF are enabled:

GD Support enabled
GD Version bundled (2.0.17 compatible)
FreeType Support enabled
FreeType Linkage with TTF library
GIF Read Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled

Is there a difference in how 9.0 and 8.2b handle the security code? Which php file handles the security code generation?

poldo:
Thanks for the suggestion. The bg.jpg file does not seem to be corrupted, however.


halt please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
NEMINI
Diamond Supporter


Joined: Apr 22, 2004
Posts: 4551

PostPost subject: Re: Login Security Code Blank
Posted: Wed Dec 08, 2004 5:35 am
Reply with quote

Quote:
Is there a difference in how 9.0 and 8.2b handle the security code? Which php file handles the security code generation?

Yes it's been changed.

_________________
NEMINI.org, NEMINI.us, NEMINI.info, NYMINI.org

NEMINI's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
1.3.34 (Unix)/4.1.18-standard/4.4.2 /9.1.0.8 CVS
Back to top
View user's profile Visit poster's website
halt
Newbie


Joined: Oct 20, 2004
Posts: 17

PostPost subject: Re: Login Security Code Blank
Posted: Wed Dec 08, 2004 6:20 am
Reply with quote

Thanks GMINI03. I found that the security code appears to be handled within gfxchk.php. I don't know php syntax, but I'm trying to understand how the code generation works.

halt please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
NEMINI
Diamond Supporter


Joined: Apr 22, 2004
Posts: 4551

PostPost subject: Re: Login Security Code Blank
Posted: Wed Dec 08, 2004 6:23 am
Reply with quote

wish I could help further but I can't, I just know its been pretty much rewritten for dragonfly so saying it works in 8.2b doesn't help all that much.
_________________
NEMINI.org, NEMINI.us, NEMINI.info, NYMINI.org

NEMINI's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
1.3.34 (Unix)/4.1.18-standard/4.4.2 /9.1.0.8 CVS
Back to top
View user's profile Visit poster's website
halt
Newbie


Joined: Oct 20, 2004
Posts: 17

PostPost subject: Re: Login Security Code Blank
Posted: Wed Dec 08, 2004 6:28 am
Reply with quote

Yeah, so I've noticed. There seems to be a lot of similarity between the two versions of gfxchk.php, though.

CPGNuke has been great--not least of all because of the community here. I'm excited to have Dragonfly up and running eventually with all the modules I use. I wish I could help more with the conversion process. For now I'll just have to wait for those more skilled than I to do the dirty work.


halt please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
halt
Newbie


Joined: Oct 20, 2004
Posts: 17

PostPost subject: Re: Login Security Code Blank
Posted: Wed Dec 08, 2004 8:54 am
Reply with quote

After playing around with gfxchk.php, I've noticed a couple of interesting things: It works if I set $useimage = false. Also, if $useimage = true, but I force it to use ImageString() instead of imagettftext(), it works as well.

halt please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5668
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Login Security Code Blank
Posted: Wed Dec 08, 2004 3:05 pm
Reply with quote

There are 2 versions of imagettftext() and 1 works on font pixel and the other on size.

The $fontsize is multiplied by 2.4 which should result in 12 pixels.

Play with the values untill the text is displayed on the image.
Please reply with your results in here so we can integrate the solved issue with the final release.


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger
halt
Newbie


Joined: Oct 20, 2004
Posts: 17

PostPost subject: Re: Login Security Code Blank
Posted: Wed Dec 08, 2004 6:42 pm
Reply with quote

I think I've found a work around. According to the comment by 'pete at monolight dot org' about half way down the page at:

terra.di.fct.unl.pt/do...xt.php.htm

You can (1) import the code_bg.png image into a base image. (2) Create an overlay image including the security code for which you make the background transparent. Then (3) merge the two images using imagecopymerge(). I have hacked an attempt on my site and it seems to work pretty well. Below are some extracts of my modification, although you will certainly want to clean them up. Keep in mind that this is the first time I've done anything in php. $image is the base image and $image_text is the overlay.

Removed the else in if ($useimage) to force the script to execute the $image = ImageCreate(..) portion. (This line is changed below)

Changed:
PHP:
 $image = ImageCreate($chars*(4+$fontsize),20);
to
PHP:
 $image_text = ImageCreate(ImageSX($image), ImageSY($image));

Changed:
PHP:
 $background_color = ImageColorAllocate($image_text, $bred, $bgreen, $bblue);
to
PHP:
$white = ImageColorAllocate($image_text, 255, 255, 255);

Changed:
PHP:
ImageFill($image, 0, 0, $background_color);
to
PHP:
ImageFill($image_text, 0, 0, $white);

Replaced $image with $image_text in all further occurances

Scaled the font size in both occurances of imagettftext() by 1.4.

Added the following after if ($ttf) { imagettftext(...) ... }:
PHP:
imagecolortransparent($image_text,$white);
PHP:
imagecopymerge($image, $image_text , 0,0,0,0, ImageSX($image_text), ImageSY($image_text),100);

Added at end:
PHP:
ImageDestroy($image_text);

This definitely needs to be cleaned up, but I think the algorithm works. The method of handling the case where $useimage = false will have to be modified.


halt please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
Nuance
Gold Supporter


Joined: Dec 30, 2004
Posts: 223

PostPost subject: Re: Login Security Code Blank
Posted: Tue Jan 18, 2005 1:20 am
Reply with quote

Just wanted to add my experience with this-- I just set up a test site running Dragonfly RC1 upgraded from a copy of my 8.2c database. I'm having the same problem with not being able to see the security code.

Nuance's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux / Apache 1.3.31 / MySQL 4.0.20-log / PHP 4.3.10 / Dragonfly 9.0.1 Final
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexFAQ (Frequently Answered Questions) All times are GMT
Go to page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 1.0044 seconds with 19 DB Queries in 0.0732 seconds
Memory Usage: 3.05 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy