You are here

MoAuthLicensing.php in Google Authenticator / 2 Factor Authentication - 2FA 8

Same filename and directory in other branches
  1. 8.2 src/Form/MoAuthLicensing.php

Contains support form for miniOrange 2FA Login Module.

File

src/Form/MoAuthLicensing.php
View source
<?php

/**
 * @file
 * Contains support form for miniOrange 2FA Login Module.
 */
namespace Drupal\miniorange_2fa\Form;

use Drupal\Core\Form\FormBase;

/* Showing Licensing form info. */
class MoAuthLicensing extends FormBase {
  public function getFormId() {
    return 'miniorange_2fa_licensing';
  }
  public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
    global $base_url;
    $url = $base_url . '/admin/config/people/miniorange_2fa/customer_setup';
    $user_email = \Drupal::config('miniorange_2fa.settings')
      ->get('mo_auth_customer_admin_email');
    $form['markup_library'] = array(
      '#attached' => array(
        'library' => array(
          "miniorange_2fa/miniorange_2fa.admin",
        ),
      ),
    );
    $form['header_top_style_2'] = array(
      '#markup' => '<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout"><div class="mo_otp_verification_table_layout_1"><div class="mo_otp_verification_table_layout">
                            <br><h2>&emsp; Upgrade Plans</h2><hr>',
    );
    $form['markup_free'] = array(
      '#markup' => '<html lang="en">
            <head>
                <meta charset="utf-8">
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <!-- Main Style -->
            </head>
            <body>
            <!-- Pricing Table Section -->
            <section id="pricing-table">
                <div class="container_1">
                    <div class="row">
                        <div class="pricing">
                            <div>
                                <div class="pricing-table class_inline_1">
                                    <div class="pricing-header" id="feature_list">
                                        <h2 class="pricing-title">Features / Plans</h2>
                                    </div>
                                    <div class="pricing-list">
                                        <ul>
                                            <li>All Authentication Methods**</li>
                                            <li>Remember Device</li>
                                            <li>Security Questions(KBA)(Backup)</li>
                                            <li>Enforce 2FA registration for users</li>
                                            <li>Role based 2FA</li>
                                            <li>Login with 2nd Factor only (No password required)</li>
                                            <li>IP specific 2FA (Whitelisting IP Address)</li>
                                            <li>Manage Registered Device Profiles</li>
                                            <li>Custom Redirection</li>
                                            <li>Customize Email Templates</li>
                                            <li>Customize SMS Templates</li>
                                            <li>End to End 2FA Integration***</li>
                                            <li>Support</li>
                                        </ul>
                                    </div>
                                </div>
                            <div class="pricing-table class_inline">
                                <div class="pricing-header">
                                    <p class="pricing-title">FREE<br><br><span>For 1 user Forever</span></p>
                                    <p class="pricing-rate"><sup>$</sup> 0</sup></p>
                                    <div class="filler-class"></div>

                                </div>
                                <div class="pricing-list">
                                    <ul>
                                        <li>&#x2714;</li>
                                        <li>&#x2714;</li>
                                        <li>&#x2714;</li>
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                        <li>Basic Email Support Available</li>
                                    </ul>
                                </div>
                            </div>


                        <div class="pricing-table class_inline">
                            <div class="pricing-header">
                                <p class="pricing-title">Do it yourself<br><br>
                                <span >For 1+ user</span></p>
                                <p class="pricing-rate"></p>
                                <div class="filler-class-custom-gateway"></div>
                                <a target="_blank" class="mo2f-pricing-button" href="https://login.xecurify.com/moas/login?username=' . $user_email . '&redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal8_2fa_basic_plan">Click here to upgrade</a>
                     <br /><a target="_blank" class="mo2f-pricing-button" href="https://login.xecurify.com/moas/login?username=' . $user_email . '&redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=otp_recharge_plan">Click here to buy SMS transactions</a>

                            </div>
                            <div class="pricing-list">
                                <ul>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li></li>
                                    <li>Basic Email Support Available</li>
                                </ul>
                            </div>
                        </div>
                        <div class="pricing-table class_inline">
                            <div class="pricing-header">
                               <p class="pricing-title">Premium<br><br>
                                <span>For 1+ user,Setup and Custom Work</span></p>
                                <p class="pricing-rate"></p>
                                 <div class="filler-class-mo-gateway"></div>
                                  <a target="_blank" class="mo2f-pricing-button" href="https://login.xecurify.com/moas/login?username=' . $user_email . '&redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal8_2fa_premium_plan">Click here to upgrade</a>
                <br /><a target="_blank" class="mo2f-pricing-button" href="https://login.xecurify.com/moas/login?username=' . $user_email . '&redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=otp_recharge_plan">Click here to buy SMS transactions</a>

                            </div>
                            <div class="pricing-list">
                                <ul>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>Premium Email Support Available</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Pricing Table Section End -->
    </br>
    </body>
    </html>',
    );
    $form['hello1'] = [
      '#type' => 'html_tag',
      '#tag' => 'script',
      '#attributes' => [
        "src" => "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js",
      ],
    ];
    $form['hello'] = [
      '#type' => 'html_tag',
      '#tag' => 'script',
      '#value' => $this
        ->t('
            jQuery(document).ready(function($){
                $($("p.pricing-rate")[1]).append($(".js-form-item-mo-pricing-dropdown-premium"));
                $($("p.pricing-rate")[2]).append($(".js-form-item-mo-pricing-dropdown-premium1"));
            });

        '),
    ];
    $form['mo_pricing_dropdown_premium'] = [
      '#type' => 'select',
      '#id' => 'mo_pricing_dropdown_premium',
      '#title' => t("<div class='mo_pricing_dropdown_premium'>Yearly Subscription Fees*</div>"),
      '#options' => array(
        '10' => t('Upto 5 users - $15 / year'),
        '20' => t('Upto 10 users - $30 / year'),
        '30' => t('Upto 20 users - $45 / year'),
        '40' => t('Upto 30 users - $60 / year'),
        '50' => t('Upto 40 users - $75 / year'),
        '60' => t('Upto 50 users - $90 / year'),
        '70' => t('Upto 60 users - $100 / year'),
        '80' => t('Upto 70 users - $110 / year'),
        '90' => t('Upto 80 users - $120 / year'),
        '100' => t('Upto 90 users - $130 / year'),
        '110' => t('Upto 100 users - $140 / year'),
        '120' => t('Upto 150 users - $178 / year'),
        '130' => t('Upto 200 users - $215 / year'),
        '140' => t('Upto 250 users - $245 / year'),
        '150' => t('Upto 300 users - $275 / year'),
        '160' => t('Upto 350 users - $300 / year'),
        '170' => t('Upto 400 users - $325 / year'),
        '180' => t('Upto 450 users - $348 / year'),
        '190' => t('Upto 500 users - $370 / year'),
        '200' => t('Upto 600 users - $395 / year'),
        '210' => t('Upto 700 users - $420 / year'),
        '220' => t('Upto 800 users - $445 / year'),
        '230' => t('Upto 900 users - $470 / year'),
        '240' => t('Upto 1000 users - $495 / year'),
        '250' => t('Upto 2000 users - $549 / year'),
        '260' => t('Upto 3000 users - $599 / year'),
        '270' => t('Upto 4000 users - $649 / year'),
        '290' => t('Upto 5000 users - $699 / year'),
        '300' => t('Upto 10000 users - $799 / year'),
        '310' => t('Upto 20000 users - $999 / year'),
        '320' => t('More Than 20000 users - Contact Us'),
      ),
    ];
    $form['mo_pricing_dropdown_premium1'] = [
      '#type' => 'select',
      '#id' => 'mo_pricing_dropdown_premium1',
      '#title' => t("<div class='mo_pricing_dropdown_premium1'>Yearly Subscription Fees*</div>"),
      '#options' => array(
        '10' => t('Upto 5 users - $15 / year'),
        '20' => t('Upto 10 users - $30 / year'),
        '30' => t('Upto 20 users - $45 / year'),
        '40' => t('Upto 30 users - $60 / year'),
        '50' => t('Upto 40 users - $75 / year'),
        '60' => t('Upto 50 users - $90 / year'),
        '70' => t('Upto 60 users - $100 / year'),
        '80' => t('Upto 70 users - $110 / year'),
        '90' => t('Upto 80 users - $120 / year'),
        '100' => t('Upto 90 users - $130 / year'),
        '110' => t('Upto 100 users - $140 / year'),
        '120' => t('Upto 150 users - $178 / year'),
        '130' => t('Upto 200 users - $215 / year'),
        '140' => t('Upto 250 users - $245 / year'),
        '150' => t('Upto 300 users - $275 / year'),
        '160' => t('Upto 350 users - $300 / year'),
        '170' => t('Upto 400 users - $325 / year'),
        '180' => t('Upto 450 users - $348 / year'),
        '190' => t('Upto 500 users - $370 / year'),
        '200' => t('Upto 600 users - $395 / year'),
        '210' => t('Upto 700 users - $420 / year'),
        '220' => t('Upto 800 users - $445 / year'),
        '230' => t('Upto 900 users - $470 / year'),
        '240' => t('Upto 1000 users - $495 / year'),
        '250' => t('Upto 2000 users - $549 / year'),
        '260' => t('Upto 3000 users - $599 / year'),
        '270' => t('Upto 4000 users - $649 / year'),
        '290' => t('Upto 5000 users - $699 / year'),
        '300' => t('Upto 10000 users - $799 / year'),
        '310' => t('Upto 20000 users - $999 / year'),
        '320' => t('More Than 20000 users - Contact Us'),
      ),
    ];
    $disclaimer = '<h3>Steps to upgrade to premium module -</h3>
            <p>1. You will be redirected to miniOrange Login Console. Enter your password with which you created an account with us. After that you will be redirected to payment page.</p>
            <p>2. Enter your card details and complete the payment. On successful payment completion, <a href="' . $url . '">Register/Login</a> tab and click on Check License button.</p>
            <h3>* If you dont find the number of users in the dropdown then check the price for exact number of users by clicking on "Click here to upgrade" button.</h3>
            <p>You can mail us at <a href="mailto:drupalsupport@xecurify.com"><b>drupalsupport@xecurify.com</b></a> or submit query form Contact Us form to contact us.</p>
            <h3><b>**</b> All the authentication methods given under <b>SETUP TWO-FACTOR</b> are supported after upgrading.</h3><p> We also support Hardware Token like Yubikey/yubico and Display Token. Contact us at - <a href="mailto:drupalsupport@xecurify.com"><b>drupalsupport@xecurify.com</b></a> if you want to use these authentication methods.</p>
            <h3>***End to End 2FA Integration - We will setup a Conference Call / Gotomeeting and do end to end setup for you. We provide services to do the setup on your behalf.';
    $form['header']['#markup'] = $disclaimer;
    return $form;
  }
  public function submitForm(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) {
  }

}

Classes

Namesort descending Description
MoAuthLicensing