 | The requested template has been denied access to cfregistry? |  |
|
EricBourland
| Joined: 05 Jan 2007 |
| Posts: 61 |
| Location: Chicago |
|
 |
Posted: Fri Jan 05, 2007 8:13 pm |
|
 |
 |
 |
 |
Hello, friends,
I'm getting an error on my new CF page:
Security: The requested template has been denied access to cfregistry.
The following is the internal exception message: access denied (coldfusion.tagext.GenericTagPermission cfregistry)
The error occurred in C:\Websites\guardmk3f32be\Application.cfm: line 1
1 : <cfapplication
2 : name="uva"
3 : clientmanagement="Yes" |
The page is located here:
http://www.guardianhelp.org/index.cfm
Does anyone have any idea why the template application.cfm is denied access to cfregistry?
Thanks very much for any help.
Best from Eric
|
|
|
 |
 | |  |
|
Jason101
Forum Regular
| Joined: 14 Mar 2006 |
| Posts: 550 |
| Location: Harrisburg, PA |
|
 |
Posted: Fri Jan 05, 2007 8:18 pm |
|
 |
 |
 |
 |
You can not use CFRegistry in a shared hosting enviornment. And You won't find a host that lets you use it in a shared environment. It's a huge security risk. If you want to use it, you might want to consider a Windows VPS
|
|
|
|
EricBourland
| Joined: 05 Jan 2007 |
| Posts: 61 |
| Location: Chicago |
|
 |
Posted: Fri Jan 05, 2007 9:32 pm |
|
 |
 |
 |
 |
Jason, thanks for the reply.
I understand about the cfregistry tag .. but nowhere in any of my CF pages do I use the cfregistry tag.
Looking again at the error, I see that the cfapplication tag in line 1 of my code is implicated:
The error occurred in C:\Websites\guardmk3f32be\Application.cfm: line 1
1 : <cfapplication
2 : name="uva"
3 : clientmanagement="Yes" |
These pages work great on my local computer with my CFMX 7.1 development edition.
If you or anyone has any idea how I can resolve this, I'm very grateful. Thanks for your help.
best from Eric
|
|
|
 | Calling cfregistry... |  |
|
comprug
Forum Regular
|
 |
Posted: Fri Jan 05, 2007 9:38 pm |
|
 |
 |
 |
 |
Eric, I ran into this issue personally, but it was a long time ago... I forget how it was resolved. I do however remember that it had something to do with application.cfm - not application.cfm vs. .cfc, but something. If possible, could you provide the application.cfm source? I just wanted to let you know that it is most likely called by something else behind the scenes, and that i'll post back when I remember... I forget exactly what it was, but I had the exact same issue.
|
|
|
 | Got it |  |
|
comprug
Forum Regular
|
 |
Posted: Fri Jan 05, 2007 9:41 pm |
|
 |
 |
 |
 |
Well.. I sort of got it... I think it has something to do with your "clientmanagement" attribute. But I forget how exactly it calls the <cfregistry> tag. Also try support. Sorry if I couldn't be of assistance.
|
|
|
 |
 | |  |
|
EricBourland
| Joined: 05 Jan 2007 |
| Posts: 61 |
| Location: Chicago |
|
 |
Posted: Fri Jan 05, 2007 9:48 pm |
|
 |
 |
 |
 |
