public function TfaBasicSms::__construct in TFA Basic plugins 7
Plugin constructor.
Parameters
array $context: Context of current TFA process. Must include key:
- 'uid' Account uid of user in TFA process.
May include keys:
- 'validate_context' Plugin-specific context for use during Tfa validation.
- 'setup_context' Plugin-specific context for use during TfaSetup.
Overrides TfaBasePlugin::__construct
1 call to TfaBasicSms::__construct()
- TfaBasicSmsSetup::__construct in includes/
tfa_sms.inc - Plugin constructor.
1 method overrides TfaBasicSms::__construct()
- TfaBasicSmsSetup::__construct in includes/
tfa_sms.inc - Plugin constructor.
File
- includes/
tfa_sms.inc, line 11
Class
Code
public function __construct(array $context, $mobile_number, $twilio_client) {
parent::__construct($context);
if (!empty($context['validate_context']) && !empty($context['validate_context']['code'])) {
$this->code = $context['validate_context']['code'];
}
$this->client = $twilio_client;
$this->twilioNumber = variable_get('tfa_basic_twilio_account_number', '');
$this->codeLength = 6;
$this->messageText = variable_get('tfa_basic_twilio_message_text', 'Verification code: !code');
$this->mobileNumber = $mobile_number;
if (!empty($context['mobile_number'])) {
$this->mobileNumber = $context['mobile_number'];
}
}