Solved

Why, adjusting the Lyla Captcha xml file does not work?

Posted on 2006-10-27
33
404 Views
Last Modified: 2013-12-24
I have been messing with the xml file to make adjustments on the appearence of the jpeg, but the changes do not make a difference. Height, width, backgroundColor, all do not change anything.
What needs to be done for the adjustments to work
0
Comment
Question by:dawes4000
  • 16
  • 14
33 Comments
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17821413
Please post the code in your captcha.xml file.
0
 

Author Comment

by:dawes4000
ID: 17821517
Something is going on that concerns me. I completely renamed every file in the captcha directory to
OLDcaptcha.xml, OLDcaptchaService.cfc and the form still works, the JPEG is rendering. I closed the browser opened a new one thinking a session was stored, but the problem persists. This explains why my adjustments to the xml file did nothing, it's not being used. Does the CFC create a persistant object on the server?
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17821598
No persistent objects here. Are you sure you are looking at the files in the right directory? Did you copy files to a new working directory to test with?
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17821606
Oh, hold on. You might have to refresh the xml file by removing the condition in the Application file, reload the page (which will give you an error that the xml file cannot be found) then put the condition back on.
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17821612
Like this:

<cfparam name="url.reinit" default="false">
<!--- initalize the captcha with the xml config --->
<!--- cfif not structKeyExists(application,"captcha") or url.reinit --->
      <cfset application.captcha = CreateObject("component","captcha.captchaService").init(configFile="captcha/captcha.xml") />
      <cfset application.captcha.setup() />
<!--- /cfif --->

I commented out two lines of code.
0
 

Author Comment

by:dawes4000
ID: 17821708
OK, I commented the code out saved the application.cfm page, closed all browsers, then re-opened captcha.cfm.
the error appeared: cannot find "captcha.captchaService", I closed the browser opened application.cfm un-commented necessary code, saved it, then reopened captcha.cfm. The JPEG appears.

If the captchaService object is persisting shouldn't that have cleared it up? Is my server caching the object?
Is there a way to reinit application("captcha")?
0
 

Author Comment

by:dawes4000
ID: 17821742
Oneiroid,

I tried breaking the application.captcha and the captchaservice is still working.

<cfparam name="url.reinit" default="false">
<!--- initalize the captcha with the xml config --->
<cfif not structKeyExists(application,"captcha") or url.reinit>
     <cfset application.captcha = ""/>
     <cfset application.captcha.setup() />
</cfif>
0
 

Author Comment

by:dawes4000
ID: 17821798
<cfdump var="#application#">
I get 12 components.\

Is there a way to flush the application.captcha? is'nt application.cfm dependent on sessions and so when the browser closes the session is cleaned out?
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17821812
Leave those two lines of code commented out for the time being. There is something else going on here. you will know when you've fixed the new problem when the captcha images shows up but says "Captcha Image Unavailable" or something like that. Once you get there, uncomment those lines and it should work.

BUT, you have a new problem. Commenting out those lines shouldn't have given you a captchaService error. Can you please confirm that captchaService.cfc is in located in the captcha folder (this folder should be on the same level as your Application.cfm).
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17821820
Those vars will be over written when you refresh the page, I believe. I have never had to reopen a browser to target issues with lyla captcha.
0
 

Author Comment

by:dawes4000
ID: 17821878
Here is the structure of mywebsite directory:

captcha.cfm
captchaResult.cfm
captcha DIR
     img DIR
     captcha.xml
     captchaService.cfm
     captchaServiceConfigBean.cfc

img DIR and  captchaServiceConfigBean.cfc ar no longer need correct?

Also, I tried the following:
in application.cfm I have the following
<cfapplication name="mywebsite" clientmanagement="No" sessionmanagement="Yes" setclientcookies="No" sessiontimeout="#CreateTimeSpan(0,4,0,0)#" applicationtimeout="#CreateTimeSpan(2,0,0,0)#">

I set, applicationtimeout="#CreateTimeSpan(2,0,0,0)#" to applicationtimeout="#CreateTimeSpan(0,0,0,0)#"

this nuked the application all together, after I changed span back to (2,0,0,0) nothing has been working.
I think I'm going bad to worse.
0
 

Author Comment

by:dawes4000
ID: 17821894
Now I get
"Could not find the ColdFusion Component captcha.captchaService."
I have restored my application.cfm back to the original working state but the error above persists now.
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17821918
Session vars will not affect what you are trying to fix.

Is your Application.cfm on the same level as captcha.cfm?

Rename captchaService.cfm to captchaService.cfc
0
 

Author Comment

by:dawes4000
ID: 17821953
My mistake
captchaService.cfm is actually captchaService.cfc (typo)

AND

Yes, Application.cfm is on the same level as captcha.cfm

0
 

Author Comment

