Changeset 105 for trunk/Modules/User/UModuleUser.pas
- Timestamp:
- Oct 9, 2012, 1:58:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UModuleUser.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary; 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UUser, 9 UModuleBase, UWebPage; 9 10 10 11 type 11 12 12 { TModuleUser } 13 13 14 14 TModuleUser = class(TModule) 15 private 16 UserControlPage: TWebPage; //TUserControlPage; 15 17 public 18 User: TWebUser; 19 UserOnline: TWebOnlineUser; 20 ModuleBase: TModuleBase; 16 21 constructor Create(Owner: TComponent); override; 17 22 destructor Destroy; override; … … 21 26 procedure Uninstall; override; 22 27 procedure Upgrade; override; 28 procedure LoadUserInfo; 23 29 end; 24 30 … … 27 33 28 34 uses 29 UCore, U UserControlPage, USqlDatabase;35 UCore, USqlDatabase, UUserControlPage; 30 36 31 37 { TModuleUser } … … 39 45 License := 'GNU/LGPL v3'; 40 46 Author := 'Chronosoft'; 47 Dependencies.Add('Base'); 41 48 end; 42 49 … … 48 55 procedure TModuleUser.Start; 49 56 begin 50 Core.Pages.RegisterPage(TUserControlPage, UserControlPage, 'uzivatel'); 57 BeforeStart; 58 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 59 UserControlPage := TUserControlPage.Create(nil); 60 ModuleBase.Pages.RegisterPage(UserControlPage, 'uzivatel'); 51 61 //RegisterPage(TUserControlPage, UserControlPage, ''); 52 inherited; 62 User := TWebUser.Create; 63 //User.Database := Database; 64 UserOnline := TWebOnlineUser.Create; 65 //UserOnline.Database := Database; 66 AfterStart; 53 67 end; 54 68 55 69 procedure TModuleUser.Stop; 56 70 begin 57 inherited; 58 Core.Pages.UnregisterPage('uzivatel'); 71 BeforeStop; 72 FreeAndNil(User); 73 FreeAndNil(UserOnline); 74 ModuleBase.Pages.UnregisterPage(UserControlPage); 75 FreeAndNil(UserControlPage); 76 ModuleBase := nil; 77 AfterStop; 59 78 end; 60 79 … … 183 202 end; 184 203 204 procedure TModuleUser.LoadUserInfo; 205 begin 206 User.HandlerData := ModuleBase.HandlerData; 207 UserOnline.HandlerData := ModuleBase.HandlerData; 208 UserOnline.Update; 209 User.Id := UserOnline.User; 210 User.Load; 211 end; 212 213 214 185 215 end. 186 216
Note:
See TracChangeset
for help on using the changeset viewer.