Changeset 103 for trunk/Modules/User
- Timestamp:
- Oct 8, 2012, 8:48:16 AM (12 years ago)
- Location:
- trunk/Modules/User
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UModuleUser.pas
r97 r103 80 80 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 81 81 82 Data.Add('Id', '1');83 Data.Add('Name', 'anonymous');84 Data.Add('FullName', 'Anonymous');85 Data.Add('RegistrationTime', 'NOW()');86 Data.Add('Password', '');87 Data.Add('Salt', '');88 Data.Add('Email', '');89 Core.CommonDatabase.Insert('User', Data);90 91 82 Core.CommonDatabase.Query(DbRows, 92 83 'CREATE TABLE IF NOT EXISTS `UserOnline` (' + … … 102 93 ' KEY `User` (`User`)' + 103 94 ') ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 95 96 Core.CommonDatabase.Query(DbRows, 97 'CREATE TABLE IF NOT EXISTS `PermissionGroup` (' + 98 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 99 ' `Description` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT "",' + 100 ' PRIMARY KEY (`Id`)' + 101 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 102 103 Core.CommonDatabase.Query(DbRows, 104 'CREATE TABLE IF NOT EXISTS `PermissionGroupAssignment` (' + 105 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 106 ' `Group` int(11) NOT NULL DEFAULT "0",' + 107 ' `AssignedGroup` int(11) DEFAULT NULL,' + 108 ' `AssignedOperation` int(11) DEFAULT NULL,' + 109 ' PRIMARY KEY (`Id`),' + 110 ' KEY `Group` (`Group`),' + 111 ' KEY `AssignedGroup` (`AssignedGroup`),' + 112 ' KEY `AssignedOperation` (`AssignedOperation`)' + 113 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 114 115 Core.CommonDatabase.Query(DbRows, 116 'CREATE TABLE IF NOT EXISTS `PermissionOperation` (' + 117 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 118 ' `Module` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT "",' + 119 ' `Operation` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT "",' + 120 ' `Item` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT "",' + 121 ' `ItemId` int(11) NOT NULL DEFAULT "0",' + 122 ' PRIMARY KEY (`Id`),' + 123 ' KEY `Module` (`Module`),' + 124 ' KEY `Operation` (`Operation`),' + 125 ' KEY `Item` (`Item`),' + 126 ' KEY `ItemId` (`ItemId`)' + 127 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 128 129 Core.CommonDatabase.Query(DbRows, 130 ' CREATE TABLE IF NOT EXISTS `PermissionUserAssignment` (' + 131 ' `Id` int(11) NOT NULL AUTO_INCREMENT,' + 132 ' `User` int(11) NOT NULL DEFAULT "0",' + 133 ' `AssignedGroup` int(11) DEFAULT NULL,' + 134 ' `AssignedOperation` int(11) DEFAULT NULL,' + 135 ' PRIMARY KEY (`Id`),' + 136 ' KEY `User` (`User`),' + 137 ' KEY `AssignedGroup` (`AssignedGroup`),' + 138 ' KEY `AssignedOperation` (`AssignedOperation`)' + 139 ') ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;'); 140 141 Core.CommonDatabase.Query(DbRows, 142 'ALTER TABLE `PermissionGroupAssignment`' + 143 ' ADD CONSTRAINT `PermissionGroupAssignment_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `permissiongroup` (`Id`),' + 144 ' ADD CONSTRAINT `PermissionGroupAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `permissiongroup` (`Id`),' + 145 ' ADD CONSTRAINT `PermissionGroupAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `permissionoperation` (`Id`);'); 146 147 Core.CommonDatabase.Query(DbRows, 148 'ALTER TABLE `PermissionUserAssignment`' + 149 ' ADD CONSTRAINT `PermissionUserAssignment_ibfk_1` FOREIGN KEY (`User`) REFERENCES `user` (`Id`),' + 150 ' ADD CONSTRAINT `PermissionUserAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `permissiongroup` (`Id`),' + 151 ' ADD CONSTRAINT `PermissionUserAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `permissionoperation` (`Id`);'); 152 153 104 154 finally 105 155 Data.Free; … … 116 166 try 117 167 DbRows := TDbRows.Create; 168 169 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `PermissionUserAssignment`'); 170 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `PermissionGroupAssignment`'); 171 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `PermissionGroup`'); 172 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `PermissionOperation`'); 118 173 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `User`'); 119 174 Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `UserOnline`'); -
trunk/Modules/User/UUserControlPage.pas
r100 r103 32 32 33 33 uses 34 UCore, UUtils, UUser ;34 UCore, UUtils, UUser, UWebSession; 35 35 36 36 { TUserControlPage } … … 85 85 end; 86 86 end; 87 with AddNewAction do begin 88 Caption := 'Přihlásit'; 89 Action := 'Login'; 90 end; 87 AddNewAction('Přihlásit', 'Login'); 91 88 end; 92 89 if HandlerData.Request.Post.SearchKey('Login') <> -1 then begin … … 145 142 end; 146 143 end; 147 with AddNewAction do begin 148 Caption := 'Registrovat'; 149 Action := 'Register'; 150 end; 144 AddNewAction('Registrovat', 'Register'); 151 145 end; 152 146 if HandlerData.Request.Post.SearchKey('Register') <> -1 then … … 217 211 end; 218 212 end; 219 with AddNewAction do begin 220 Caption := 'Uložit'; 221 Action := 'Save'; 222 end; 213 AddNewAction('Uložit', 'Save'); 223 214 end; 224 215 if HandlerData.Request.Post.SearchKey('Save') <> -1 then
Note:
See TracChangeset
for help on using the changeset viewer.