OK, something weird is happing here. I did not reply to your question earlier
because things seemed to start working. I made some changes to some of my logic
in one my CFC and CFC file, and now that page is giving me the same error again.
To answer your questions:
Are you using shared hosting? Yes
A VPS? No
Do you have access to the CF administrator web interface? Yes
Are you still getting your "Access deniedâ¦â? Yes
Do you have a folder called "components" in your web root? Yes
Here is the summary of the scenario:
There is a page called â/admin/permmanage/list.cfmâ that list users.
Some code from this page:
<form action="ManagePerm.cfm" name="frmList">
<!--- get Permissions --->
<CFOBJECT COMPONENT="components.permissions" NAME="oPermissions">
<cfinvoke component = "#oPermissions#" method = "getSiteUsers"
returnVariable = "qrySiteUsers">
<cfset variables.qryAll = qrySiteUsers>
â¦.more codeâ¦.
</form>
This page is creating the CFC object and grabs the component to return the
result that fills the page.
You select one or many users, and after you click âManage Permissionsâ it
take you to a page called â/admin/permmanage/ManagePerm.cfmâ
Some code from this page:
<!---Retrieve Information--->
<cfif IsDefined("Cookie.userIDs") is "True">
<cfset variables.user = Cookie.userIDs>
<cfset variables.userName = Cookie.userName>
<!---The Cookie.userIDs if it has more than one ID selected will be like this
"52,23,66"--->
<!---If that is the case the system will try to update all the users selected
with the same value perm --->
<cfif find(",",variables.user) GT 0>
<cfset variables.qryPerm = permissions.getPermission()>
<cfelse>
<cfset variables.qryPerm = permissions.getPermUser(userID=user)>
</cfif--->
<CFOBJECT COMPONENT="components.permissions" NAME="oPermissions">
<cfif find(",",variables.user) GT 0>
<cfinvoke component = "#oPermissions#" method = "getPermUser"
returnVariable = "qryPermission">
<cfelse>
<cfinvoke component = "#oPermissions#" method = "getPermUser"
returnVariable = "qryPermission">
<CFINVOKEARGUMENT NAME="userID" VALUE="#user#">
</CFINVOKE>
</cfif>
<cfset variables.qryPerm = qryPermission>
</cfif>
<script type="text/javascript">
function setPerm(val,pos) {
// send data to CF
var sUserID=getCookie('userIDs');
if (val == '') val='0';
DWRUtil.useLoadingMessage();
DWREngine._execute('/components/permissions.cfc', null, 'setPermUser',
sUserID, pos, val, results);
}
// call back function
function results (r) {
var loadingMessage = 'Permission updated!';
$('divMessage').innerHTML = loadingMessage;
}
</script>
â¦.some html code here
<tbody>
<cfoutput query="variables.qryPerm">
<tr <cfif variables.qryPerm.CurrentRow MOD 2>class="odd"</cfif>>
<td><select id="opt#variables.qryPerm.Position#" style="font-family:
Arial; font-size: 7pt; " changed="0"
onchange="setPerm(this.value,#variables.qryPerm.Position#); FlagChange(this);"
onclick="javascript:if(getElementById('msgResult')){getElementById('msgResult').innerHTML='';}">
<option value="">Select</option>
<option value="0" <cfif "0" IS
variables.qryPerm.permval>selected</cfif>>None</option>
<option value="1" <cfif "1" IS
variables.qryPerm.permval>selected</cfif>>View</option>
<option value="2" <cfif "2" IS
variables.qryPerm.permval>selected</cfif>>Full</option>
</select>
</td>
<td align="left" valign="top">#variables.qryPerm.ItemName#</td>
<td align="center" valign="top">#variables.qryPerm.Position#</td>
<td align="center" valign="top">#variables.qryPerm.Description#</td>
<td align="center" valign="top">#variables.qryPerm.pagename#</td>
<td align="center"><a href="../permItems/add.cfm?permID=#variables.qryPerm.ID#">
<img src="../images/structure/edit-icon.gif" alt="Edit" border="0" width="15"
height="16" /></a></td>
</tr>
</cfoutput>
</tbody>
I know is a mess displaying code this way, thatâs why I didnât want to put
code here yet.
Anyway, as I was saying once that you select the user it will take to the page
âManagePerm.cfmâ. On this page you will see all the permissions available.
Each row has a drop-down with the values âselect, none, view, and fullâ On
the onChange event of the drop-down and event is fired, âsetPermâ. This
function makes an ajax call, that will send the value, the id, and the position
of the permission to be updated on the server. There is when I get that error.
Like I said, earlier this morning I modified the CFC and move the ajax.cfc to
the root and it started working. The authors of AjaxCFC say the following about
extending the ajax.cfc:
Extending ajax.cfc
To create ajax listeners you will need to extend ajax.cfc.
For example:
<cfcomponent extends="ajax">
<cffunction name="echo" output="no" access="private">
<cfargument name="str" required="Yes" type="string"> <cfreturn arguments.str />
</cffunction>
</cfcomponent>
If you decide to store ajax.cfc in a different folder than your components, you
will need to extend it with a mapping:
<cfcomponent extends="cf.mapping.to.ajax">
<cffunction name="echo" output="no" access="private">
<cfargument name="str" required="Yes" type="string"> <cfreturn arguments.str />
</cffunction>
</cfcomponent>
Note also that your methods do not need to have remote access, making them more
secure.
Yesterday I moved Ajax.cfc to the âcomponentsâ folder and still was working
on my machine. Then I pushed the changes to production and I had that error.
Today I decided to move the Ajax.cfc back to the root, and I tried to put
something similar as the documentation for my components
extends="cf.mapping.to.ajax", but it started barking at me for that. I tried to
research online this extends="cf.mapping.to.ajax" deal, and I couldnât get
any thing.
In conclusion:
I believe is nothing wrong with my CFCs, their functions are returning their
data back. Only when I make an ajax call is when I get the message. Now this is
more weird, I have another page, (by the way my index.cfm page displays some
tabs, and when you click one of the tabs, it access another page, but
everything is just there) another tab (page) that creates three levels, like
parent, child, and grandchild, it is making ajax calls, and it is working in
some portion right.
I have several actions that happen here, actions such us âcreate a new
parentâ, âremoveâ a parent or child, âattachâ a link or file, and
âcreateâ a child or grandchild.
Well, only the âcreate a new parentâ, âremoveâ, and âcreateâ a
child or grandchild are working. These all are making an ajax call. The others
are not working for some reason. I am still taking the bugs from the production
version.
I know there is a lot, but this is what is happening.
David
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323608
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4