You are here

class MoAuthLicensing in Google Authenticator / 2 Factor Authentication - 2FA 8

Same name and namespace in other branches
  1. 8.2 src/Form/MoAuthLicensing.php \Drupal\miniorange_2fa\Form\MoAuthLicensing

Hierarchy

Expanded class hierarchy of MoAuthLicensing

1 string reference to 'MoAuthLicensing'
miniorange_2fa.routing.yml in ./miniorange_2fa.routing.yml
miniorange_2fa.routing.yml

File

src/Form/MoAuthLicensing.php, line 13
Contains support form for miniOrange 2FA Login Module.

Namespace

Drupal\miniorange_2fa\Form
View source
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) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
FormBase::$configFactory protected property The config factory. 1
FormBase::$requestStack protected property The request stack. 1
FormBase::$routeMatch protected property The route match.
FormBase::config protected function Retrieves a configuration object.
FormBase::configFactory protected function Gets the config factory for this form. 1
FormBase::container private function Returns the service container.
FormBase::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create 87
FormBase::currentUser protected function Gets the current user.
FormBase::getRequest protected function Gets the request object.
FormBase::getRouteMatch protected function Gets the route match.
FormBase::logger protected function Gets the logger for a specific channel.
FormBase::redirect protected function Returns a redirect response object for the specified route. Overrides UrlGeneratorTrait::redirect
FormBase::resetConfigFactory public function Resets the configuration factory.
FormBase::setConfigFactory public function Sets the config factory for this form.
FormBase::setRequestStack public function Sets the request stack object to use.
FormBase::validateForm public function Form validation handler. Overrides FormInterface::validateForm 62
LinkGeneratorTrait::$linkGenerator protected property The link generator. 1
LinkGeneratorTrait::getLinkGenerator Deprecated protected function Returns the link generator.
LinkGeneratorTrait::l Deprecated protected function Renders a link to a route given a route name and its parameters.
LinkGeneratorTrait::setLinkGenerator Deprecated public function Sets the link generator service.
LoggerChannelTrait::$loggerFactory protected property The logger channel factory service.
LoggerChannelTrait::getLogger protected function Gets the logger for a specific channel.
LoggerChannelTrait::setLoggerFactory public function Injects the logger channel factory.
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
MoAuthLicensing::buildForm public function Form constructor. Overrides FormInterface::buildForm
MoAuthLicensing::getFormId public function Returns a unique string identifying the form. Overrides FormInterface::getFormId
MoAuthLicensing::submitForm public function Form submission handler. Overrides FormInterface::submitForm
RedirectDestinationTrait::$redirectDestination protected property The redirect destination service. 1
RedirectDestinationTrait::getDestinationArray protected function Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
RedirectDestinationTrait::getRedirectDestination protected function Returns the redirect destination service.
RedirectDestinationTrait::setRedirectDestination public function Sets the redirect destination service.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
UrlGeneratorTrait::$urlGenerator protected property The url generator.
UrlGeneratorTrait::getUrlGenerator Deprecated protected function Returns the URL generator service.
UrlGeneratorTrait::setUrlGenerator Deprecated public function Sets the URL generator service.
UrlGeneratorTrait::url Deprecated protected function Generates a URL or path for a specific route based on the given parameters.