Code Duplication    Length = 5-5 lines in 2 locations

include/classes/invitation.class.php 1 location

@@ 111-115 (lines=5) @@
108
      $this->setErrorMessage($this->getErrorMsg('E0026'));
109
      return false;
110
    }
111
    if (!$aData['token'] = $this->token->createToken('invitation', $account_id)) {
112
      $this->setErrorMessage($this->getErrorMsg('E0027', $this->token->getError()));
113
      return false;
114
    }
115
    $aData['username'] = $this->user->getUserName($account_id);
116
    $aData['subject'] = 'Pending Invitation';
117
    $this->log->log("info", $this->user->getUserName($account_id)." sent an invitation");
118
    if ($this->mail->sendMail('invitations/body', $aData)) {

include/classes/user.class.php 1 location

@@ 925-929 (lines=5) @@
922
      $this->setErrorMessage("Please check your mail account to finish your password reset");
923
      return false;
924
    }
925
    if (!$aData['token'] = $this->token->createToken('password_reset', $this->getUserId($username, true))) {
926
      $this->setErrorMessage('Unable to setup token for password reset');
927
      return false;
928
    }
929
    $aData['username'] = $this->getUserName($this->getUserId($username, true));
930
    $aData['subject'] = 'Password Reset Request';
931
    if ($_SERVER['REMOTE_ADDR'] !== $this->getUserIp($this->getUserId($username, true))) {
932
      $this->log->log("warn", "$username requested password reset, saved IP is [".$this->getUserIp($this->getUserId($username, true))."]");