<%@ CodePage=1252 %> <% 'Include Common Files @1-9D737FEA %> <% 'End Include Common Files 'Initialize Page @1-1CFC387C ' Variables Dim PathToRoot, ScriptPath, TemplateFilePath Dim FileName Dim Redirect Dim Tpl, HTMLTemplate Dim TemplateFileName Dim ComponentName Dim PathToCurrentPage Dim Attributes ' Events Dim CCSEvents Dim CCSEventResult ' Page controls Dim Login Dim ChildControls Response.ContentType = CCSContentType Redirect = "" TemplateFileName = "login.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "login.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-B05E7507 Set Attributes = New clsAttributes ' Controls Set Login = new clsRecordLogin ' Events %> <% BindEvents CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-6AA0DE03 Login.Operation 'End Execute Components 'Go to destination page @1-6D35F4FD If NOT ( Redirect = "" ) Then UnloadPage Response.Redirect Redirect End If 'End Go to destination page 'Initialize HTML Template @1-2E9DB4BC CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing) Set HTMLTemplate = new clsTemplate Set HTMLTemplate.Cache = TemplatesRepository HTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileName HTMLTemplate.SetVar "@CCS_PathToRoot", PathToRoot Set Tpl = HTMLTemplate.Block("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing) 'End Initialize HTML Template 'Show Page @1-65A9CCBF Attributes.Show HTMLTemplate, "page:" Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(Login)) ChildControls.Show Dim MainHTML HTMLTemplate.Parse "main", False MainHTML = HTMLTemplate.GetHTML("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeOutput", Nothing) If CCSEventResult Then Response.Write MainHTML 'End Show Page 'Unload Page @1-CB210C62 UnloadPage Set Tpl = Nothing Set HTMLTemplate = Nothing 'End Unload Page 'UnloadPage Sub @1-72CE9F3B Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) Set CCSEvents = Nothing Set Attributes = Nothing Set Login = Nothing End Sub 'End UnloadPage Sub Class clsRecordLogin 'Login Class @2-D3C99874 'Login Variables @2-DE97DD32 ' Public variables Public ComponentName Public HTMLFormAction Public PressedButton Public Errors Public FormSubmitted Public EditMode Public Visible Public Recordset Public TemplateBlock Public Attributes Public CCSEvents Private CCSEventResult Public InsertAllowed Public UpdateAllowed Public DeleteAllowed Public ReadAllowed Public DataSource Public Command Public ValidatingControls Public Controls ' Class variables Dim login Dim password Dim Button_DoLogin 'End Login Variables 'Login Class_Initialize Event @2-3097E563 Private Sub Class_Initialize() Visible = True Set Errors = New clsErrors Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes InsertAllowed = False UpdateAllowed = False DeleteAllowed = False ReadAllowed = True Dim Method Dim OperationMode OperationMode = Split(CCGetFromGet("ccsForm", Empty), ":") If UBound(OperationMode) > -1 Then FormSubmitted = (OperationMode(0) = "Login") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "Login" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set login = CCCreateControl(ccsTextBox, "login", Empty, ccsText, Empty, CCGetRequestParam("login", Method)) login.Required = True Set password = CCCreateControl(ccsTextBox, "password", Empty, ccsText, Empty, CCGetRequestParam("password", Method)) password.Required = True Set Button_DoLogin = CCCreateButton("Button_DoLogin", Method) Set ValidatingControls = new clsControls ValidatingControls.addControls Array(login, password) End Sub 'End Login Class_Initialize Event 'Login Class_Terminate Event @2-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub 'End Login Class_Terminate Event 'Login Validate Method @2-B9D513CF Function Validate() Dim Validation ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function 'End Login Validate Method 'Login Operation Method @2-7B695908 Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub If FormSubmitted Then PressedButton = "Button_DoLogin" If Button_DoLogin.Pressed Then PressedButton = "Button_DoLogin" End If End If Redirect = "Status.asp?" & CCGetQueryString("All", Array("ccsForm", "Button_DoLogin.x", "Button_DoLogin.y", "Button_DoLogin")) If Validate() Then If PressedButton = "Button_DoLogin" Then If NOT Button_DoLogin.OnClick() Then Redirect = "" End If End If Else Redirect = "" End If End Sub 'End Login Operation Method 'Login Show Method @2-FCB4C3DC Sub Show(Tpl) If NOT Visible Then Exit Sub EditMode = False If CCGetFromGet("ccsForm", Empty) = "" Then HTMLFormAction = FileName & "?" & CCAddParam(CCGetQueryString("All", Array("ccsForm", "Button_DoLogin.x", "Button_DoLogin.y", "Button_DoLogin")), "ccsForm", "Login" & IIf(EditMode, ":Edit", "")) Else HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "Login" & IIf(EditMode, ":Edit", "")) End If Set TemplateBlock = Tpl.Block("Record " & ComponentName) If TemplateBlock is Nothing Then Exit Sub TemplateBlock.Variable("HTMLFormName") = ComponentName TemplateBlock.Variable("HTMLFormEnctype") ="application/x-www-form-urlencoded" Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(login, password, Button_DoLogin)) If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors login.Errors Errors.AddErrors password.Errors With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString() .Parse False End With End If TemplateBlock.Variable("Action") = IIF(CCSUseAmps, Replace(HTMLFormAction, "&", CCSAmps), HTMLFormAction) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If Visible Then Attributes.Show TemplateBlock, "Login" & ":" Controls.Show End If End Sub 'End Login Show Method End Class 'End Login Class @2-A61BA892 %>