/** * Deletes the records that is referenced by the auth code from * the database * * @param array|\Tx\Authcode\Domain\Model\AuthCode $authCodeData * @param bool $markAsDeleted * @deprecated Since 0.7.0, will be removed in version 1.0.0, use AuthCodeRecordRepository instead. * @see \Tx\Authcode\Domain\Repository\AuthCodeRecordRepository::removeAssociatedRecord() */ public function removeAuthCodeRecordFromDB($authCodeData, $markAsDeleted = FALSE) { if (is_array($authCodeData)) { $authCode = $this->authCodeRepository->findByUid($authCodeData['uid']); } elseif ($authCodeData instanceof \Tx\Authcode\Domain\Model\AuthCode) { $authCode = $authCodeData; } else { throw new \InvalidArgumentException('$authCodeData must either be an array or an instance of \\Tx\\Authcode\\Domain\\Model\\AuthCode'); } $this->authCodeRecordRepository->removeAssociatedRecord($authCode, !$markAsDeleted); }
/** * Checks, if a valid auth code was submitted and deletes the referenced record * from the database * * @return array the GET/POST data array */ public function process() { $submittedAuthCode = $this->utils->getAuthCode(); if (empty($submittedAuthCode)) { $this->utilityFuncs->throwException('validateauthcode_insufficient_params'); } $authCode = $this->utils->getAuthCodeDataFromDB($submittedAuthCode); if (!isset($authCode)) { $this->utilityFuncs->throwException('validateauthcode_no_record_found'); } $forceDeletion = TRUE; if (intval($this->settings['markAsDeleted'])) { $forceDeletion = FALSE; } $this->authCodeRecordRepository->removeAssociatedRecord($authCode, $forceDeletion); $this->authCodeRepository->clearAssociatedAuthCodes($authCode); $this->utils->clearAuthCodeFromSession(); $this->gp = $this->utils->clearAuthCodeFromGP($this->gp); return $this->gp; }