by:dawes4000
ID: 17822008
I renamed the service to captchaService01.cfc to test for persistence, the test past.
Now in captchaService01.cfc it is looking for the Bean
"Could not find the ColdFusion Component captchaServiceConfigBean." that is because it is named OLDcaptchaServiceConfigBean.cfc
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Expert Comment

by:Oneiroid
ID: 17822064
Where are you calling captchaServiceConfigBean from?
0
 

Author Comment

by:dawes4000
ID: 17822109
My captchaService.cfc that I downloaded from http://lyla.maestropublishing.com/
calls out the bean.
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17822184
Then rename your config bean file to something captchaService recognizes (captchaServiceConfigBean.cfc)
0
 

Author Comment

by:dawes4000
ID: 17822292
Yes, I did that. But from the time I nuked the applicationtimeout I have not been able to get any of the captcha to work. I have restored all files to the original configuration I had when the app was working... except for the xml adjustments. Any how, let roll back time a bit.
and work on this problem:
"Could not find the ColdFusion Component captcha.captchaService."
Line Below throws the error in application.cfm:
<cfset application.captcha = CreateObject("component","captcha.captchaService").init(configFile="captcha/captcha.xml") />

captchaService is located at captcha/captchaService.cfc
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17822370
I'm not quite sure what is causing this error. As long as captcha/captchaService.cfc exists (and named correctly), CreateObject("component","captcha.captchaService") should find it no problem...
0
 

Author Comment

by:dawes4000
ID: 17822629
Oneiroid,
I appreciate your patience here. Ok back to sqaure one. I have retored the original downloaded file to the mywebsite directory, that cleaned things up. Apparently by renaming the file Win OS must have added something to the files after that the ended up 2kb larger than the originals. Needless to say, the files are restored. I don't have the error
"Could not find the ColdFusion Component captcha.captchaService."
any longer, however the JPEG is not apearring. I have provided the source below:

<input type="hidden" name="captchaHash" value="564B007BA6273C149E68A2EAC465F59AFF09FEB0" />
<img src="showCaptcha.cfm?hashReference=564B007BA6273C149E68A2EAC465F59AFF09FEB0" border="0" />

under captcha DIR I have an img DIR and in the captcha DIR the captcha.xml directory path looks like this:
<config name="outputDirectory" value="/img"/>
0
 

Author Comment

by:dawes4000
ID: 17822667
Sorry,
<config name="outputDirectory" value="captcha/img"/>

