Changeset 153 for www/temp/transform.php


Ignore:
Timestamp:
Feb 16, 2009, 6:16:00 PM (16 years ago)
Author:
george
Message:
  • Přidáno: Zobrazování chyb v SQL povelech. Nastavení v konfigureaci.
  • Upraveno: Zpřístupnění stavu financí dle ip i dle přihlášení.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/temp/transform.php

    r151 r153  
    105105  function SubjectOpenTime()
    106106  {
    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`');
    110110    foreach($this->Subjects as $SubjectName => $Subject)
    111111    {
     
    159159    $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation'));
    160160
     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
    161165    $DbResult = $this->Database->select('news_category', 'id, permission');
    162166    while($DbRow = $DbResult->fetch_array())
     
    167171      $OperationIdDisplay = $this->Database->insert_id;
    168172      $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, 'GroupOrOoperation' => $OperationIdInsert, 'Type' => 'Operation'));
     173      if($DbRow['permission'] == 0)
     174      {
     175        $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOperation' => $OperationIdInsert, 'Type' => 'Operation'));
    172176      } else
    173177      {
     
    189193
    190194    $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'));
    193197
    194198    $this->Database->insert('PermissionOperation', array('Module' => 'Finance', 'Operation' => 'Manage'));
     
    207211    $OperationId = $this->Database->insert_id;
    208212    $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'));
    209217
    210218    // Init User table from users
     
    212220    while($DbRow = $DbResult->fetch_array())
    213221    {
    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));
    215223      $UserId = $this->Database->insert_id;
    216224      if($DbRow['id'] == 1)
Note: See TracChangeset for help on using the changeset viewer.