function miniorange_email_verification_call($current_user)
 {
     $challengeMobile = new Customer_Setup();
     $email = get_user_meta($current_user->ID, 'mo_2factor_map_id_with_email', true);
     $content = $challengeMobile->send_otp_token($email, 'OUT OF BAND EMAIL', get_option('mo2f_customerKey'), get_option('mo2f_api_key'));
     $response = json_decode($content, true);
     if (json_last_error() == JSON_ERROR_NONE) {
         /* Generate out of band email */
         if ($response['status'] == 'ERROR') {
             update_option('mo2f_message', $response['message']);
             $this->mo_auth_show_error_message();
         } else {
             if ($response['status'] == 'SUCCESS') {
                 $_SESSION['mo2f_transactionId'] = $response['txId'];
                 update_option('mo2f_message', 'A verification email is sent to<b> ' . $email . '</b>. Please click on accept link to verify your email.');
                 update_user_meta($current_user->ID, 'mo2f_configure_test_option', 'MO2F_TEST');
                 update_user_meta($current_user->ID, 'mo2f_selected_2factor_method', 'OUT OF BAND EMAIL');
                 $this->mo_auth_show_success_message();
             } else {
                 unset($_SESSION['mo2f_transactionId']);
                 update_option('mo2f_message', 'An error occured while processing your request. Please Try again.');
                 $this->mo_auth_show_error_message();
             }
         }
     } else {
         update_option('mo2f_message', 'Invalid request. Please try again');
         $this->mo_auth_show_error_message();
     }
 }
 function mo2f_pass2login_mobile_verification($user)
 {
     $useragent = $_SERVER['HTTP_USER_AGENT'];
     if (strpos($useragent, 'Mobi') !== false) {
         unset($_SESSION['mo2f-login-qrCode']);
         unset($_SESSION['mo2f-login-transactionId']);
         $_SESSION['mo2f-login-message'] = 'Please enter the one time passcode shown in the miniOrange Authenticator app.';
         $_SESSION['mo_2factor_login_status'] = 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN';
     } else {
         $challengeMobile = new Customer_Setup();
         $content = $challengeMobile->send_otp_token(get_user_meta($user->ID, 'mo_2factor_map_id_with_email', true), 'MOBILE AUTHENTICATION', get_option('mo2f_customerKey'), get_option('mo2f_api_key'));
         $response = json_decode($content, true);
         if (json_last_error() == JSON_ERROR_NONE) {
             /* Generate Qr code */
             if ($response['status'] == 'SUCCESS') {
                 $_SESSION['mo2f-login-qrCode'] = $response['qrCode'];
                 $_SESSION['mo2f-login-transactionId'] = $response['txId'];
                 $_SESSION['mo_2factor_login_status'] = 'MO_2_FACTOR_CHALLENGE_MOBILE_AUTHENTICATION';
             } else {
                 if ($response['status'] == 'ERROR') {
                     $this->remove_current_activity();
                     $error = new WP_Error();
                     $error->add('empty_username', __('<strong>ERROR</strong>: An error occured while processing your request. Please Try again.'));
                     return $error;
                 }
             }
         } else {
             $this->remove_current_activity();
             $error = new WP_Error();
             $error->add('empty_username', __('<strong>ERROR</strong>: An error occured while processing your request. Please Try again.'));
             return $error;
         }
     }
 }