You are here

public function TfaBasicRecoveryCode::finalize in TFA Basic plugins 7

@copydoc TfaBasePlugin::finalize()

File

includes/tfa_recovery.inc, line 63
class for TFA Basic

Class

TfaBasicRecoveryCode
Class TfaBasicRecoveryCode

Code

public function finalize() {

  // Mark code as used.
  if ($this->usedCode) {
    $num = db_update('tfa_recovery_code')
      ->fields(array(
      'used' => REQUEST_TIME,
    ))
      ->condition('id', $this->usedCode)
      ->condition('uid', $this->context['uid'])
      ->execute();
    if ($num) {
      watchdog('tfa_basic', 'Used TFA recovery code !id by user !uid', array(
        '!id' => $this->usedCode,
        '!uid' => $this->context['uid'],
      ), WATCHDOG_NOTICE);
    }
  }
}