% 'REQUEST COOKIE VALUES '------------------------------------------------------------------- Dim UserId UserId = Request.Cookies("user")("id") 'If UserId = "" Then Response.Redirect("../includes/inc_accessdenied.asp") 'LOG-OUT USER '------------------------------------------------------------------- If Request("Logout") = "true" Then Response.Cookies("user") = "" 'PATH, PAGE & FOLDER TRACKER '------------------------------------------------------------------- Dim URLpath URLpath = Split(Request.ServerVariables("SCRIPT_NAME"), "/") 'Current Root Path Dim URLpage, URLfolder, URLmodule URLpage = URLpath(Ubound(URLpath)) 'Current Page URLfolder = URLpath(Ubound(URLpath) - 1) 'Current Folder 'URLmodule = Left(URLpage, Instr(URLpage, "_") - 1) 'Module Dim PageRights PageRights = Replace(URLpage, ".asp", "") PageRights = Right(PageRights, Len(PageRights) - InstrRev(PageRights, "_")) 'MAIN NAVIGATION AND PAGE RIGHTS '------------------------------------------------------------------- SQL = "SELECT * FROM vw_accessrights WHERE AdminUserId = '" & UserId & "'" On Error Resume Next Err.Clear Set rs = rsReadOnly(conn, SQL, True) 'Trap and display Errors If Err.number <> 0 Then Response.Write "
An error occurred while building the Menu Structure.
" & vbcrlf Response.Write GetSQLErrors(conn) blnError = True Set rs = Nothing Response.End End If Dim MainNavigation, iCounter MainNavigation = "" iCounter = 0 'Loop through all records Do While Not rs.EOF 'Menu Construction 'oCMenu.makeMenu('top0','','Home','../home/index.asp') iCounter = iCounter + 1 MainNavigation = MainNavigation & "oCMenu.makeMenu('" & iCounter & "','','" & rs("Section") & "','" & rs("URL") & "')" & vbCrlf 'Check Section Rights If lCase(rs("Folder")) = URLfolder Then Dim ViewRights, AddRights, EditRights, DeleteRights ViewRights = rs("ViewOnly") AddRights = rs("AddNew") EditRights = rs("Edit") DeleteRights = rs("Remove") End If rs.MoveNext Loop 'Log-Out MainNavigation = MainNavigation & "oCMenu.makeMenu('top0','','Log-Out','index.asp?logout=true')" 'Close Recordset Set rs = Nothing blnError = False 'SUB NAVIGATION - Function '------------------------------------------------------------------- Function SubNav(Name, URL) If URLpage = URL Then Response.Write "|
| ||||||||||||||||