Changeset 105 for trunk/Modules/User/UUserControlPage.pas
- Timestamp:
- Oct 9, 2012, 1:58:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UUserControlPage.pas
r103 r105 7 7 uses 8 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, UXmlClasses, 9 UWebObjects ;9 UWebObjects, UModuleUser, UModuleBase; 10 10 11 11 type … … 21 21 procedure HandleProfile(HandlerData: THTTPHandlerData); 22 22 public 23 { public declarations } 24 end; 23 ModuleUser: TModuleUser; 24 ModuleBase: TModuleBase; 25 end; 25 26 26 27 var … … 47 48 else PageName := ''; 48 49 with HtmlDocument.Body do begin 49 LoadUserInfo;50 ModuleUser.LoadUserInfo; 50 51 if PageName = '' then PageName := 'prihlaseni'; 51 52 if PageName = 'prihlaseni' then HandleLogin(HandlerData) … … 91 92 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 92 93 Text := 'Přihlášení uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 93 UserId := User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,94 UserId := ModuleUser.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 94 95 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 95 96 if UserId = -1 then begin 96 97 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 97 98 Text := '<br/>Chybné jméno nebo heslo'; 98 end else UserOnline.Login(UserId);99 end else ModuleUser.UserOnline.Login(UserId); 99 100 Form.Free; 100 101 end else … … 149 150 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 150 151 Text := 'Registrace uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 151 User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,152 ModuleUser.User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 152 153 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value, 153 154 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Email').Value.Value); 154 UserId := User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,155 UserId := ModuleUser.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 155 156 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 156 if UserId <> -1 then UserOnline.Login(UserId);157 if UserId <> -1 then ModuleUser.UserOnline.Login(UserId); 157 158 Form.Free; 158 159 end else SubItems.AddNew(Form); … … 163 164 begin 164 165 with TWebSession(HandlerData), Core, HtmlDocument.Body do begin 165 UserOnline.Logout;166 ModuleUser.UserOnline.Logout; 166 167 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 167 168 Text := 'Uživatel odhlášen'; … … 185 186 Hint := 'Zadejte vaše přihlašovací jméno'; 186 187 Required := True; 187 Value.Value := User.Name;188 Value.Value := ModuleUser.User.Name; 188 189 end; 189 190 with AddNewItem do begin … … 200 201 Required := True; 201 202 ItemType := fitText; 202 Value.Value := User.Email;203 Value.Value := ModuleUser.User.Email; 203 204 end; 204 205 with AddNewItem do begin … … 208 209 Required := False; 209 210 ItemType := fitText; 210 Value.Value := User.FullName;211 Value.Value := ModuleUser.User.FullName; 211 212 end; 212 213 end; … … 218 219 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 219 220 Text := 'Profil uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value + ' uložen'; 220 User.Name := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value;221 User.FullName := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('FullName').Value.Value;222 User.Email := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Email').Value.Value;223 User.Save;221 ModuleUser.User.Name := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 222 ModuleUser.User.FullName := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('FullName').Value.Value; 223 ModuleUser.User.Email := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Email').Value.Value; 224 ModuleUser.User.Save; 224 225 Form.Free; 225 226 end else SubItems.AddNew(Form);
Note:
See TracChangeset
for help on using the changeset viewer.