Changeset 167 for www/temp/transform.php


Ignore:
Timestamp:
Mar 24, 2009, 11:44:03 AM (16 years ago)
Author:
george
Message:
  • Přidáno: Stránka pro rozeslání emailů s počátečními hesly.
  • Upraveno: Konfigurační skripty pro nastavení síťových zařízení se systémem RouterOS doplněny o podporu zápisu konfigurace do více samostatných zařízení. Změna se týká konfigurace DHCP serveru a sledování net_watch.
  • Opraveno: Některé nefunkční odkazy na hlavní stránce.
  • Upraveno: Tabulka finance_operations nově převedena na tabulky FinanceOperation a FinanceClaimsLiabilities. Upraveny související stránky.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/temp/transform.php

    r164 r167  
    11<?php
    22
     3//$SessionDisable = true;
    34include('../global.php');
    45
     
    140141    $this->Database->insert('PermissionGroup', array('Description' => 'Ostatní'));
    141142    $PermissionGroupOthers = $this->Database->insert_id;
    142     $this->Database->insert('PermissionGroup', array('Description' => 'Členové sítě'));
    143     $PermissionGroupMembers = $this->Database->insert_id;
    144     $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupMembers, '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'));
    145146//echo($this->Database->LastQuery);
    146147    $this->Database->insert('PermissionGroup', array('Description' => 'Zástupci za domácnost'));
    147148    $PermissionGroupSubjects = $this->Database->insert_id;
    148     $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupSubjects, 'GroupOrOperation' => $PermissionGroupMembers, 'Type' => 'Group'));
     149    $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupSubjects, 'GroupOrOperation' => $PermissionGroupRegistred, 'Type' => 'Group'));
    149150$this->Database->insert('PermissionGroup', array('Description' => 'Správci sítě'));
    150151    $PermissionGroupNetworkAdmins = $this->Database->insert_id;
     
    158159    $OperationId = $this->Database->insert_id;
    159160    $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'));
    160165
    161166    $this->Database->insert('PermissionOperation', array('Module' => 'News', 'Operation' => 'Display', 'Item' => 'Item'));
     
    176181      } else
    177182      {
    178         $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationIdInsert, 'Type' => 'Operation'));
     183        $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupRegistred, 'GroupOrOperation' => $OperationIdInsert, 'Type' => 'Operation'));
    179184      }
    180185    }
     
    186191    $this->Database->insert('PermissionOperation', array('Module' => 'Share', 'Operation' => 'Display'));
    187192    $OperationId = $this->Database->insert_id;
    188     $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupMembers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation'));
     193    $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupRegistred, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation'));
    189194
    190195    $this->Database->insert('PermissionOperation', array('Module' => 'Finance', 'Operation' => 'DisplaySubjectState'));
     
    219224    $OperationId = $this->Database->insert_id;
    220225    $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'));
    221230
    222231    // Init User table from users
     
    230239      if($DbRow['role'] == 1)
    231240      {
    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']));
    233244        $UserId = $this->Database->insert_id;
    234         $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupMembers, 'Type' => 'Group'));
     245        $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupRegistred, 'Type' => 'Group'));
    235246      } else
    236247      if($DbRow['role'] == 2)
    237248      {
    238249        $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']));
    241252        $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']));
    243255        $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'));
    246258          else $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupSubjects, 'Type' => 'Group'));
    247259      }
Note: See TracChangeset for help on using the changeset viewer.