<% bRebuildPageNavigation = False bRebuildPageDictionary = False bDebug = False ' ========================================================================== ' = Ad referal tracking ' ========================================================================== If Request.QueryString("gclid")<>"" Then Response.Cookies("adReferrerID") = 1 If Request.QueryString("OVMTC")<>"" Then Response.Cookies("adReferrerID") = 2 If Request.QueryString("cache")<>"" Then Application.Contents.RemoveAll If Request.QueryString("debug")<>"" And Session("CMS_ADMIN_USER_ID") <> 0 Then bDebug = True ' ========================================================================== ' = Check to see if the cache is empty, has expired or the system clock has ' = been set back ' ========================================================================== CurrentTime = Now() NextReBuildDate = Application("CMS_CACHE_AUTO_REBUILD_TIME") LastRequestDate = Application("CMS_LAST_REQUEST_TIME") Application.Lock() If NextReBuildDate < CurrentTime or CurrentTime < LastRequestDate Then Set XML = Server.CreateObject("Microsoft.FreeThreadedXMLDOM") Set Fso = Server.CreateObject("Scripting.FileSystemObject") If Fso.FileExists( Server.MapPath("cms.xml") ) Then XML.Load( Server.MapPath("cms.xml") ) Else Xml.LoadXml("") Ignores = "," & Replace(CMS_DISABLE_PACKAGE_FOLDER_LIST," ","") & "," Set PackagesFolder = FSO.GetFolder( Server.MapPath("cms/packages") ) Set PackageXML = Server.CreateObject("Microsoft.FreeThreadedXMLDOM") For Each Folder in PackagesFolder.SubFolders If Instr(Ignores,"," & Folder.Name & ",") = 0 Then If FSO.FileExists(Folder & "\package.xml") Then PackageXml.Load(Folder& "\package.xml") If PackageXml.ParseError=0 Then Xml.documentElement.appendChild(PackageXml.documentElement) End If End If End If Next End If Set Application("CMS_CONFIG") = XML Set CacheControllers = XML.selectNodes("/cms/package/eventhandlers/handler[@for='cache']") For C=0 To CacheControllers.Length - 1 URL = CacheControllers(c).GetAttribute("href") URL = Replace( URL, "cms://", "" ) URL = Replace( URL, "cmspackages://", CMS_PACKAGES_DIRECTORY ) Server.Execute( URL ) Next End If Application("CMS_LAST_REQUEST_TIME") = CurrentTime Application.UnLock() If bDebug Then Server.Transfer( "cms/debug/index.asp" ) End If PageKey = Request.QueryString("page") If PageKey = "" Then PageKey = Application("CMS_DEFAULT_PAGE") Set PageNode = Application("CMS_CACHE_PAGE_LIST").selectSingleNode("/pages/page[@urlkey='" & Replace(PageKey,"'","\'") & "']") If PageNode Is Nothing Then Set PageNode = Application("CMS_CACHE_PAGE_LIST").selectSingleNode("/pages/page[@moduleguid='bd42a625-8673-4dad-ac32-9dc54b379bf3']") End If If Not PageNode Is Nothing Then Module = PageNode.getAttribute("moduleguid") Template = PageNode.getAttribute("template") Secure = PageNode.getAttribute("secure") AccessGroups = PageNode.getAttribute("accessgroups") If Template<>"" Then Server.Transfer( CMS_COMPILED_TEMPLATES_DIRECTORY & Template ) Else Response.Write("No template found for Module GUID '" & Module & "'") Response.End End If End If ' ========================================================================== ' = If no 404 handler was found, show the default one we copied from IIS ' ========================================================================== Response.Status="404 Not Found" Server.Transfer "cms/core/404.htm" Response.End %>