Changeset 78 for trunk/Pages/UUserControlPage.pas
- Timestamp:
- Jun 18, 2012, 10:44:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Pages/UUserControlPage.pas
r77 r78 43 43 NewItem: TQueryFormItem; 44 44 begin 45 if HandlerData.Request.QueryParts.Count > 1 then PageName := HandlerData.Request.QueryParts[1] 46 else PageName := ''; 47 with MainModule, HtmlDocument.Body do begin 48 LoadUserInfo(HandlerData); 49 if PageName = '' then PageName := 'prihlaseni'; 50 if PageName = 'prihlaseni' then HandleLogin(HandlerData) 51 else if PageName = 'registrace' then HandleRegistration(HandlerData) 52 else if PageName = 'odhlaseni' then HandleLogout(HandlerData) 53 else if PageName = 'profil' then HandleProfile(HandlerData); 54 end; 55 MainModule.GeneratePage(HandlerData, Self); 45 with TWebSession(HandlerData) do begin 46 if Request.Path.Count > 1 then PageName := Request.Path[1] 47 else PageName := ''; 48 with HtmlDocument.Body do begin 49 LoadUserInfo; 50 if PageName = '' then PageName := 'prihlaseni'; 51 if PageName = 'prihlaseni' then HandleLogin(HandlerData) 52 else if PageName = 'registrace' then HandleRegistration(HandlerData) 53 else if PageName = 'odhlaseni' then HandleLogout(HandlerData) 54 else if PageName = 'profil' then HandleProfile(HandlerData); 55 end; 56 GeneratePage(Self); 57 end; 56 58 end; 57 59 … … 61 63 UserId: Integer; 62 64 begin 63 with MainModule, HtmlDocument.Body do begin65 with TWebSession(MainModule), HtmlDocument.Body do begin 64 66 Form := TQueryForm.Create; 65 67 with Form do begin … … 92 94 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 93 95 Text := 'Přihlášení user: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 94 UserId := MainModule.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,96 UserId := User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 95 97 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 96 98 UserOnline.Login(UserId); … … 106 108 UserId: Integer; 107 109 begin 108 with MainModule, HtmlDocument.Body do begin110 with TWebSession(MainModule), HtmlDocument.Body do begin 109 111 Form := TQueryForm.Create; 110 112 with Form do begin … … 150 152 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 151 153 Text := 'Registrace uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 152 MainModule.User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,154 User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 153 155 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value, 154 156 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Email').Value.Value); 155 UserId := MainModule.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,157 UserId := User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 156 158 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 157 MainModule.UserOnline.Login(UserId);159 UserOnline.Login(UserId); 158 160 Form.Free; 159 161 end else SubItems.AddNew(Form); … … 163 165 procedure TUserControlPage.HandleLogout(HandlerData: THTTPHandlerData); 164 166 begin 165 with MainModule, HtmlDocument.Body do begin167 with TWebSession(MainModule), HtmlDocument.Body do begin 166 168 UserOnline.Logout; 167 169 with THtmlString(SubItems.AddNew(THtmlString.Create)) do … … 174 176 Form: TQueryForm; 175 177 begin 176 with MainModule, HtmlDocument.Body do begin178 with TWebSession(HandlerData), HtmlDocument.Body do begin 177 179 Form := TQueryForm.Create; 178 180 with Form do begin
Note:
See TracChangeset
for help on using the changeset viewer.