Ignore:
Timestamp:
Apr 14, 2020, 11:06:28 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Check existence of Log module.
File:
1 edited

Legend:

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

    r5 r6  
    119119    {
    120120      $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']);
    121       if($DbRow['User'] != null) $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout');
     121      if(($DbRow['User'] != null) and $this->System->ModuleManager->ModulePresent('Log'))
     122        $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout');
    122123    }
    123124    //$this->LoadPermission($this->User['Role']);
     
    174175
    175176            $Result = USER_REGISTRATED;
    176             if(array_key_exists('Log', $this->System->ModuleManager->Modules))
     177            if($this->System->ModuleManager->ModulePresent('Log'))
    177178              $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'NewRegistration', $Login);
    178179          }
     
    194195        $this->Database->update('User', 'Id='.$Row['Id'], array('Locked' => 0));
    195196        $Output = USER_REGISTRATION_CONFIRMED;
    196         $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'Login='.
    197           $Row['Login'].', Id='.$Row['Id']);
     197        if($this->System->ModuleManager->ModulePresent('Log'))
     198          $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'Login='.
     199            $Row['Login'].', Id='.$Row['Id']);
    198200      } else $Output = PASSWORDS_UNMATCHED;
    199201    } else $Output = USER_NOT_FOUND;
     
    242244    $SID = session_id();
    243245    $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => null));
    244     if(array_key_exists('Log', $this->System->ModuleManager->Modules))
     246    if($this->System->ModuleManager->ModulePresent('Log'))
    245247      $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout', $this->User['Login']);
    246248    $this->Check();
     
    397399
    398400      $Output = USER_PASSWORD_RECOVERY_SUCCESS;
    399       $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email);
     401      if($this->System->ModuleManager->ModulePresent('Log'))
     402        $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email);
    400403    } else $Output = USER_PASSWORD_RECOVERY_FAIL;
    401404    return($Output);
     
    415418        $this->Database->update('User', 'Id='.$Row['Id'], array('Password' => $PasswordHash->Hash($NewPassword, $Salt),
    416419          'Salt' => $Salt, 'Locked' => 0));
    417         $Output = USER_PASSWORD_RECOVERY_CONFIRMED;
    418         $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Login='.$Row['Login']);
     420        if($this->System->ModuleManager->ModulePresent('Log'))
     421          $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Login='.$Row['Login']);
    419422      } else $Output = PASSWORDS_UNMATCHED;
    420423    } else $Output = USER_NOT_FOUND;
Note: See TracChangeset for help on using the changeset viewer.