I didn't have a part in the suggestion but I'm glad it works. I saw it
and being a list fan like I am.. I would have suggested it too...

I would suggest one other thing though... your summary seems like to
goes beyond too much... just a thought..

I'd put pages relating to each module in a seperate folder.. I'd name
them m1, m2, m3....m19 etc...

The code at the top of each page, or even in application.cfm would
look like this...

<cfset mgranted = 0>
<CFIF Admin_Identifier_Field eq 1> (or whatever means admin is on)
  <cfset mgranted = 1>
<CFELSE>
  <cfset nlevel = ListGetAt(cgi.script_Name,listlen(cgi.script_name,"/")-1,"/")>
  <CFIF listFind(AccessLevels,Right(nLevel,len(nLevel)-1)>
    <cfset mgranted = 1>
  </CFIF>
</CFIF>

And that would parse out the folder name that contained the level. You
check for mgranted to equal 1.

Now code to configure links to custom controls...

<cfif not isDefined("Application.ArrControls")>
  <cfset Application.ArrControls = ArrayNew(2)>
  <cfset Application.ArrControls[1][1] = "<A...>Link for Access Level 1</A>">
  <cfset Application.ArrControls[1][2] = "<A...>Link for Access Level 1</A>">
  <cfset Application.ArrControls[1][3] = "<A...>Link for Access Level 1</A>">
  <cfset Application.ArrControls[2][1] = "<A...>Link for Access Level 2</A>">
  <cfset Application.ArrControls[3][1] = "<A...>Link for Access Level 3</A>">
  <cfset Application.ArrControls[3][2] = "<A...>Link for Access Level 3</A>">
  <cfset Application.ArrControls[4][1] = "<A...>Link for Access Level 4</A>">
  <cfset Application.ArrControls[4][2] = "<A...>Link for Access Level 4</A>">
</cfif>
<cfset AppControls = Application.ArrControls>

Now the code to get the right links for the right users.

<cfoutput><cfloop from="1" to="#ArrayLen(AppControls)#" index="a1">
  <cfif (ListFind(AccessLevels,a1) or Admin_Identifier_Field eq 1) and
ArrayLen(AppControls[a1])>
    &middot; <cfloop from="1" to="#ArrayLen(AppControls[a1])#" index="a2">
      #AppControls[a1][a2]# &middot;
    </cfloop><br>
  </cfif>
</cfloop></cfoutput>

Here's another way to do the above... Its a better method I'd say...
Just don't know if it will work.. never tried it.

<cfoutput><cfloop from="1" to="#ArrayLen(AppControls)#" index="a1">
  <cfif (ListFind(AccessLevels,a1) or Admin_Identifier_Field eq 1) and
ArrayLen(AppControls[a1])>
    #ArrayToList(AppControls[a1]," | ")#<br>
  </cfif>
</cfloop></cfoutput>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189085
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to