Now the JPEG appears and the Turing test is working again. OK...
Back to the adjustments on the captcha.xml... Still not working.
I will not mess until I hear from you. View the contents of captcha.xml below:
<captcha version="1.0">
      <configs>
            <config name="outputDirectory" value="captcha/img"/>
            <config name="outputDirectoryIsRelative" value="true"/>
            <config name="saltType" value="auto"/><!-- auto/defined -->
            <config name="saltValue" value=""/>
            <config name="jpegQuality" value="0.90"/>
            <config name="jpegUseBaseline" value="true"/>
            <config name="useAntiAlias" value="true"/>
            <config name="randStrType" value="alpha"/>
            <config name="randStrLen" value="6"/>
            <config name="width" value="250"/>
            <config name="height" value="75"/>
            <config name="fontsize" value="30"/>
            <config name="leftOffset" value="20"/>
            <config name="shearXRange" value="25"/>
            <config name="shearYRange" value="25"/>
            <config name="fontColor" value="light"/>
            <config name="backgroundColor" value="light"/>
            <config name="useGradientBackground" value="true"/>
            <config name="backgroundColorUseCyclic" value="true"/>
            <config name="useOvals" value="true"/>
            <config name="ovalColor" value="medium"/>
            <config name="ovalUseTransparency" value="true"/>
            <config name="minOvals" value="15"/>
            <config name="maxOvals" value="20"/>
            <config name="useBackgroundLines" value="true"/>
            <config name="backgroundLineColor" value="medium"/>
            <config name="backgroundLineUseTransparency" value="true"/>
            <config name="backgroundMinLines" value="5"/>
            <config name="backgroundMaxLines" value="10"/>
            <config name="useForegroundLines" value="true"/>
            <config name="foregroundlineColor" value="light"/>
            <config name="foregroundLineUseTransparency" value="true"/>
            <config name="foregroundMinLines" value="5"/>
            <config name="foregroundMaxLines" value="10"/>
      </configs>
      <fonts>
            <font use="true" name="Arial"/>
            <font use="true" name="Arial Black"/>
            <font use="true" name="Arial Cursiva"/>
            <font use="true" name="Arial Negreta"/>
            <font use="true" name="Arial Negreta cursiva"/>
            <font use="true" name="Comic Sans MS"/>
            <font use="true" name="Comic Sans MS Negreta"/>
            <font use="true" name="Courier New"/>
            <font use="true" name="Courier New Cursiva"/>
            <font use="true" name="Courier New Negreta"/>
            <font use="true" name="Courier New Negreta cursiva"/>
            <font use="true" name="Georgia "/>
            <font use="true" name="Georgia Cursiva"/>
            <font use="true" name="Georgia Negreta"/>
            <font use="true" name="Georgia Negreta cursiva"/>
            <font use="true" name="Impact"/>
            <font use="true" name="Lucida Bright Demibold"/>
            <font use="true" name="Lucida Bright Demibold Italic"/>
            <font use="true" name="Lucida Bright Italic"/>
            <font use="true" name="Lucida Bright Regular"/>
            <font use="true" name="Lucida Console"/>
            <font use="true" name="Lucida Sans Demibold"/>
            <font use="true" name="Lucida Sans Regular"/>
            <font use="true" name="Lucida Sans Typewriter Bold"/>
            <font use="true" name="Lucida Sans Typewriter Regular"/>
            <font use="true" name="Lucida Sans Unicode"/>
            <font use="true" name="Microsoft Sans Serif"/>
            <font use="true" name="Palatino Linotype"/>
            <font use="true" name="Palatino Linotype Cursiva"/>
            <font use="true" name="Palatino Linotype Negreta"/>
            <font use="true" name="Palatino Linotype Negreta cursiva"/>
            <font use="true" name="sansserif"/>
            <font use="true" name="sansserif.bold"/>
            <font use="true" name="sansserif.bolditalic"/>
            <font use="true" name="sansserif.italic"/>
            <font use="true" name="serif"/>
            <font use="true" name="serif.bold"/>
            <font use="true" name="serif.bolditalic"/>
            <font use="true" name="serif.italic"/>
            <font use="true" name="Tahoma"/>
            <font use="true" name="Tahoma Negreta"/>
            <font use="true" name="Times New Roman"/>
            <font use="true" name="Times New Roman cursiva"/>
            <font use="true" name="Times New Roman Negreta"/>
            <font use="true" name="Times New Roman Negreta cursiva"/>      
            <font use="true" name="Trebuchet MS"/>
            <font use="true" name="Trebuchet MS Cursiva"/>
            <font use="true" name="Trebuchet MS Negreta"/>
            <font use="true" name="Trebuchet MS Negreta cursiva "/>
            <font use="true" name="Verdana"/>
            <font use="true" name="Verdana Cursiva"/>
            <font use="true" name="Verdana Negreta"/>
            <font use="true" name="Verdana Negreta cursiva"/>
      </fonts>
</captcha>
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17822689
No, worries, We'll keep hacking at this ;)

First, make sure that you have write permissions on that img folder.

Second, change your output directory line to:
<config name="outputDirectory" value="./captcha/img/"/>
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17822717
Ok! Now, comment out those two lines in the Application.cfm like I showed above and refresh the page with the image on it.

You should get a graphic, but it should say something like Captcha image not available.

Change only this and let me know what happens to your image!
0
 

Author Comment

by:dawes4000
ID: 17822896
I have write permissions on that img folder.

Second, I changed output directory line to:
<config name="outputDirectory" value="./captcha/img/"/>

The JPEG works.

I went to the server setting and adjusted the application varibale min and max to 20 secs
and within the application.cfm itself. (0,0,0,20)

The xml file works now!!!!

On to the config of the xml file....
how can I make it so the letters are all caps, I can not tell "I" from "L" when lower case.
and the serif fonts make it difficult for me as well.
0
 
LVL 4

Accepted Solution

by:
Oneiroid earned 250 total points
ID: 17822947
It's all here:
http://lyla.maestropublishing.com/LylaCaptchaDocumentation.pdf

Set randStrType to alphaUCase for character all in upper case.
0
 
LVL 4

Expert Comment

by:Oneiroid
ID: 17822961
Why are you using an application timeout? All I use is the session timeout...
0
 

Author Comment

by:dawes4000
ID: 17823005
Is there a way to remove the layacaptcha water mark it appears infront othe letter makes them difficult to read?
Using the documentation I am commenting out all of the serif and italic fonts. Thanks.
I have decreased the y-shear but the letters offset way to much, I want to shrink the height to 32.
Will you help with the shear setting?

application timeout was set up during the original onfiguration of a live site by a person that is no longer here.
I imagine it was a default setting. I am not certain yet why it was configured this way, and I'm hesitant to remove it completely because I'm not sure if an application var is set somewhere.
0
 

Author Comment

by:dawes4000
ID: 17823208
Giving this a break, forum more tomorow. :)
0
 

Author Comment

by:dawes4000
ID: 17834312
Oneiroid,
I think I've got this one nailed now. Thanks for your assistance.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now