You are here

public static function Utilities::saml_resend_otp in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7

2 calls to Utilities::saml_resend_otp()
miniorange_saml_registration in ./miniorange_saml_registration.php
miniorange_saml_resend_otp in ./miniorange_saml_customer_setup.inc
Resend OTP.

File

includes/Utilities.php, line 469

Class

Utilities
This file is part of miniOrange SAML plugin.

Code

public static function saml_resend_otp($called_from_popup = false) {
  variable_del('miniorange_saml_tx_id');
  $username = variable_get('miniorange_saml_customer_admin_email', NULL);
  $phone = variable_get('miniorange_saml_customer_admin_phone', NULL);
  $customer_config = new MiniorangeSAMLCustomer($username, $phone, NULL, NULL);
  $send_otp_response = json_decode($customer_config
    ->sendOtp());
  if ($send_otp_response->status == 'SUCCESS') {

    // Store txID.
    variable_set('miniorange_saml_tx_id', $send_otp_response->txId);
    variable_set('miniorange_saml_status', 'VALIDATE_OTP');
    if ($called_from_popup == true) {
      miniorange_otp(false, true, false);
    }
    else {
      drupal_set_message(t('Verify email address by entering the passcode sent to @username', array(
        '@username' => $username,
      )));
    }
  }
  else {
    if ($called_from_popup == true) {
      miniorange_otp(false, false, true);
    }
    else {
      drupal_set_message(t('An error has been occured. Please try after some time or contact us at <a href="mailto:drupalsupport@xecurify.com">drupalsupport@xecurify.com</a>.'), 'error');
    }
  }
}