Changeset 153 for www/temp/transform.php
- Timestamp:
- Feb 16, 2009, 6:16:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/temp/transform.php
r151 r153 105 105 function SubjectOpenTime() 106 106 { 107 $this->Database->query('DELETE FROM Subject WHERE Subject.Id = SubjectOpenTime.Subject');108 $this->Database->query('TRUNCATE TABLE SubjectOpenTime');109 $this->Database->query('TRUNCATE TABLE SubjectOpenTimeInterval');107 //$this->Database->query('DELETE FROM `Subject` WHERE `Subject`.`Id` = (SELECT `Subject` FROM `SubjectOpenTime`)'); 108 $this->Database->query('TRUNCATE TABLE `SubjectOpenTime`'); 109 $this->Database->query('TRUNCATE TABLE `SubjectOpenTimeInterval`'); 110 110 foreach($this->Subjects as $SubjectName => $Subject) 111 111 { … … 159 159 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 160 160 161 $this->Database->insert('PermissionOperation', array('Module' => 'News', 'Operation' => 'Display', 'Item' => 'Item')); 162 $OperationId = $this->Database->insert_id; 163 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 164 161 165 $DbResult = $this->Database->select('news_category', 'id, permission'); 162 166 while($DbRow = $DbResult->fetch_array()) … … 167 171 $OperationIdDisplay = $this->Database->insert_id; 168 172 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationIdDisplay, 'Type' => 'Operation')); 169 if($DbRow['permission'] == 1)170 { 171 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrO operation' => $OperationIdInsert, 'Type' => 'Operation'));173 if($DbRow['permission'] == 0) 174 { 175 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOperation' => $OperationIdInsert, 'Type' => 'Operation')); 172 176 } else 173 177 { … … 189 193 190 194 $this->Database->insert('PermissionOperation', array('Module' => 'EatingPlace', 'Operation' => 'Edit')); 191 $OperationId = $this->Database->insert_id;192 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupMembers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation'));195 //$OperationId = $this->Database->insert_id; 196 //$this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupMembers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 193 197 194 198 $this->Database->insert('PermissionOperation', array('Module' => 'Finance', 'Operation' => 'Manage')); … … 207 211 $OperationId = $this->Database->insert_id; 208 212 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 213 214 $this->Database->insert('PermissionOperation', array('Module' => 'Network', 'Operation' => 'RegistredHostList')); 215 $OperationId = $this->Database->insert_id; 216 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupSubjects, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 209 217 210 218 // Init User table from users … … 212 220 while($DbRow = $DbResult->fetch_array()) 213 221 { 214 $this->Database->insert('User', array('Id' => $DbRow['id'], 'Name' => $DbRow['nick'], 'FirstName' => $DbRow['first_name'], 'SecondName' => $DbRow['second_name'], 'PhoneNumber' => $DbRow['phone'], 'Password' => substr(sha1(strtoupper($DbRow['nick'])), 0, 7 ), 'ICQ' => $DbRow['icq'], 'Email' => $DbRow['email'], 'Locked' => 0));222 $this->Database->insert('User', array('Id' => $DbRow['id'], 'Name' => $DbRow['nick'], 'FirstName' => $DbRow['first_name'], 'SecondName' => $DbRow['second_name'], 'PhoneNumber' => $DbRow['phone'], 'Password' => substr(sha1(strtoupper($DbRow['nick'])), 0, 70), 'ICQ' => $DbRow['icq'], 'Email' => $DbRow['email'], 'Locked' => 0)); 215 223 $UserId = $this->Database->insert_id; 216 224 if($DbRow['id'] == 1)
Note:
See TracChangeset
for help on using the changeset viewer.