Changeset 693


Ignore:
Timestamp:
Sep 14, 2014, 8:26:20 PM (10 years ago)
Author:
chronos
Message:
  • Modified: PhoneNumber converted from User table columnt to generic Contacts table.
  • Fixed: Removed ICQ and PhoneNumber fields from user registration.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r692 r693  
    22
    33$Revision = 692; // Subversion revision
    4 $DatabaseRevision = 688; // SQL structure revision
    5 $ReleaseTime = strtotime('2014-09-11');
     4$DatabaseRevision = 692; // SQL structure revision
     5$ReleaseTime = strtotime('2014-09-14');
  • trunk/Common/Setup/Updates.php

    r689 r693  
    899899}
    900900
     901function UpdateTo692($Manager)
     902{
     903  // Convert user emails to contacts
     904  $DbResult = $Manager->Execute('SELECT `Id` FROM `ContactCategory` WHERE `Name` = "Telefón"');
     905  $DbRow = $DbResult->fetch_assoc();
     906  $ContactCategoryId = $DbRow['Id'];
     907
     908  $Manager->Execute('INSERT INTO `Contact` (SELECT NULL AS `Id`, '.$ContactCategoryId.' AS `Category`, '.
     909  '`PhoneNumber` AS `Value`, NULL AS `Subject`, `Id` AS `User`, "" AS `Descriptions`, 1 AS `Receive` FROM `User`
     910WHERE (`PhoneNumber` != "") AND (`PhoneNumber` != 0))');
     911  $Manager->Execute('ALTER TABLE `User` DROP `PhoneNumber`;');
     912}
     913
    901914class Updates
    902915{
     
    948961      678 => array('Revision' => 679, 'Function' => 'UpdateTo679'),
    949962      679 => array('Revision' => 688, 'Function' => 'UpdateTo688'),
     963      688 => array('Revision' => 692, 'Function' => 'UpdateTo692'),
    950964    ));
    951965  }
  • trunk/Common/VCL/General.php

    r666 r693  
    11<?php
    22
    3 session_start();
    43
    54//print_r($_SESSION);
  • trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php

    r685 r693  
    5656      $this->Write('/login');
    5757      $Response = $this->Read(false);
    58       if ((count($Response) > 0) and ($Response[0] == '!done')) {
     58      if ((count($Response) > 1) and ($Response[0] == '!done')) {
    5959        if (preg_match_all('/[^=]+/i', $Response[1], $Matches)) {
    6060          if ($Matches[0][0] == 'ret' && strlen($Matches[0][1]) == 32) {
  • trunk/Modules/User/User.php

    r668 r693  
    127127  }
    128128
    129   function Register($Login, $Password, $Password2, $Email, $Name, $PhoneNumber, $ICQ)
     129  function Register($Login, $Password, $Password2, $Email, $Name)
    130130  {
    131131    if(($Email == '') || ($Login == '') || ($Password == '') || ($Password2 == '')  || ($Name == '')) $Result = DATA_MISSING;
     
    151151              'Password' => $PasswordHash->Hash($Password, $Salt), 'Salt' => $Salt,
    152152              'Email' => $Email, 'RegistrationTime' => 'NOW()',
    153               'Locked' => 1, 'PhoneNumber' => $PhoneNumber, 'ICQ' => $ICQ));
     153              'Locked' => 1));
    154154            $UserId = $this->Database->insert_id;
    155155            $this->Database->insert('PermissionUserAssignment', array('User' => $UserId,
     
    460460  `RegistrationTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    461461  `Locked` tinyint(1) NOT NULL DEFAULT '0',
    462   `ICQ` int(11) NOT NULL DEFAULT '0',
    463   `PhoneNumber` varchar(32) NOT NULL DEFAULT '',
    464462  `InitPassword` varchar(255) NOT NULL,
    465463  PRIMARY KEY (`Id`),
     
    571569        'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''),
    572570        'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
    573         'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''),
    574571      ),
    575572    ));
     
    584581        'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''),
    585582        'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
    586         'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''),
    587         'ICQ' => array('Type' => 'String', 'Caption' => 'ICQ', 'Default' => ''),
    588583      ),
    589584    ));
     
    619614        'RegistrationTime' => array('Type' => 'DateTime', 'Caption' => 'Čas registrace', 'Default' => ''),
    620615        'Locked' => array('Type' => 'Boolean', 'Caption' => 'Uzamčen', 'Default' => ''),
    621         'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefon', 'Default' => ''),
    622616        'UserRel' => array('Type' => 'TUserCustomerRelListUser', 'Caption' => 'Přístup k zákazníkům', 'Default' => ''),
    623617        'Permission' => array('Type' => 'TPermissionUserAssignmentListUser', 'Caption' => 'Oprávnění', 'Default' => ''),
  • trunk/Modules/User/UserList.php

    r672 r693  
    1919      array('Name' => 'Name', 'Title' => 'Jméno'),
    2020      array('Name' => 'Email', 'Title' => 'E-mail'),
    21       array('Name' => 'PhoneNumber', 'Title' => 'Telefón'),
    2221      array('Name' => '', 'Title' => 'Počítače'),
    2322    );
     
    3029    while($User = $DbResult->fetch_assoc())
    3130    {
    32       if($User['PhoneNumber'] > 0) $User['PhoneNumber'] = $User['PhoneNumber'];
    33         else $User['PhoneNumber'] = '&nbsp;';
    34 
    3531      $Devices = array();
    3632      $DbResult2 = $this->Database->query('SELECT `Id` FROM `Member` WHERE `Member`.`ResponsibleUser` = '.$User['Id']);
     
    4844      $Output .= '<tr><td>'.$User['Name'].'</td>'.
    4945      '<td>'.$User['Email'].'</td>'.
    50       '<td>'.$User['PhoneNumber'].'</td>'.
    5146      '<td>'.$User['Devices'].'</td></tr>';
    5247    }
  • trunk/Modules/User/UserPage.php

    r634 r693  
    99  function Panel($Title, $Content, $Menu = array())
    1010  {
    11     if(count($Menu) > 0) 
     11    if(count($Menu) > 0)
    1212      foreach($Menu as $Item)
    1313        $Title .= '<div class="Action">'.$Item.'</div>';
     
    1919    $Output = '';
    2020    if($this->System->User->User['Id'] != null)
    21     { 
     21    {
    2222        $Actions = '';
    2323        foreach($this->System->ModuleManager->Modules['User']->UserPanel as $Action)
     
    3232      $Output .= $this->Panel('Nabídka uživatele', $Actions);
    3333      $Output .= '</td><td>';
     34      if($this->System->User->User['Id'] != null)
     35        {
     36          $Form = new Form($this->System->FormManager);
     37          $Form->SetClass('UserOptions');
     38          $Form->LoadValuesFromDatabase($this->System->User->User['Id']);
     39          $Form->OnSubmit = '?Action=UserOptionsSave';
     40          $Output .= $Form->ShowViewForm();
     41        } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen');
     42
    3443      //$Output .= $this->Panel('Přehled', $this->UserPanel());
    3544      $Output .= '</td></tr></table></div>';
     
    6170          $Form->OnSubmit = '?Action=Login';
    6271          if(array_key_exists('StayLogged', $_POST) and ($_POST['StayLogged'] == 'on')) $StayLogged = true;
    63             else $StayLogged = false;         
     72            else $StayLogged = false;
    6473          $Result = $this->System->User->Login($_POST['Username'], $_POST['Password'], $StayLogged);
    6574          $Output .= $this->SystemMessage('Přihlášení', $Result);
     
    7786          }
    7887        } else $Output .= $this->SystemMessage('Přihlášení', 'Nezadány přihlašovací údaje');
    79       } else 
     88      } else
    8089      if($Action == 'Logout')
    8190      {
     
    8695      } else
    8796      if($Action == 'UserOptions')
    88       { 
     97      {
    8998        if($this->System->User->User['Id'] != null)
    9099        {
     
    118127      if($Action == 'UserRegisterConfirm')
    119128      {
    120         $Output .= $this->SystemMessage('Potvrzení registrace', 
     129        $Output .= $this->SystemMessage('Potvrzení registrace',
    121130          $this->System->User->RegisterConfirm($_GET['User'], $_GET['H']));
    122131      } else
     
    138147        {
    139148          $Output .= $Form->ShowEditForm();
    140         }       
     149        }
    141150      } else
    142151      if($Action == 'PasswordRecoveryConfirm')
     
    149158        $Form->SetClass('UserRegister');
    150159        $Form->LoadValuesFromForm();
    151         $Result = $this->System->User->Register($Form->Values['Login'], $Form->Values['Password'], 
    152           $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);
     160        $Result = $this->System->User->Register($Form->Values['Login'], $Form->Values['Password'],
     161          $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']);
    153162        $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
    154         if($Result <> USER_REGISTRATED) 
     163        if($Result <> USER_REGISTRATED)
    155164        {
    156165          $Form->OnSubmit = '?Action=UserRegisterSave';
    157166          $Output .= $Form->ShowEditForm();
    158167        }
    159       } else     
     168      } else
    160169      if($Action == 'UserMenu')
    161170      {
     
    163172      } else $Output = $this->ShowMain();
    164173    } else $Output = $this->ShowMain();
    165     return($Output);           
     174    return($Output);
    166175        }
    167        
     176
    168177        function ShowMain()
    169178        {
Note: See TracChangeset for help on using the changeset viewer.