<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Response.CacheControl = "no-cache" %> <% Response.AddHeader "Pragma", "no-cache" %> <% Response.Expires = -1 %> <% 'Option Explicit %> <% Response.Buffer = True %> <% Dim oFS Set oFS = Server.CreateObject("Scripting.FileSystemObject") %> <%'===Include Settings + Common Functions====%> <%'=====Define installed modules in the following include file:=====%> <%'======Include Classes====== %> <% Dim sController Dim sFunction Dim iID Dim sView '=====Set Default MVC Parameters==== sController = "pages" sFunction = "home" iID = 1 If Request.QueryString("controller") <> "" Then sController = Request.QueryString("controller") If Request.QueryString("controller") = C_NEWS_ALIAS_1 Then sController = "news" End If If Request.QueryString("controller") = C_NEWS_ALIAS_2 Then sController = "news" End If End If If Request.QueryString("view") <> "" Then sFunction = Request.QueryString("view") End If If Request.QueryString("id") <> "" Then iID = Request.QueryString("id") End If 'TEMP LOGIN ONLY!! sUsername = "admin" sPassword = "sager@IIS1204" iLoggedInUser = 0 Set oCalendar = New calendar Set oDB = New F_DB Set O_CONN = Server.CreateObject("ADODB.Connection") '======DB Connection Opened O_CONN.Open C_DSN_NAME Set Base = new oBase Base.Connect(O_CONN) If Session("logged_in_user") = "" OR Session("logged_in_id") = "" Then If Request.Form("username") <> "" AND Request.Form("password") <> "" Then sQ = oDB.ExecuteQuery(O_CONN,"SELECT id,username FROM users WHERE username = '"&trim(Request.Form("username"))&"' AND password = '"&trim(Request.Form("password"))&"'") If IsArray(sQ) Then Session("logged_in_id") = sQ(0,0) Session("logged_in_user") = sQ(1,0) Else Response.Redirect("login.asp?error=1") End If Else Response.Redirect("login.asp?error=0") End If Else sQ = oDB.ExecuteQuery(O_CONN,"SELECT id,username FROM users WHERE username = '"&Session("logged_in_user")&"' AND id = "&Session("logged_in_id")&"") If Not IsArray(sQ) Then Response.Redirect("login.asp?error=1") End If End If Set oFO = oFS.GetFolder(C_DOC_ROOT & "/code/modules/") For Each x in oFO.SubFolders If instr(x.Name,"installed.") = 1 Then sModule = Replace(x.Name,"installed.","") str_call = "Set " & sModule & "= New O_" & sModule execute(str_call) str_class_vars = sModule & ".Connect O_CONN,iID" execute(str_class_vars) End If Next %> <%If Request.QueryString("window") = 1 Then%> <%Else%> <%End If%> <% Set oFS = Nothing O_CONN.Close() Set O_CONN = Nothing '======DB Connection Closed %>