Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (21 months ago)
Author:
chronos
Message:
  • Fixed: Class types casting for better type checking.
  • Fixed: XML direct export.
  • Modified: User class instance moved from Core class to ModuleUser class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/Registration.php

    r888 r893  
    8686  function CheckRegistration()
    8787  {
    88     global $Config;
    89 
    9088    $Output = '';
     89    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
    9190    $ShowForm = true;
    9291
     
    114113        if (($UserName != '') and ($Pass != '') and ($Pass2 != ''))
    115114        {
    116           if (!in_array(strtolower($UserName), $Config['ForbiddedUserNames']))
     115          if (!in_array(strtolower($UserName), Core::Cast($this->System)->Config['ForbiddedUserNames']))
    117116          {
    118117            if ($Pass == $Pass2)
     
    121120              $Line = $DbResult->fetch_row();
    122121              if (!$Line)
    123               {
     122              {               
    124123                if ($Team == 0) $Team = 'NULL';
    125                 $this->System->User->Register($UserName, $Pass, $Email, $Language, $Team, $PreferredVersion);
     124                $User->Register($UserName, $Pass, $Email, $Language, $Team, $PreferredVersion);
    126125                $Output .= ShowMessage(T('Registration was successful'));
    127126                $Output .= 'Přečtěte si pozorně <a href="'.$this->System->Link('/info/').'">pokyny pro překladání</a> a můžete pak hned začít překládat.';
    128                 $this->System->User->Login($UserName, $Pass);
     127                $User->Login($UserName, $Pass);
    129128                $this->System->ModuleManager->Modules['Log']->WriteLog('Uživatel se zaregistroval: '.$UserName, LOG_TYPE_USER);
    130129                $ShowForm = false;
     
    136135                if (array_key_exists('Tag'.$UserTag['ID'], $_POST)) {
    137136                  $Query = 'SELECT * FROM `UserTag` '.
    138                   'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1);
     137                  'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($User->Id * 1);
    139138                  $DbResult2 = $this->Database->query($Query);
    140139                  if ($DbResult2->num_rows == 0) {
    141140                    $Query = 'INSERT INTO `UserTag` (`ID` ,`UserTagType`,`User` ) '.
    142                     'VALUES (NULL, '.$UserTag['ID'].' , '.($this->System->User->Id * 1).')';
     141                    'VALUES (NULL, '.$UserTag['ID'].' , '.($User->Id * 1).')';
    143142                    $DbResult2 = $this->Database->query($Query);
    144143                  }
    145144                } else {
    146145                  $Query = 'DELETE FROM `UserTag` '.
    147                   'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1);
     146                  'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($User->Id * 1);
    148147                  $DbResult2 = $this->Database->query($Query);
    149148                }
Note: See TracChangeset for help on using the changeset viewer.