You are here

public function TfaBasicSms::ready in TFA Basic plugins 7

Determine if the plugin can run for the current TFA context.

Return value

bool Whether the plugin can run.

Overrides TfaBasePlugin::ready

File

includes/tfa_sms.inc, line 168

Class

TfaBasicSms

Code

public function ready() {

  // We can only send a code if there is a phone number.
  if (!empty($this->mobileNumber)) {

    // We should only send codes if TFA is enabled for this account.
    $user_data = tfa_basic_get_tfa_data(user_load($this->context['uid']));
    if (!empty($user_data['status'])) {
      return TRUE;
    }
  }
  return FALSE;
}