Changeset 94
- Timestamp:
- Sep 7, 2012, 10:43:02 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UModuleUser.pas
r92 r94 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem ;8 Classes, SysUtils, UModularSystem, SpecializedDictionary; 9 9 10 10 type … … 62 62 var 63 63 DbRows: TDbRows; 64 Data: TDictionaryStringString; 64 65 begin 65 66 try 66 67 DbRows := TDbRows.Create; 68 Data := TDictionaryStringString.Create; 69 67 70 Core.CommonDatabase.Query(DbRows, 68 71 'CREATE TABLE IF NOT EXISTS `User` (' + … … 76 79 ' PRIMARY KEY (`Id`)' + 77 80 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 81 82 Data.Add('Id', '1'); 83 Data.Add('Name', 'anonymous'); 84 Data.Add('FullName', 'Anonymous'); 85 Data.Add('RegistrationTime', 'NOW()'); 86 Core.CommonDatabase.Insert('User', Data); 87 78 88 Core.CommonDatabase.Query(DbRows, 79 89 'CREATE TABLE IF NOT EXISTS `UserOnline` (' + … … 90 100 ') ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 91 101 finally 102 Data.Free; 92 103 DbRows.Free; 93 104 end; -
trunk/Packages/ModularSystem/UModularSystem.pas
r93 r94 44 44 procedure EnumModulesUninstall(ModuleList: TStringList); 45 45 procedure SetInstalledState(Value: Boolean); 46 constructor Create(Owner: TComponent); virtual;46 constructor Create(Owner: TComponent); override; 47 47 destructor Destroy; override; 48 48 property Running: Boolean read FRunning write SetRunning; … … 70 70 Modules: TObjectList; // TObjectList<TModule> 71 71 function FindModuleByName(Name: string): TModule; 72 function ModuleRunning(Name: string): Boolean; 72 73 procedure StartDependencies(ModuleName: string; Dependencies: TStringList); 73 74 procedure StopDependencies(ModuleName: string); … … 125 126 end; 126 127 128 function TModuleManager.ModuleRunning(Name: string): Boolean; 129 var 130 Module: TModule; 131 begin 132 Module := FindModuleByName(Name); 133 if Assigned(Module) then begin 134 Result := Module.Running; 135 end else Result := False; 136 end; 137 127 138 procedure TModuleManager.StartDependencies(ModuleName: string; Dependencies: TStringList); 128 139 var -
trunk/UCore.pas
r93 r94 130 130 procedure TWebSession.LoadUserInfo; 131 131 begin 132 User.HandlerData := Self; 133 UserOnline.HandlerData := Self; 134 UserOnline.Update; 135 User.Id := UserOnline.User; 136 User.Load; 132 if Core.ModuleManager.ModuleRunning('User') then begin 133 User.HandlerData := Self; 134 UserOnline.HandlerData := Self; 135 UserOnline.Update; 136 User.Id := UserOnline.User; 137 User.Load; 138 end; 137 139 end; 138 140
Note:
See TracChangeset
for help on using the changeset viewer.