Changeset 167 for www/temp/transform.php
- Timestamp:
- Mar 24, 2009, 11:44:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/temp/transform.php
r164 r167 1 1 <?php 2 2 3 //$SessionDisable = true; 3 4 include('../global.php'); 4 5 … … 140 141 $this->Database->insert('PermissionGroup', array('Description' => 'Ostatní')); 141 142 $PermissionGroupOthers = $this->Database->insert_id; 142 $this->Database->insert('PermissionGroup', array('Description' => ' Členové sítě'));143 $PermissionGroup Members= $this->Database->insert_id;144 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroup Members, 'GroupOrOperation' => $PermissionGroupOthers, 'Type' => 'Group'));143 $this->Database->insert('PermissionGroup', array('Description' => 'Registrovaní uživatelé')); 144 $PermissionGroupRegistred = $this->Database->insert_id; 145 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupRegistred, 'GroupOrOperation' => $PermissionGroupOthers, 'Type' => 'Group')); 145 146 //echo($this->Database->LastQuery); 146 147 $this->Database->insert('PermissionGroup', array('Description' => 'Zástupci za domácnost')); 147 148 $PermissionGroupSubjects = $this->Database->insert_id; 148 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupSubjects, 'GroupOrOperation' => $PermissionGroup Members, 'Type' => 'Group'));149 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupSubjects, 'GroupOrOperation' => $PermissionGroupRegistred, 'Type' => 'Group')); 149 150 $this->Database->insert('PermissionGroup', array('Description' => 'Správci sítě')); 150 151 $PermissionGroupNetworkAdmins = $this->Database->insert_id; … … 158 159 $OperationId = $this->Database->insert_id; 159 160 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 161 162 $this->Database->insert('PermissionOperation', array('Module' => 'News', 'Operation' => 'Insert', 'Item' => '')); 163 $OperationId = $this->Database->insert_id; 164 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupRegistred, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 160 165 161 166 $this->Database->insert('PermissionOperation', array('Module' => 'News', 'Operation' => 'Display', 'Item' => 'Item')); … … 176 181 } else 177 182 { 178 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroup Others, 'GroupOrOperation' => $OperationIdInsert, 'Type' => 'Operation'));183 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupRegistred, 'GroupOrOperation' => $OperationIdInsert, 'Type' => 'Operation')); 179 184 } 180 185 } … … 186 191 $this->Database->insert('PermissionOperation', array('Module' => 'Share', 'Operation' => 'Display')); 187 192 $OperationId = $this->Database->insert_id; 188 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroup Members, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation'));193 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupRegistred, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 189 194 190 195 $this->Database->insert('PermissionOperation', array('Module' => 'Finance', 'Operation' => 'DisplaySubjectState')); … … 219 224 $OperationId = $this->Database->insert_id; 220 225 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupSubjects, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 226 227 $this->Database->insert('PermissionOperation', array('Module' => 'Finance', 'Operation' => 'TradingStatus')); 228 $OperationId = $this->Database->insert_id; 229 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupAdmin, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 221 230 222 231 // Init User table from users … … 230 239 if($DbRow['role'] == 1) 231 240 { 232 $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)); 241 //$Password = sha1(strtoupper($DbRow['nick'])); 242 $Password = substr(sha1(mt_rand(0, 1000000)), 0, 10); 243 $this->Database->insert('User', array('Id' => $DbRow['id'], 'Name' => $DbRow['nick'], 'FirstName' => $DbRow['first_name'], 'SecondName' => $DbRow['second_name'], 'PhoneNumber' => $DbRow['phone'], 'Password' => sha1($Password), 'ICQ' => $DbRow['icq'], 'Email' => $DbRow['email'], 'Locked' => 0, 'InitPassword' => $Password, 'Nick' => $DbRow['nick'])); 233 244 $UserId = $this->Database->insert_id; 234 $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroup Members, 'Type' => 'Group'));245 $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupRegistred, 'Type' => 'Group')); 235 246 } else 236 247 if($DbRow['role'] == 2) 237 248 { 238 249 $this->Database->insert('Subject', array('Id' => $DbRow['id'], 'Name' => $DbRow['subject_name'], 'AddressStreet' => $DbRow['street'], 'AddressTown' => $DbRow['town'], 'AddressPSC' => $DbRow['psc'], 'IC' => $DbRow['ico'], 'DIC' => $DbRow['dic'], 'MapPositionX' => $DbRow['PositionX'], 'MapPositionY' => $DbRow['PositionY'])); 239 $SubjectId = $this->Database->insert_id;240 $this->Database->insert('Member', array('Id' => $DbRow['id'], 'Subject' => $SubjectId, 'FamilyMemberCount' => $DbRow['family'], 'NetworkSegment' => $DbRow['network_segment'], 'InternetTariffCurrentMonth' => $DbRow['inet_tarif_now'], 'InternetTariffNextMonth' => $DbRow['inet_tarif_next'], 'MembershipDate' => $DbRow['membership_date'], 'MemberState' => 0, 'BillingPeriod' => $DbRow['BillingPeriod']));250 $SubjectId = $this->Database->insert_id; 251 $this->Database->insert('Member', array('Id' => $DbRow['id'], 'Subject' => $SubjectId, 'FamilyMemberCount' => $DbRow['family'], 'NetworkSegment' => $DbRow['network_segment'], 'InternetTariffCurrentMonth' => $DbRow['inet_tarif_now'], 'InternetTariffNextMonth' => $DbRow['inet_tarif_next'], 'MembershipDate' => $DbRow['membership_date'], 'MemberState' => 0, 'BillingPeriod' => $DbRow['BillingPeriod'])); 241 252 $MemberId = $this->Database->insert_id; 242 $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, 'Member' => $MemberId)); 253 $Password = substr(sha1(mt_rand(0, 1000000)), 0, 10); 254 $this->Database->insert('User', array('Id' => $DbRow['id'], 'Name' => $DbRow['nick'], 'FirstName' => $DbRow['first_name'], 'SecondName' => $DbRow['second_name'], 'PhoneNumber' => $DbRow['phone'], 'Password' => sha1($Password), 'ICQ' => $DbRow['icq'], 'Email' => $DbRow['email'], 'Locked' => 0, 'Member' => $MemberId, 'InitPassword' => $Password, 'Nick' => $DbRow['nick'])); 243 255 $UserId = $this->Database->insert_id; 244 $this->Database->update('Member', 'Id='.$MemberId, array('ResponsibleUser' => $UserId));245 if($DbRow['id'] == 1) $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupAdmin, 'Type' => 'Group'));256 $this->Database->update('Member', 'Id='.$MemberId, array('ResponsibleUser' => $UserId)); 257 if($DbRow['id'] == 1) $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupAdmin, 'Type' => 'Group')); 246 258 else $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupSubjects, 'Type' => 'Group')); 247 259 }
Note:
See TracChangeset
for help on using the changeset viewer.