Dear comprug,
Thanks very much for the reply. I append my application.cfm below. really grateful for any light you can shed.
FYI I have adapted this code from the Oreilly Programming ColdFusion MX book by Brooks-Bilson, which I have been reading and studying.
Eric
<cfapplication
name="uva"
clientmanagement="Yes"
sessionmanagement="Yes"
setclientcookies="Yes"
sessiontimeout="#CreateTimeSpan(0, 0, 30, 0)#"
applicationtimeout="#CreateTimeSpan(0, 0, 30, 0)#"
clientstorage="Registry">
<!--- Check to see if the application has been initialized. If not, set the
necessary application variables and initialize the app --->
<cflock timeout="30" throwontimeout="No" type="ReadOnly" scope="Application">
<cfset IsInitialized = IsDefined('application.Initialized')>
</cflock>
<cfif not IsInitialized>
<cflock type="Exclusive" scope="Application" timeout="10">
<cfif not IsDefined('application.Initialized')>
<cfset application.DSN = "uva">
<cfset application.AdminEmail = "eric@ebwebwork.com">
<cfset application.Initialized = true>
</cfif>
</cflock>
</cfif>
<!--- set default values for client variables --->
<cfparam name="client.Email" default="Yes">
<cfparam name="client.Stocks" default="Yes">
<cfparam name="client.News" default="Yes">
<cfparam name="client.Bookmarks" default="Yes">
<cfparam name="client.BGColor" default="FFFFFF">
<cfparam name="client.FontFace" default="Arial">
<cfparam name="client.HeaderFontColor" default="000000">
<cfparam name="client.HeaderBGColor" default="6666FF">
<cfparam name="client.FontColor" default="000000">
<!--- If the user clicked the logout link, log them out --->
<cfif IsDefined("URL.Logout")>
<!--- Log out the user --->
<cflogout>
<cfset URL.Message="Thank you for logging out. Please visit again soon!">
</cfif>
<cflogin idletimeout="1800" applicationtoken="uva" cookiedomain="example.com">
<!--- If the cflogin structure does not exist, send the user to the login form. --->
<cfif not IsDefined("cflogin")>
<cfinclude template="login.cfm">
<cfabort>
<!--- Validate the user and assign roles --->
<cfelse>
<!--- If for some reason username or password is blank, send the user back
to the login form. --->
<cfif cflogin.Name is "" or cflogin.Password is "">
<cfset URL.Message = "You must enter text in both the Username and Password fields">
<cfinclude template="login.cfm">
<cfabort>
<!--- Perform the user validation --->
<cfelse>
<cfquery name="ValidateUser" datasource="#application.DSN#">
SELECT FullName, Salt, Password, Roles
FROM Users
WHERE Username = <cfqueryparam value="#cflogin.Name#" cfsqltype="CF_SQL_VARCHAR" maxlength="255">
</cfquery>
<!--- If the username and salted hashed password match, the user is
authenticated and their role(s) assigned --->
<cfif (ValidateUser.RecordCount) and (ValidateUser.Password is Hash(ValidateUser.Salt & cflogin.Password))>
<!--- If the user has no assigned roles, assign them to the generic "user" role. --->
<cfif ValidateUser.Roles is "">
<cfset ValidateUser.Roles = "User">
</cfif>
<cfloginuser name="#cflogin.Name#" password="#cflogin.Password#" roles="#ValidateUser.Roles#">
<cflock name="sLogin_Lock" timeout="30" type="Exclusive">
<cfset session.FullName = ValidateUser.FullName>
</cflock>
<!--- If save username box is checked, set cookie --->
<cfif IsDefined('form.SaveUsername')>
<cfcookie name="Username" value="#cflogin.Name#">
</cfif>
<cfelse>
<cfset URL.Message = "Invalid Login. Please Try Again">
<cfinclude template="login.cfm">
<cfabort>
</cfif>
</cfif>
</cfif>
</cflogin> |
[/code]
|
|
|
 |
 | Got it! |  |
|
comprug
Forum Regular
|
 |
Posted: Fri Jan 05, 2007 9:52 pm |
|
 |
 |
 |
 |
This one line of code is causing the problem:
Just switch it to "DSN" or the database. This (the article) is assuming you have a dedicated server, in which the registry is the best place to store client variables. Otherwise, nothing changes. Actually, you don't have to turn off clientmanagement. As for the database storing sessions, just be sure to clear it out every once in a while - I learned the hard way that too many sessions can slow your database to a halt. Hope this addresses your concern.
|
|
|
|
EricBourland
| Joined: 05 Jan 2007 |
| Posts: 61 |
| Location: Chicago |
|
 |
Posted: Fri Jan 05, 2007 10:07 pm |
|
 |
 |
 |
 |
Cool! So, I can change
to
or even
| clientstorage="#application.DSN#" |
and the problem goes away?
Many thanks for your help.
Eric
|
|
|
 | Yep |  |
|
comprug
Forum Regular
|
 |
Posted: Fri Jan 05, 2007 10:16 pm |
|
 |
 |
 |
 |
Cool! So, I can change
Code:
clientstorage="Registry"
to
Code:
clientstorage="uva"
or even
Code:
clientstorage="#application.DSN#"
and the problem goes away?
Many thanks for your help.
Eric |
Yep, that will work. I'd put "uva" just in case #application.DSN# isn't processed in application.cfm yet. If you have any more questions, please post back, and I'd be glad to troubleshoot further.
Thanks,
Ben.
|
|
|
 |
 | |  |
|
EricBourland
| Joined: 05 Jan 2007 |
| Posts: 61 |
| Location: Chicago |
|
 |
Posted: Fri Jan 05, 2007 10:54 pm |
|
 |
 |
 |
 |
Ben,
Thanks for your help. I got rid of the cfregistry error, but I have a new error:
The data source named "uva" is not a valid client storage DSN.
Please define client storage dsn via the admin pages.
The error occurred in C:\Websites\guardmk3f32be\Application.cfm: line 1
1 : <cfapplication
2 : name="uva"
3 : clientmanagement="Yes"
|
http://www.guardianhelp.org/login.cfm
I do have uva registered as a DSN in my HostMySite control panel for guardianhelp.org.
It is a Microsoft Access database ... does that matter?
I am researching the clientmanagement attribute in my Oreilly book. Oreilly says the possible options for the clientmanagement attribute include: Registry, Database, and Cookie.
I set the option to database and that threw an error.
Hang on ... I just set clientstorage="cookie" and lo, it works. Cool!
Thanks again for your help. Looks like I am on my way.
Have a great evening.
Eric
|
|
|
 |
 | |  |
|
Shaji
|
 |
Posted: Sun Jan 07, 2007 5:11 pm |
|
 |
 |
 |
 |
Eric,
It is good that you setup DSN in control panel. Please contact support to add your DSN to client storage in CFadmin. I am sure that it resolves your client storage issue.
|
|
|
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
|
All times are GMT
Page 1 of 1
|
|
|
|
|