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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.