<% ' Script Purpose: controller to display components for isntalled modules ' Copyright (c) 2005 Lucky Marble Solutions Corp. ' ' This script may be used only under license from Lucky Marble Solutions Corp. ' ' Lucky Marble Solutions Corp ' www.luckymarble.com ' admin@luckymarble.com DirectoryOffset = "dynamo/_config/" GlobalIncludeFile("dynamo/_config/master_includes.asp") logout = Request.QueryString("logout") Set settings = new MemberSettings getCmd = Request.QueryString("cmd") if inStr(getCmd, "loggedin") > 0 then getCmd = replace(getCmd, "loggedin", "") getArgsArray = split(getCmd, ":lma:") Set getArgs = Server.CreateObject("Scripting.Dictionary") for each argItem in getArgsArray argItem = trim(argItem) if argItem <> "" then argPair = split (argItem, "=") getArgs.add argPair(0), argPair(1) end if next Session("member_id") = getArgs.Item("mid") Session("member_type") = getArgs.Item("mt") Session("member_type_id") = getArgs.Item("mtid") end if if Session("member_id") <> "" AND NOT logout then Set user = new MemberItem user.setupListingItemProperties Session("member_id"), Session("member_type_id") if user.getFieldValue("2") = "" then logout = True end if end if if Request.Querystring("cmd") = "exit" Then logout = True end if ' logout if commanded to if logout = true then Session.Abandon Response.Redirect("dynamo/index.asp?module=members&component=login_box-ajax&cmd=logout&bypass=1") end if Response.Write "" ' define passed parameters component member_page = Request.QueryString("member_page") ' if a module has been specified then display it if Session("member_id") <> "" then ' Setup Objects Set memPage = new MemberPages Set user = new MemberItem user.setupListingItemProperties Session("member_id"), Session("member_type_id") Set user_types = new MemberTypes Set aUserPageList = user_types.getTypePagesList(Session("member_type_id")) ' Setup Variables menuItems = "" pageBody = "" member_type_id = Session("member_type_id") 'queryString = "SELECT * FROM members_subscription WHERE user_id='" & Session("member_id") & "' AND subscription_status_id > 1" 'Set queryResult = dbObj.execute(queryString) 'if settings.getFieldValue("use_expiration") = "1" AND memUser.getFieldValue("Expires") < Now() then ' if NOT queryResult.EOF then ' if Request.QueryString("where") <> "protected/0-Access.htm" then ' pageBody = "" & IncludeTextFile("access/protected/0-Access_Expired.htm") ' else ' pageBody = "" & IncludeTextFile("access/protected/0-Access.htm") ' end if ' end if if Request.QueryString("where") <> "" then if user_types.checkPagePermissions(Session("member_id"), member_type_id, Request.QueryString("where")) then pageBody = "" & IncludeTextFile("access/protected/" & Request.QueryString("where")) else pageBody = "


Permission Denied.

" end if else if aUserPageList.exists(0) then Set page_location = aUserPageList.Item(0) end if if isObject(page_location) then if page_location.getName = "0-Access.htm" then ' attempt to see if we have a pending subscription queryString = "SELECT * FROM members_subscription WHERE user_id='" & Session("member_id") & "'" Set subscriptionRecord = dbObj.execute(queryString) if subscriptionRecord("subscription_status_id") = "0" then pageBody = "" & IncludeTextFile("access/protected/0-Access_Pending.htm") else pageBody = "" & IncludeTextFile("access/protected/" & page_location.getName) end if elseif NOT isNull(page_location) then pageBody = "" & IncludeTextFile("access/protected/" & page_location.getName) else pageBody = "" & IncludeTextFile("access/protected/No_Permissions.htm") end if else pageBody = "" & IncludeTextFile("access/protected/No_Permissions.htm") end if end if basicMenuItems = "" for each value in aUserPageList.Items basicMenuItem = "
  • " & value.getTitleName & "
  • " basicMenuItems = basicMenuItems & basicMenuItem next Set usersAccountPermissionsList = memPage.getAccountPages(Session("member_id")) for each value in usersAccountPermissionsList.Items basicMenuItem = "
  • " & value.getTitleName & "
  • " basicMenuItems = basicMenuItems & basicMenuItem next basicMenuItem = "
  • Log Out
  • " basicMenuItems = basicMenuItems & basicMenuItem basicMenuItems = "
    " ' pre-condition page links 'for each value in aUserPageList.Items ' searchPage = Replace(value.getName, "protected/", "") ' ' pageBody = Replace(pageBody, searchPage, "?where=" & Replace(value.getName, " ", "%20")) 'next ' condition page pageBody = Replace(pageBody, "href=""../../", "href=""") pageBody = Replace(pageBody, "src=""images","src=""access/protected/images") pageBody = Replace(pageBody, "src=""../../","src=""") pageBody = Replace(pageBody, """../../","""") pageBody = Replace(pageBody, """../","""access/") pageBody = Replace(pageBody, "[verticalMenuItems]", basicMenuItems) pageBody = Replace(pageBody, "[username]", user.getFieldValue("2")) 'Response.Write pageBody runMemberCode pageBody ' otherwise, redirect to administrative area else Response.Redirect("access/login/") end if %>