Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restricting Popup menu access

Status
Not open for further replies.

am7555

Technical User
Mar 6, 2007
27
CA
Hi guys,

I have a multilevel popup menu done with DW8. Works well as it is. However, I need to be able to restrict access to some sections of the menu. Something like:

If authorization = 3 then blah blah
then response.write("you do not have access to this section")else
end if.

I tried doing it using ASP but no luck and I'm not a javascript guru to fool around with the code from DW8. Has anyone done something like this? Would it be best to use Javascript.?

Any ideas or if someone knows how to do it. Please, help.

I'm using in my site ASP.
 
You could either use ASP to actually remove the sections before sending the html to the browser or restrict access to the pages themselves with ASP.

Restricting it via JavaScript won't stop anyone but the most casual user from looking under the hood and getting to the restricted item.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I have the whole menu on a separate page that is included to the rest of my pages.

I tried not showing the section using ASP but it did work.
Do you have any samples to your first sugestion
 
I did it. I just did not provide the right values to my conditional statement. Now it's all good. Thanks Traingamer.
 
Hi again,

In my excitement, I forgot one part of the menu that I needed to restrict. here is my code and how far I got:

I want to restrict access to this menu item:
mm_menu_0126123852_0_1.addMenuItem("Committees","location='pdf_docs/COMMITTEES.pdf'");

and onclick activate this:

onclick="MM_popupMsg('You do not have access to this section. If you are already a member, please Login. If you are not a Member, please sign-up for an application in the Membership section. Thanks.')

So far I have restricted the access to the menu item :

mm_menu_0126123852_0_1.addMenuItem("Committees","location='<% If Session("MM_Userauthorization")<>"" Then %>pdf_docs/COMMITTEES.pdf'<% End If %>");

but launching the message is what i do not know how to do. I had tried in various ways with no luck. Any help will be greatly appreciated.

Thanks,

Javier
 
Thanks to all readers of my message. I solved my problem by just redirecting the non members to a page with the same message that i had intented on the alert. It works beautifully and I don't have to mess around with the javascript of the popup menu. That's my code.

mm_menu_0126123852_0_1.addMenuItem("Committees","location='<% If Session("MM_Userauthorization")<>"" Then %>pdf_docs/COMMITTEES.pdf<% Else %>error_msg.asp<% End If %>'");

For some reason the following code doesn't want to launch the MM_popupMsg
If anyone has a theory, please let me know. In the meantie my problem is solved.


mm_menu_0126123852_0_1.addMenuItem("Committees","l ocation='<% If Session("MM_Userauthorization")<>"" Then %>pdf_docs/COMMITTEES.pdf' <%else%>MM_popupMsg('You do not have access to this section. If you are already a member, please Login. If you are not a Member, please sign-up for an application in the Membership section. Thanks.');<% End If %>'");
 
And what would prevent someone from viewing the source, and linking directly to ...pdf_docs/COMMITTEES.pdf?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Each page is also restricted with user level access. So, even if they are able to view the link through code view, then There is still some protection.

Thanks for the reminder though.
 
Excellent!

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top