Menu Security Levels

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
digitaldi
Beginner
Beginner
Posts: 1
Joined: Tue Oct 08, 2002 11:39 pm
Contact:

Menu Security Levels

Post by digitaldi »

We have implemented Milonic's menu on a couple of sites and are happy with the functionality.

We have a new site that needs to implement the menu where items displaying in the menu are based on the security level of the user in the database. The users and security levels are in an access database and users are required to log in before using the site.

Has anyone implemented this type of security using Milonic' s menu?
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Maybe this will help.

First create a userIsMember in the backend.

Then add the the template, something like this.


<script language="javascript" type="text/javascript">
//<![CDATA[
var userIsMember=0;
//]]>
</script>

On the menu data use

if(userIsMember){
menu items....

}

else{

other menu item....

}

This is an example what I used, but I don't know backend. Maybe it will help.

maz
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Note the CDATA is only necessary if you're using XHTML with certain special characters in hard-coded script; i.e., not script called from an external file. Also, some flavors of IE tend to choke on CDATA. The way around is to simply call ("include") as many scripts as possible, special characters or not.
John
Post Reply