Changeset 92
- Timestamp:
- Sep 7, 2012, 9:52:38 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UModuleUser.pas
r91 r92 36 36 Identification := 'User'; 37 37 Title := 'User management'; 38 Version := ' 0.1';38 Version := '1.0'; 39 39 License := 'GNU/LGPL v3'; 40 40 Author := 'Chronosoft'; … … 65 65 try 66 66 DbRows := TDbRows.Create; 67 Core.CommonDatabase.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `User` (' + 68 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 69 '`Name` varchar(255) NOT NULL,' + 70 '`FullName` varchar(255) NOT NULL,' + 71 '`Password` varchar(255) NOT NULL,' + 72 '`Salt` varchar(255) NOT NULL,' + 73 '`Email` varchar(255) NOT NULL,' + 74 '`RegistrationTime` datetime NOT NULL,' + 75 'PRIMARY KEY (`Id`)' + 76 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 77 Core.CommonDatabase.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `UserOnline` (' + 78 '`Id` int(11) NOT NULL AUTO_INCREMENT,' + 79 '`User` int(11) NOT NULL DEFAULT ''0'',' + 80 '`ActivityTime` datetime NOT NULL DEFAULT ''0000-00-00 00:00:00'',' + 81 '`LoginTime` datetime NOT NULL DEFAULT ''0000-00-00 00:00:00'',' + 82 '`SessionId` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '''',' + 83 '`IpAddress` varchar(16) COLLATE utf8_czech_ci NOT NULL DEFAULT '''',' + 84 '`HostName` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '''',' + 85 '`ScriptName` varchar(255) COLLATE utf8_czech_ci NOT NULL,' + 86 'PRIMARY KEY (`Id`),' + 87 'KEY `User` (`User`)' + 88 ') ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=2 ;'); 67 Core.CommonDatabase.Query(DbRows, 68 'CREATE TABLE IF NOT EXISTS `User` (' + 69 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 70 ' `Name` varchar(255) NOT NULL,' + 71 ' `FullName` varchar(255) NOT NULL,' + 72 ' `Password` varchar(255) NOT NULL,' + 73 ' `Salt` varchar(255) NOT NULL,' + 74 ' `Email` varchar(255) NOT NULL,' + 75 ' `RegistrationTime` datetime NOT NULL,' + 76 ' PRIMARY KEY (`Id`)' + 77 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 78 Core.CommonDatabase.Query(DbRows, 79 'CREATE TABLE IF NOT EXISTS `UserOnline` (' + 80 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 81 ' `User` int(11) NOT NULL DEFAULT ''0'',' + 82 ' `ActivityTime` datetime NOT NULL DEFAULT ''0000-00-00 00:00:00'',' + 83 ' `LoginTime` datetime NOT NULL DEFAULT ''0000-00-00 00:00:00'',' + 84 ' `SessionId` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '''',' + 85 ' `IpAddress` varchar(16) COLLATE utf8_czech_ci NOT NULL DEFAULT '''',' + 86 ' `HostName` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '''',' + 87 ' `ScriptName` varchar(255) COLLATE utf8_czech_ci NOT NULL,' + 88 ' PRIMARY KEY (`Id`),' + 89 ' KEY `User` (`User`)' + 90 ') ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 89 91 finally 90 92 DbRows.Free; -
trunk/Packages/ModularSystem/ModularSystem.lpk
r89 r92 20 20 <Description Value="Modular system"/> 21 21 <License Value="GNU/LGPLv3"/> 22 <Version Minor=" 1"/>22 <Version Minor="2"/> 23 23 <Files Count="1"> 24 24 <Item1> -
trunk/Packages/ModularSystem/UModularSystem.pas
r91 r92 43 43 procedure EnumModulesInstall(ModuleList: TStringList); 44 44 procedure EnumModulesUninstall(ModuleList: TStringList); 45 procedure SetInstalledState(Value: Boolean); 45 46 constructor Create(Owner: TComponent); virtual; 46 47 destructor Destroy; override; … … 366 367 end; 367 368 369 procedure TModule.SetInstalledState(Value: Boolean); 370 begin 371 FInstalled := Value; 372 end; 373 368 374 constructor TModule.Create(Owner: TComponent); 369 375 begin -
trunk/UCore.pas
r91 r92 9 9 UHTTPServer, USqlDatabase, INIFiles, DateUtils, UWebPage, UWebApp, 10 10 UXmlClasses, UHtmlClasses, UUtils, UApplicationInfo, UHTTPServerTCP, 11 U ModuleUser, UHTTPSessionFile, UUser, SpecializedList, Registry,11 UHTTPSessionFile, UUser, SpecializedList, Registry, 12 12 UModularSystem; 13 13 … … 50 50 procedure Show(Content: string); 51 51 procedure RegisterModules; 52 procedure CheckModules; 52 53 public 53 54 CommonDatabase: TSqlDatabase; … … 85 86 86 87 uses 87 UInternetPage, UHostingPage, UHistoryPage, UDocumentsPage, UVoIPPage, 88 ULinksPage, UPlansPage, UServerInfoPage, UWebCamPage, UUserControlPage, 89 UNetworkPage, UAboutPage, UContactPage, UProjectsPage; 88 UModuleSystem, UModuleZdechovNET, UModuleUser, UPageAdmin; 90 89 91 90 { TWebSession } … … 178 177 LoadFromRegistry; 179 178 with Pages do begin 180 RegisterPage(TInternetPage, InternetPage, 'internet'); 181 RegisterPage(THostingPage, HostingPage, 'hosting'); 182 RegisterPage(THistoryPage, HistoryPage, 'historie'); 183 RegisterPage(TDocumentsPage, DocumentsPage, 'dokumenty'); 184 RegisterPage(TVoIPPage, VoIPPage, 'voip'); 185 RegisterPage(TLinksPage, LinksPage, 'odkazy'); 186 RegisterPage(TContactPage, ContactPage, 'kontakt'); 187 RegisterPage(TServerInfoPage, ServerInfoPage, 'serverinfo'); 188 RegisterPage(TWebCamPage, WebCamPage, 'kamery'); 189 RegisterPage(TPlansPage, PlansPage, 'plany'); 190 RegisterPage(TNetworkPage, NetworkPage, 'sit'); 191 RegisterPage(TProjectsPage, ProjectsPage, 'projekty'); 192 RegisterPage(TAboutPage, AboutPage, ''); 179 RegisterPage(TPageAdmin, PageAdmin, 'administration'); 193 180 end; 194 181 with WebApp1 do begin … … 282 269 begin 283 270 with ModuleManager do begin 271 RegisterModule(TModuleSystem.Create(nil), True); 284 272 RegisterModule(TModuleUser.Create(nil), True); 273 RegisterModule(TModuleZdechovNET.Create(nil), True); 274 end; 275 end; 276 277 procedure TCore.CheckModules; 278 var 279 DbRows: TDbRows; 280 Module: TModule; 281 begin 282 try 283 DbRows := TDbRows.Create; 284 CommonDatabase.Query(DbRows, 'SELECT * FROM INFORMATION_SCHEMA.TABLES ' + 285 'WHERE TABLE_SCHEMA = "' + CommonDatabase.Database + '" AND TABLE_NAME = "SystemModule"'); 286 Module := ModuleManager.FindModuleByName('System'); 287 if DbRows.Count > 0 then Module.SetInstalledState(True) 288 else Module.SetInstalledState(False); 289 finally 290 DbRows.Free; 285 291 end; 286 292 end; … … 425 431 426 432 RegisterModules; 433 CheckModules; 427 434 ModuleManager.StartInstalled; 428 435 -
trunk/ZdechovNET.lpi
r91 r92 68 68 </Item7> 69 69 </RequiredPackages> 70 <Units Count="2 2">70 <Units Count="25"> 71 71 <Unit0> 72 72 <Filename Value="ZdechovNET.lpr"/> … … 212 212 <UnitName Value="UUserControlPage"/> 213 213 </Unit21> 214 <Unit22> 215 <Filename Value="Modules/System/UModuleSystem.pas"/> 216 <IsPartOfProject Value="True"/> 217 <UnitName Value="UModuleSystem"/> 218 </Unit22> 219 <Unit23> 220 <Filename Value="Pages/UPageAdmin.pas"/> 221 <IsPartOfProject Value="True"/> 222 <ComponentName Value="PageAdmin"/> 223 <ResourceBaseClass Value="DataModule"/> 224 <UnitName Value="UPageAdmin"/> 225 </Unit23> 226 <Unit24> 227 <Filename Value="Modules/ZdechovNET/UModuleZdechovNET.pas"/> 228 <IsPartOfProject Value="True"/> 229 <UnitName Value="UModuleZdechovNET"/> 230 </Unit24> 214 231 </Units> 215 232 </ProjectOptions> … … 220 237 </Target> 221 238 <SearchPaths> 222 <OtherUnitFiles Value="/usr/lib/mysql/;/usr/lib64/mysql/;Application;WebServer;Network;Pages;Modules/User;Common "/>239 <OtherUnitFiles Value="/usr/lib/mysql/;/usr/lib64/mysql/;Application;WebServer;Network;Pages;Modules/User;Common;Modules/System;Modules/ZdechovNET"/> 223 240 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 224 241 </SearchPaths>
Note:
See TracChangeset
for help on using the changeset viewer.