Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (14 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/Profile.php

    r892 r893  
    55  function SendMail()
    66  {
     7    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
    78    $Output = '';
    89    if (array_key_exists('text', $_POST))
    9     if ($this->System->User->Licence(LICENCE_ADMIN))
     10    if ($User->Licence(LICENCE_ADMIN))
    1011    {
    1112      $Text = $_POST['text'];
     
    1617        'Text: <strong>'.$Text.'</strong><br />';
    1718
    18       if (@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].
    19         '\nReply-To: '.$this->System->Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
     19      if (@mail($Email, $Subject, $Text, 'From: '.Core::Cast($this->System)->Config['Web']['AdminEmail'].
     20        '\nReply-To: '.Core::Cast($this->System)->Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
    2021      {
    2122        $Output .= ShowMessage(T('Message was sent'));
     
    2930  {
    3031    $Output = '';
     32    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
    3133    $Filter = ' WHERE `Export`.`User` = '.($_GET['user'] * 1);
    3234    $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` '.$Filter);
     
    6163      $Action = '<a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=0').'">'.T('Show').'</a> '.
    6264        '<a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=7').'">'.T('Export').'</a>';
    63       if ($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Really remove item?').'\');">'.T('Remove').'</a>';
    64       if ($this->System->User->Id != null) $Action .= ' <a href="'.$this->System->Link('/export/?Action=Clone&amp;ExportId='.$Export['Id']).'" onclick="return confirmAction(\''.T('Really clone item?').'\');">'.T('Clone').'</a>';
     65      if ($Export['User'] == $User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Really remove item?').'\');">'.T('Remove').'</a>';
     66      if ($User->Id != null) $Action .= ' <a href="'.$this->System->Link('/export/?Action=Clone&amp;ExportId='.$Export['Id']).'" onclick="return confirmAction(\''.T('Really clone item?').'\');">'.T('Clone').'</a>';
    6567      $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'.
    6668        '<td>'.htmlspecialchars($Export['Title']).'</td>'.
     
    9597          $DbRow['TablePrefix'].'` AS `T` '.
    9698          'WHERE (`T`.`Complete` = 1) AND '.
    97           '(`T`.`Language` != '.$this->System->Config['OriginalLanguage'].') AND '.
     99          '(`T`.`Language` != '.Core::Cast($this->System)->Config['OriginalLanguage'].') AND '.
    98100          '(`T`.`User` = '.($_GET['user'] * 1).') ORDER BY `T`.`ModifyTime` DESC LIMIT '.
    99101          $Count.') AS `T`';
     
    139141  {
    140142    $Output = '';
     143    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
    141144    $Query = 'SELECT `User`.`Name`, `UserTrace`.`LastLogin`, `UserTrace`.`LastIP`, '.
    142145      '`User`.`Email`, `UserTrace`.`UserAgent`, `User`.`PreferredVersion`, '.
     
    190193        '</tr></table>';
    191194      $Output .= '<br />'.$this->ShowLastForum().'<br />';
    192       if ($this->System->User->Licence(LICENCE_MODERATOR))
     195      if ($User->Licence(LICENCE_MODERATOR))
    193196      {
    194197        $Output .= '<fieldset><legend>Moderování</legend>';
     
    239242          '<input type="text" name="email" value="'.$UserLine['Email'].'" /><br/>'.
    240243          'Předmět:'.
    241           '<input type="text" name="subject" value="'.$this->System->Config['Web']['Title'].'" />'.
     244          '<input type="text" name="subject" value="'.Core::Cast($this->System)->Config['Web']['Title'].'" />'.
    242245          '<br />'.
    243246          '<textarea name="text" rows="20" cols="62">'.
    244247          ''."\n".
    245           'S pozdravem '.$this->System->User->Name."\n".
     248          'S pozdravem '.$User->Name."\n".
    246249          '--------------------------------------------------------'."\n".
    247           $this->System->Config['Web']['Title'].' '.$this->System->Config['Web']['Host'].$this->System->Link('/')."\n".
     250          Core::Cast($this->System)->Config['Web']['Title'].' '.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/')."\n".
    248251          '</textarea><br/>'.
    249252          '<input type="submit" value="Odeslat" />'.
Note: See TracChangeset for help on using the changeset viewer.