Changeset 68 for trunk/Pages/UUserControlPage.pas
- Timestamp:
- Dec 26, 2011, 12:07:37 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Pages/UUserControlPage.pas
r67 r68 16 16 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 17 17 private 18 { private declarations } 18 procedure HandleLogin(HandlerData: THTTPHandlerData); 19 procedure HandleRegistration(HandlerData: THTTPHandlerData); 19 20 public 20 21 { public declarations } … … 45 46 if PageName = '' then PageName := 'prihlaseni'; 46 47 if PageName = 'prihlaseni' then begin 47 with TQueryForm(SubItems.AddNew(TQueryForm.Create)) do begin 48 Title := 'Přihlášení'; 49 ClassId := 'WideTable'; 50 //Action.AsString := '/dev/zdechovnet/trunk/serverinfoo'; 51 with AddNewGroup do begin 52 Title := ''; 53 with AddNewItem do begin 54 Caption := 'Jméno'; 55 Name := 'Name'; 56 Hint := 'Zadejte vaše přihlašovací jméno'; 57 Required := True; 58 end; 59 with AddNewItem do begin 60 Caption := 'Heslo'; 61 Name := 'Password'; 62 Hint := 'Zadejte vaše heslo'; 63 Required := True; 64 ItemType := fitPassword; 65 end; 66 end; 67 with AddNewAction do begin 68 Caption := 'Přihlásit'; 69 Action := 'Login'; 70 end; 71 end; 48 HandleLogin(HandlerData); 72 49 end else 73 50 if PageName = 'registrace' then begin 74 with TQueryForm(SubItems.AddNew(TQueryForm.Create)) do begin 75 Title := 'Registrace nového účtu'; 76 ClassId := 'WideTable'; 77 with AddNewGroup do begin 78 Title := ''; 79 with AddNewItem do begin 80 Caption := 'Jméno'; 81 Name := 'Name'; 82 Hint := 'Zadejte vaše přihlašovací jméno'; 83 Required := True; 84 end; 85 with AddNewItem do begin 86 Caption := 'Email'; 87 Name := 'Email'; 88 Hint := 'Zadejte vaši elektronickou poštovní schránku'; 89 Required := True; 90 end; 91 with AddNewItem do begin 92 Caption := 'Heslo'; 93 Name := 'Password'; 94 Hint := 'Zadejte vaše heslo'; 95 Required := True; 96 ItemType := fitPassword; 97 end; 98 with AddNewItem do begin 99 Caption := 'Ověření hesla'; 100 Name := 'PasswordConfirm'; 101 Hint := 'Zadejte znovu vaše heslo pro ověření'; 102 Required := True; 103 ItemType := fitPassword; 104 end; 105 end; 106 with AddNewAction do begin 107 Caption := 'Registrovat'; 108 Action := 'Register'; 109 end; 110 end; 51 HandleRegistration(HandlerData); 111 52 end; 112 53 end; … … 114 55 end; 115 56 57 procedure TUserControlPage.HandleLogin(HandlerData: THTTPHandlerData); 58 var 59 Form: TQueryForm; 60 begin 61 with MainModule, HtmlDocument.Body do begin 62 Form := TQueryForm.Create; 63 with Form do begin 64 Title := 'Přihlášení'; 65 ClassId := 'WideTable'; 66 //Action.AsString := '/dev/zdechovnet/trunk/serverinfoo'; 67 with AddNewGroup do begin 68 Title := ''; 69 with AddNewItem do begin 70 Caption := 'Jméno'; 71 Name := 'Name'; 72 Hint := 'Zadejte vaše přihlašovací jméno'; 73 Required := True; 74 end; 75 with AddNewItem do begin 76 Caption := 'Heslo'; 77 Name := 'Password'; 78 Hint := 'Zadejte vaše heslo'; 79 Required := True; 80 ItemType := fitPassword; 81 end; 82 end; 83 with AddNewAction do begin 84 Caption := 'Přihlásit'; 85 Action := 'Login'; 86 end; 87 end; 88 if HandlerData.Request.Post.IndexOfName('Login') <> -1 then begin 89 Form.Load(HandlerData.Request.Post); 90 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 91 Text := 'Přihlášení user: ' + TQueryFormItem(TQueryFormGroup(Form.Groups[0]).Rows[0]).Value.Value; 92 Form.Free; 93 end else 94 SubItems.AddNew(Form); 95 end; 96 end; 97 98 procedure TUserControlPage.HandleRegistration(HandlerData: THTTPHandlerData); 99 begin 100 with MainModule, HtmlDocument.Body do begin 101 with TQueryForm(SubItems.AddNew(TQueryForm.Create)) do begin 102 Title := 'Registrace nového účtu'; 103 ClassId := 'WideTable'; 104 with AddNewGroup do begin 105 Title := ''; 106 with AddNewItem do begin 107 Caption := 'Jméno'; 108 Name := 'Name'; 109 Hint := 'Zadejte vaše přihlašovací jméno'; 110 Required := True; 111 end; 112 with AddNewItem do begin 113 Caption := 'Email'; 114 Name := 'Email'; 115 Hint := 'Zadejte vaši elektronickou poštovní schránku'; 116 Required := True; 117 end; 118 with AddNewItem do begin 119 Caption := 'Heslo'; 120 Name := 'Password'; 121 Hint := 'Zadejte vaše heslo'; 122 Required := True; 123 ItemType := fitPassword; 124 end; 125 with AddNewItem do begin 126 Caption := 'Ověření hesla'; 127 Name := 'PasswordConfirm'; 128 Hint := 'Zadejte znovu vaše heslo pro ověření'; 129 Required := True; 130 ItemType := fitPassword; 131 end; 132 end; 133 with AddNewAction do begin 134 Caption := 'Registrovat'; 135 Action := 'Register'; 136 end; 137 end; 138 end; 139 end; 140 116 141 end. 117 142
Note:
See TracChangeset
for help on using the changeset viewer.