<% ' Populates the nof_locale global variable ' with locale data ' @throws [620] File not found Function ssLocaleToDictionary(Path, LocaleFile) On Error Resume Next Dim fso, lDictionary, LocalFilePath LocaleFilePath = path & "\" & LocaleFile set lDictionary = Server.CreateObject("Scripting.Dictionary") set ssLocaleToDictionary = lDictionary If Not ssFileExists(LocaleFilePath) Then Err.Raise 620, "ssLocaleToDictionary.10", ssGetLocaleString("Error.620", Array(LocaleFilePath)) Exit Function End If set lDictionary = ssProcessResourceFile(Path, LocaleFile) set ssLocaleToDictionary = lDictionary End Function Function ssProcessResourceFile(Path, FileName) Dim localeDictionary On Error Resume Next set localeDictionary = Server.CreateObject("Scripting.Dictionary") set ssProcessResourceFile = localeDictionary 'Read resources file into an array: Dim f Set f = ssOpenFile(Path & "\" & FileName, 1) if f is nothing then exit function end if Dim fContents fContents = f.ReadAll set f = nothing Dim aFile aFile = split(fContents, vbCrLf) For i = 0 To Ubound(aFile) Dim curLine curLine = Trim(aFile(i)) Select Case Left(curLine, 1) Case "@": 'Directive, process it: If Left(curLine, 7) = "@IMPORT" Then 'Get the name of the file to import: Dim importFile 'As String importFile = Replace(curLine, "@IMPORT", "") importFile = Trim(importFile) importFile = Replace(importFile, "'", "") importFile = Replace(importFile, """", "") dim ld, key if ssFileExists(path & "\" & importFile) then set ld = ssProcessResourceFile(Path, importFile) key = ld.Keys for j=0 to ld.count - 1 localeDictionary.Add key(j), ld.Item(key(j)) next end if End If Case "#": 'Comment, ignore it: Case Else: 'If key/value pair, retrieve it: If InStr(curLine, "=") > 0 Then arrLine = Split(curLine, "=") key = arrLine(0) value = arrLine(1) if Left(value, 1) = "$" then if localeDictionary.Exists( Mid(value, 2) ) then value = localeDictionary.Item(Mid(value, 2)) end if end if If localeDictionary.Exists(key) Then localeDictionary(key) = value Else localeDictionary.Add key, value End If End If End Select Next set ssProcessResourceFile = localeDictionary End Function ' Searches for Key in the nof_locale global Dictionary and returns its value ' ' @param (As String) Key The name of the resource key to be retrieved ' @param (As Array) CustomTags Values that should replace the "{#}" ' in the returned value (optional) ' ' @returns OnSuccess nof_locale(Key) ' @returns OnFailure [[Key]] function ssGetLocaleString(ByVal Key, ByVal CustomTags) dim outStr On Error Resume Next outStr = "[[" & Key & "]]" If TypeName(nof_locale) <> "Dictionary" Then ssGetLocaleString = outStr Exit Function End If If nof_locale.Exists(Key) Then outStr = nof_locale(Key) End If If IsArray(CustomTags) Then For i = 0 To UBound(CustomTags) outStr = Replace(outStr, "{" & CStr(i + 1) & "}", CustomTags(i)) Next End If dim regExp set regExp = new RegExp regExp.Pattern = "\{[0-9]{1}\}" regExp.Global = true outStr = regExp.Replace(outStr, "") set regExp = nothing ssGetLocaleString = outStr end function ' Opens the [FilePath] file through FSO ' ' @returns OnSuccess: An XML Document object ' @returns OnFailure: The Nothing object ' ' @throws [620] File not found ' @throws [650] XML server object could be created ' @throws [601] XML file could not be opened Function ssOpenXMLFile(ByVal FilePath) On Error Resume Next set ssOpenXMLFile = nothing Dim FSO Set FSO = Server.CreateObject("Scripting.FileSystemObject") If Not FSO.FileExists(FilePath) Then Set FSO = Nothing Err.Raise 620, "ssOpenXMLFile.10", ssGetLocaleString("Error.620", Array(FilePath)) Exit Function End If Dim Prefixes Prefixes = Array("Microsoft.XMLDOM","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument.4.0") Dim xmlDoc Dim i for i = 0 to UBound(Prefixes) Set xmlDoc = Nothing Set xmlDoc = Server.CreateObject(Prefixes(i)) If (xmlDoc Is Nothing And i > 0) Then Err.Clear() Set xmlDoc = Server.CreateObject(Prefixes(i-1)) End If next if (xmlDoc is nothing) then Set FSO = Nothing Err.Raise 650, "ssOpenXMLFile", ssGetLocaleString("Error.650", Null) Exit Function end if Dim f set f = fso.OpenTextFile(FilePath, 1) Set FSO = Nothing dim str str = f.ReadAll Set f = Nothing if (cstr(str) = "") then Set XMLDoc = Nothing Err.Raise 601, "ssOpenXMLFile", ssGetLocaleString("Error.601", Array(FilePath)) Exit Function end if Dim regEx Set regEx = New RegExp regEx.Pattern = "^\s*<" & chr(37) & "[^" & chr(37) & ">]*" & chr(37) & ">\s*" regEx.IgnoreCase = True regEx.Global = True str = regEx.Replace(str, "") set regEx = nothing xmlDoc.loadXML(str) Set ssOpenXMLFile = xmlDoc End Function ' @param (XMLDocument object) XMLDoc ' @param (string) compName The name of the XML tag e.g. "FormsHandler" ' @param (string) dbPath The value of the dbpath attribute ' @returns OnSuccess: The matching XML Node ' @returns OnFailure: The Nothing object Function ssGetByDBpath(ByVal XMLDoc, ByVal compName, ByVal dbTagName, ByVal dbpath) On Error Resume Next Dim i, continue Dim NodeList, CompNode set CompNode = nothing Set NodeList = XMLDoc.GetElementsByTagName("Component") For i = 0 To NodeList.length - 1 if NodeList.Item(i).Attributes.length > 0 then Dim j For j = 0 to NodeList.Item(i).Attributes.length - 1 if LCase(NodeList.Item(i).Attributes.Item(j).nodeName) = "name" then if NodeList.Item(i).Attributes.Item(j).nodeTypedValue = compName then dim curComponentNode set curComponentNode = NodeList.Item(i) if ssGetProperty(curComponentNode, dbTagName) = dbpath then set CompNode = curComponentNode end if set curComponentNode = nothing end if end if next end if next set ssGetByDBpath = CompNode end function ' @returns OnSuccess: An XML node on success ' @returns OnFailure: A Nothing object Public function ssGetNode(ByVal XML, ByVal StartNode, ByVal Nodename, ByVal attrName, ByVal attrVal, ByVal tagNr) On Error Resume Next Dim NodeList If IsObject(StartNode) then Set NodeList = XML.documentElement.selectNodes(Nodename) else Set NodeList = XML.GetElementsByTagName(NodeName) end if Dim CompNode set CompNode = nothing Dim i For i = 0 To NodeList.length - 1 Dim continue continue = true if NodeList.Item(i).Attributes.length > 0 then Dim sw sw = true if isArray(attrName) then Dim k for k = 0 to UBound(attrName) Dim j For j = 0 to NodeList.Item(i).Attributes.length - 1 if LCase(NodeList.Item(i).Attributes.Item(j).nodeName) = LCase(attrName(k)) then if Lcase(NodeList.Item(i).Attributes.Item(j).nodeTypedValue) = Lcase(attrVal(k)) then if not sw then continue = false else sw = false end if end if end if next next elseif attrName <> "" then if LCase(NodeList.Item(i).Attributes.Item(j).nodeName) = LCase(attrName) then if NodeList.Item(i).Attributes.Item(j).nodeTypedValue = attrVal then continue = false end if end if elseif tagNr >= 0 then if i = tagNr then continue = false end if end if if not continue then set CompNode = NodeList.Item(i) Exit For end if next set ssGetNode = CompNode end function ' @returns OnSuccess: The value of the property ' @returns OnFailure: "" Public Function ssGetProperty(ByVal XmlElement, ByVal PropName) On Error Resume Next ssGetProperty = "" Dim PropNode Set PropNode = GetXMLElementByName(XmlElement, PropName) if Not PropNode Is Nothing then ssGetProperty = PropNode.nodeTypedValue end if End Function ' @returns Matching XML Node, if found ' @returns Nothing object, otherwise Public Function GetXMLElementByName(ByVal XmlElement, ByVal TagName) On Error Resume Next Set GetXMLElementByName = nothing Dim i, j For i = 0 To XmlElement.childNodes.length - 1 If Trim(XmlElement.childNodes.Item(i).nodeName) = Trim(TagName) Then Set GetXMLElementByName = XmlElement.childNodes.Item(i) Exit Function End If Next End Function ' @returns Matching XML Node, if found ' @returns Nothing object, otherwise Public Function GetXMLElementByPosition(ByVal XmlElement, ByVal pos) On Error Resume Next Set GetXMLElementByPosition = Nothing Dim i For i = 0 To XmlElement.childNodes.length - 1 If i = pos Then Set GetXMLElementByPosition = XmlElement.childNodes.Item(i) Exit Function End If Next End Function ' @returns Matching XML Node, if found ' @returns Nothing object, otherwise Public Function GetXMLElementByProperty(ByVal XmlElement, ByVal Property, ByVal PropValue) On Error Resume Next set GetXMLElementByProperty = nothing if XmlElement is nothing then Exit Function end if Dim nodeElem for j=0 to XmlElement.childNodes.length - 1 set nodeElem = GetXMLElementByPosition(XmlElement, j) if LCase(Trim(ssGetProperty(nodeElem, Property))) = LCase(PropValue) then set GetXMLElementByProperty = nodeElem exit function end if next End Function '### GetNextCurrentPage function - return value for requested property ###' function GetNextCurrentPage(ByVal property) Dim regEx1, Match, Matches Set regEx1 = New RegExp regEx1.Pattern = "((\.\./|\./)*)(.*)" regEx1.IgnoreCase = True regEx1.Global = False Set Matches = regEx1.Execute(property) For Each Match in Matches GetNextCurrentPage = Match.SubMatches(2) Next end function '### CheckEmail function - return true if email is a valid email address ###' Function CheckEmail(ByVal strng) Dim regEx, retVal, extendedChars, extendedCharsCodes, i extendedChars = "" extendedCharsCodes = Array(223,224,225,226,227,228,229,230,231,32,233,234,235,236,237,238,239,240,241,242,243,244,245,246,248,249,250,251,252,253,254,255,257,259,261,263,265,267,269,271,273,275,277,279,281,283,285,287,289,291,293,295,297,299,301,303,305,309,311,312,314,316,318,322,324,326,328,331,333,335,337,339,341,343,345,347,349,351,353,355,357,359,361,363,365,367,369,371,373,375,378,380,382) for i=0 to UBound(extendedCharsCodes) extendedChars = extendedChars & chrW(extendedCharsCodes(i)) next Set regEx = New RegExp regEx.Pattern = "^[^@]+(@|%40)[a-z0-9" & extendedChars & "]+(([\.-][a-z0-9" & extendedChars & "])*[a-z0-9" & extendedChars &"]*)*\.([a-z]{2,}|[0-9]{1,})$" regEx.IgnoreCase = True retVal = regEx.Test(strng) If retVal Then checkEmail = true Else checkEmail = false End If End Function '### EncodeValue function - return value for requested property ###' function EncodeValue(ByVal str) Dim regEx, Match, Matches Set regEx = New RegExp regEx.Pattern = """" regEx.IgnoreCase = True regEx.Global = True EncodeValue = regEx.Replace(str,"'") regEx.Pattern = "\r\n" regEx.IgnoreCase = True regEx.Global = True EncodeValue = regEx.Replace(EncodeValue, " ") set regEx = nothing end function '### PutImage function - return a html img tag with src as path ###' function PutImage(ByVal path) if Len(path) > 0 then PutImage = "" else PutImage = "" end if end function Sub log(file, msg) Dim fso, f set fso = Server.CreateObject("Scripting.FileSystemObject") set f = fso.OpenTextFile(file, 8, true) f.writeLine msg f.close set f = nothing set fso = nothing end sub Public Function CheckProperty(ByVal XMLElement, ByVal PropName, ByVal PropValue) Dim errEvent set CheckProperty = nothing set errEvent = GetXMLElementByProperty(XMLElement, PropName, PropValue) if not errEvent is nothing then if ssGetProperty(errEvent, "active") then set CheckProperty = errEvent end if end function '### ssFileExists function - check if a file exist ###' function ssFileExists(ByVal path) Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") if fso.FileExists(path) then ssFileExists = true else ssFileExists = false end if set fso = nothing end function ' Creates database, if exists overwrites it ' ' @throws [500] Failed to create CSV text file Sub ssCreateDB(ByVal path, ByVal head) On Error Resume Next Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateTextFile(path, True) Set fso = Nothing if f is nothing then Err.Raise 500, "ssCreateDB.10", ssGetLocaleString("Error.500", Array(path)) Exit Sub end if f.WriteLine head f.Close() set f = nothing end sub ' Opens a file and reads the 1st line. Used for ' reading the db structure from CSV files. ' ' @returns OnSuccess: The first line from a file ' @returns OnFailure: Empty string ' ' @throws [501] Failed to read from CSV text file function ssGetLine(ByVal path) On error resume next Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile(path, 1) if f is nothing then Err.Raise 501, "ssGetLine.10", ssGetLocaleString("Error.501", Array(path)) Exit Function end if ssGetLine = f.ReadLine f.Close() set f = nothing set fso = nothing end function ' Attempts to open the @path file and returns a TextStream object ' ' @returns OnSuccess: A TextStream object ' @returns OnFailure: Nothing ' ' @throws 525 File not found ' @throws 520 Failed to open file function ssOpenFile(ByVal path, ByVal oType) On Error Resume Next Dim FSO, f set ssOpenFile = nothing set f = nothing Set FSO = Server.CreateObject("Scripting.FileSystemObject") if not fso.FileExists(path) then set fso = nothing Err.Raise 525, "ssOpenFile.10", ssGetLocaleString("Error.525", Array(path)) Exit Function end if Set f = FSO.OpenTextFile(path, oType) if f is nothing then Err.Raise 501, "ssOpenFile.20", ssGetLocaleString("Error.501", Array(path)) set fso = nothing Exit Function end if set ssOpenFile = f set fso = nothing end function '### Login function - check if user, pass are ok and if user is validated ###' function Login(ByVal user, Byval pass, ByVal dbpath) On Error Resume Next set f = ssOpenFile(dbPath, 1) if f is nothing then exit function end if login = "user" heads = split(f.Readline,",") for i=0 to UBound(heads) if LCase(heads(i)) = LCase(Application("LoginField")) then uCol = i end if if LCase(heads(i)) = LCase(Application("PassField")) then pCol = i end if if LCase(heads(i)) = LCase(Application("ValidField")) then vCol = i end if if LCase(heads(i)) = LCase(Application("AdminField")) then sCol = i end if next Do While f.AtEndOfStream <> True line = f.ReadLine line = Mid(line,2,Len(line)-2) values = split(line, """,""") if values(uCol) = user then if values(pCol) <> pass then login = "pass" exit do elseif not CBool(values(vCol)) then login = "valid" exit do end if session("ssMemberID") = values(uCol) session("ssAdminStat") = values(sCol) login = "ok" exit do end if loop f.Close end function '### UserExist function - return true if UserName is user ###' function UserExist(ByVal XMLDoc, ByVal user, ByVal dbPath) Dim admList, admin, field Dim fso, f, heads, headName, i, j, uCol, values, line UserExist = false Set admList = XMLDoc.getElementsByTagName("Component") For i = 0 To admList.length - 1 for j = 0 to admList.Item(i).Attributes.length - 1 if LCase(admList.Item(i).Attributes.Item(j).nodeName) = "name" then if admList.Item(i).Attributes.Item(j).nodeTypedValue = "admin" then set admin = admList.Item(i) set field = GetXMLElementByName(admin, "adminuser") if ssGetProperty(field, "username") = user then UserExist = true exit for end if end if end if next next set f = ssOpenFile(dbPath, 1) if f is nothing then exit function end if heads = split(f.ReadLine,",") for i=0 to UBound(heads) if LCase(heads(i)) = LCase(Application("LoginField")) then uCol = i exit for end if next Do While f.AtEndOfStream <> True line = f.ReadLine line = Mid(line,2,Len(line)-2) values = split(line, """,""") if values(uCol) = user then UserExist = true exit do end if loop f.Close end function function getErrorEvent(ByVal ComponentNode, ByVal fieldname, ByVal errorname) On Error Resume Next 'Read from the global variable: Dim comp Set comp = ComponentNode Dim j, k, field, found found = false set getErrorEvent = nothing For j = 0 To comp.childNodes.length - 1 If comp.childNodes.Item(j).nodeName = "field" Then Set field = comp.childNodes.Item(j) if Lcase(ssGetProperty(field, "name")) = Lcase(fieldname) then for k = 0 to field.childNodes.length - 1 if field.childNodes.Item(k).nodeName = "errorevent" then if Lcase(ssGetProperty(field.childNodes.Item(k), "errorname")) = Lcase(errorname) and _ ssGetProperty(field.childNodes.Item(k), "active") = "true" then set getErrorEvent = field.childNodes.Item(k) found = true exit for end if else set getErrorEvent = nothing end if next end if End If if found then exit for Next end function function ssGetDBFields(ByVal compNode, ByVal tagName) Dim j, fields, list list = "" set fields = GetXMLElementByName(compNode, tagName) for i = 0 to fields.childNodes.length - 1 if len(list) = 0 then list = fields.childNodes.Item(i).nodeTypedValue else list = list & "," & fields.childNodes.Item(i).nodeTypedValue end if next ssGetDBFields = list end function ' @returns OnSuccess: true ' @returns OnSuccess: false ' ' @throws [525] CSV file not found ' @throws [502] Failed to write to CSV text file Function ssInsert(ByVal path, ByVal rec) On Error Resume Next ssInsert = false Dim f set f = ssOpenFile(path, 8) if (Err.number <> 0) then ' Convert from ' [520] Failed to open CSV text file ' to the more specific ' [502] Failed to write to CSV text file if Err.Number = 520 then Err.Raise 502, "ssInsert.10", ssGetLocaleString("Error.502", Array(path)) end if Exit Function end if f.WriteLine rec f.Close ssInsert = true End Function '### ssGetTemplateValue function - return value for a template file ###' function ssGetTemplateValue(ByVal path, ByVal property) Dim fso, f, pos, prop, line set f = ssOpenFile(path, 1) if f is nothing then exit function end if prop = "" Do While f.AtEndOfStream <> True line = f.ReadLine if Len(prop) = 0 then pos = inStr(1, line, property & "=", 1) if pos > 0 then if Right(line,1) <> "\" then prop = Mid(line, pos + Len(property)+1, Len(Line)-(pos + Len(property))) exit do end if prop = Mid(line, pos + Len(property)+1, Len(Line)-(pos + Len(property))-1) end if else if Right(line,1) <> "\" then prop = prop & line exit do end if prop = prop & Left(line, Len(line)-1) end if loop f.Close ssGetTemplateValue = prop end function '### ChangePassword function - change the password for a user ###' function ChangePassword(ByVal dbPath, ByVal oldPassword, ByVal newPassword) dim rs, result, i, rowRec, tableHead, allTHeads set rs = RSFileContent(dbPath,"all") result = "notexist" tableHead = ssGetLine(dbPath) allTHeads = split(tableHead,",") if not rs.eof then with rs .MoveFirst do while not .EOF if Trim(.Fields(Application("LoginField"))) = Trim(session("ssMemberID")) then if Trim(.Fields(Application("PassField"))) = Trim(oldPassword) then result = "exist" .Fields(Application("PassField")) = Trim(newPassword) .Update exit do end if end if .MoveNext loop end with end if if result = "exist" then if Update(dbPath, rs) then result = "changed" else result = "errorupdate" end if end if ChangePassword = result rs.close end function ' Gets file contents into a Recordset object ' @param path (string) The full path of the file to be opened ' @returns OnSuccess: A Recordset object ' @returns OnFailure: Nothing Function RSFileContent(ByVal path, ByVal usrStat) On Error Resume Next Set RSFileContent = nothing statPos = GetRecPos(path, Application("ValidField")) Dim f set f = ssOpenFile(path, 1) if f is nothing then Exit Function end if Dim fileLine fileLine = f.ReadLine Dim rs set rs = Server.CreateObject("ADODB.RecordSet") if rs is nothing then Err.Raise 900, "RSFileContent.10", ssGetLocaleString("Error.900", Array("ADODB.Recordset")) Exit Function end if Dim allFields allFields = Split(fileLine, ",", -1, 1) For i = 0 To UBound(allFields) rs.Fields.Append CStr(allFields(i)), 129, 250 Next rs.CursorType = 1 rs.LockType = 3 rs.Open Do While f.AtEndOfStream <> True fileLine = f.ReadLine fileLine = Mid(fileLine, 2, Len(fileLine)-2) allFields = Split(fileLine, """,""", -1, 1) select case usrStat case "valid" if allFields(CLng(statPos)) then With rs .AddNew For i = 0 To UBound(allFields) .Fields(i).Value = Trim(allFields(i)) Next .Update .MoveFirst End With end if case "invalid" if not allFields(CLng(statPos)) then With rs .AddNew For i = 0 To UBound(allFields) .Fields(i).Value = Trim(allFields(i)) Next .Update .MoveFirst End With end if case else With rs .AddNew For i = 0 To UBound(allFields) .Fields(i).Value = Trim(allFields(i)) Next .Update .MoveFirst End With end select Loop set RSFileContent = rs f.Close end function ' Returns field name position in a line ' ' @returns OnSuccess: (int) Field name position ' @returns OnSuccess: -1 function GetRecPos(ByVal dbPath, ByVal fieldName) On Error Resume Next getRecPos = -1 Dim fso, f, i, allTHeads set f = ssOpenFile(dbPath, 1) if f is nothing then exit function end if allTHeads = split(f.ReadLine,",") for i=0 to UBound(allTHeads) if LCase(fieldName) = LCase(allTHeads(i)) then getRecPos = i exit function end if next f.Close end function '### Update a Record from File ###' function Update(ByVal path, ByVal rs) Dim f, fld, fileLine, fldValue, tableHead Update = false fileLine = "" tableHead = ssGetLine(path) set f = ssOpenFile(path, 2) if f is nothing then exit function end if f.WriteLine tableHead With rs .MoveFirst Do While Not .EOF For Each fld In .Fields fldValue = """" & EncodeValue(Trim(fld.Value)) & """" if Len(fileLine) > 0 then fileLine = fileLine & "," fileLine = fileLine & fldValue Next f.WriteLine fileLine fileLine = "" .MoveNext Loop End With f.Close Update = true end function '### GetEmail function - return UserName and Password for user with email ###' function GetEmail(ByVal dbpath, ByVal email) Dim fso, f, heads, headName, i, uCol, pCol, eCol, values, eFound, line set f = ssOpenFile(dbPath, 1) if f is nothing then exit function end if GetEmail = "" eFound = "" heads = split(f.ReadLine,",") for i=0 to UBound(heads) if LCase(heads(i)) = LCase(Application("LoginField")) then uCol = i end if if LCase(heads(i)) = LCase(Application("PassField")) then pCol = i end if if LCase(heads(i)) = "email" then eCol = i end if next Do While f.AtEndOfStream <> True line = f.ReadLine line = Mid(line,2,Len(line)-2) values = split(line, """,""") if values(eCol) = email then Session("fpEmail") = values(eCol) eFound = eFound & vbCRLF & vbCRLF & "UserId=" & values(uCol) & vbCRLF & "Password=" & values(pCol) ' exit do end if loop GetEmail = eFound f.Close end function '### GetUser function - return file line associated with user ###' function GetUser(ByVal dbPath, ByVal user) Dim fso, f, heads, headName, i, uCol, values, line set f = ssOpenFile(dbPath, 1) if f is nothing then exit function end if GetUser = "" heads = split(f.ReadLine,",") for i=0 to UBound(heads) if LCase(heads(i)) = LCase(Application("LoginField")) then uCol = i exit for end if next Do While f.AtEndOfStream <> True line = f.ReadLine line = Mid(line,2,Len(line)-2) values = split(line, """,""") if values(uCol) = user then GetUser = line exit do end if loop f.Close end function Function ssReFind(ByVal str, ByVal patrn) Dim regEx Set regEx = New RegExp regEx.Pattern = patrn regEx.IgnoreCase = True regEx.Global = True Set ssReFind = regEx.Execute(str) set regEx = nothing End Function 'Stops execution on fatal error Function ssRaiseFatalError(ByVal errObj, ByVal location, ByVal isDebugMode) Dim errMsg, errNumber, errDescription errNumber = errObj.number errDescription = errObj.Description if CBool(isDebugMode) then errMsg = "

" & Replace(Replace(errDescription, "\", "\\"), "'", "\'") & "

" else errMsg = "

" & ssGetLocaleString("Error.Text.Generic", null) & "

" & _ ssGetLocaleString("Error.Text.Code", null) & " " & CStr(errNumber) & "

" end if Dim output Response.Write "
" & errMsg & "
" output = "" 'Response.Write output Err.Clear End Function 'functions for generating html code Sub ssBuildHiddenField(ByVal name, ByVal value) Response.Write "" & vbCRLF End Sub 'Make sure the line below is the last one in the file! %>