You are here

class MiniorangeLicensing in OAuth2 Login 8

Hierarchy

Expanded class hierarchy of MiniorangeLicensing

1 string reference to 'MiniorangeLicensing'
oauth2_login.routing.yml in ./oauth2_login.routing.yml
oauth2_login.routing.yml

File

src/Form/MiniorangeLicensing.php, line 17
Contains Licensing information for miniOrange OAuth Login Module.

Namespace

Drupal\oauth2_login\Form
View source
class MiniorangeLicensing extends FormBase {
  public function getFormId() {
    return 'miniorange_oauth_client_licensing';
  }
  public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
    global $base_url;
    $moTour = mo_saml_visualTour::genArray();
    $form['tourArray'] = array(
      '#type' => 'hidden',
      '#value' => $moTour,
    );
    $form['markup_library'] = array(
      '#attached' => array(
        'library' => array(
          "oauth2_login/oauth2_login.admin",
          "oauth2_login/oauth2_login.style_settings",
          "oauth2_login/oauth2_login.Vtour",
        ),
      ),
    );
    if (!Utilities::isCustomerRegistered()) {
      $username = \Drupal::config('oauth2_login.settings')
        ->get('miniorange_oauth_client_customer_admin_email');
      $URL_Redirect_std = "https://login.xecurify.com/moas/login?username=" . $username . "&redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal8_oauth_client_standard_plan";
      $URL_Redirect_pre = "https://login.xecurify.com/moas/login?username=" . $username . "&redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal8_oauth_client_premium_plan";
      $URL_Redirect_ent = "https://login.xecurify.com/moas/login?username=" . $username . "&redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal8_oauth_client_enterprise_plan";
      $targetBlank = 'target="_blank"';
    }
    else {
      $URL_Redirect_std = $base_url . '/admin/config/people/oauth2_login/customer_setup';
      $URL_Redirect_pre = $base_url . '/admin/config/people/oauth2_login/customer_setup';
      $URL_Redirect_ent = $base_url . '/admin/config/people/oauth2_login/customer_setup';
      $targetBlank = '';
    }
    $form['header_top_style_2'] = array(
      '#markup' => '<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout">',
    );
    $form['markup_1'] = array(
      '#markup' => '<br><h3>&nbsp; UPGRADE PLANS <a id="Restart_moTour" class="mo_oauth_btn mo_oauth_btn_restart_tour mo_oauth_btn-primary-color mo_oauth_btn-large">Take a Tour</a></h3><hr><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="mo_oauth_pricing-table">
            <div class="mo_oauth_container_1">
                <div class="mo_oauth_row">
                    <div class="mo_oauth_pricing">
                        <div>
                            <div class="mo_oauth_pricing-table mo_oauth_class_inline_1">
                                <div class="mo_oauth_pricing-header">
                                    <h2 class="mo_oauth_pricing-title">Features / Plans</h2>
                                </div>
                                <div class="mo_oauth_pricing-list">
                                    <ul>
                                        <li>OAuth Provider Support</li>
                                        <li>Autofill OAuth servers configuration</li>
                                        <li>Basic Attribute Mapping (Email, Username)</li>
                                        <li>Export Configuration</li>
                                        <li>Auto Create Users</li>
                                        <li>Import Configuration</li>
                                        <li>Advanced Attribute Mapping (Username, Email, First Name, Custom Attributes, etc.)	</li>
                                        <li>Custom Redirect URL after login and logout</li>
                                        <li>Basic Role Mapping (Support for default role for new users)</li>
                                        <li>Advanced Role Mapping</li>
                                        <li>Force authentication / Protect complete site</li>
                                        <li>OpenId Connect Support (Login using OpenId Connect Server)</li>
                                        <li>Domain specific registration</li>
                                        <li>Dynamic Callback URL</li>
                                        <li>Page Restriction</li>
                                        <li>Login Reports / Analytics</li>
                                    </ul>
                                </div>
                            </div>
                            <div class="mo_oauth_pricing-table mo_oauth_class_inline">
                                <div class="mo_oauth_pricing-header">
                                <p class="mo_oauth_pricing-title">Free</p>
                                <p class="mo_oauth_pricing-rate"><sup>$</sup> 0</p>
                                <div class="filler-class"></div>
                                    <a class="mo_oauth_btn mo_oauth_btn-primary">You are on this plan</a>
                                </div>
                            <div class="mo_oauth_pricing-list">
                                <ul>
                                <li>1</li>
                                <li>&#x2714;</li>
                                <li>&#x2714;</li>
                                <li>&#x2714;</li>
                                <li>Upto 5 users </li>
                                <li> </li>
                                <li> </li>
                                <li> </li>
                                <li> </li>
                                <li> </li>
                                <li> </li>
                                <li> </li>
                                <li> </li>
                                <li></li>
                                <li></li>
                                <li> </li>
                                </ul>
                            </div>
                        </div>

                        <div class="mo_oauth_pricing-table mo_oauth_class_inline">
                            <div class="mo_oauth_pricing-header">
                                <p class="mo_oauth_pricing-title">Standard<br><span>(Role & Attribute Mapping)<br>[One Time Payment]</span></p>
                                <p class="mo_oauth_pricing-rate"><sup>$</sup> 249</p>
                                <div class="filler-class"></div>
                                 <a href="' . $URL_Redirect_std . '" ' . $targetBlank . ' class="mo_oauth_btn mo_oauth_btn-primary">Click to Upgrade</a>
                        </div>

                        <div class="mo_oauth_pricing-list">
                            <ul>
                            <li>1</li>
                            <li>&#x2714;</li>
                            <li>&#x2714;</li>
                            <li>&#x2714;</li>
                            <li>Unlimited</li>
                            <li>&#x2714;</li>
                            <li>&#x2714;</li>
                            <li>&#x2714;</li>
                            <li>&#x2714;</li>
                            <li></li>
                            <li></li>
                            <li></li>
                            <li></li>
                            <li></li>
                            <li></li>
                            <li></li>
                            </ul>
                        </div>
                        </div>

                        <div class="mo_oauth_pricing-table mo_oauth_class_inline">
                            <div class="mo_oauth_pricing-header">
                                <p class="mo_oauth_pricing-title">Premium<br><span>(OpenID support)<br>[One Time Payment]</span></p>
                                <p class="mo_oauth_pricing-rate"><sup>$</sup> 399</p>
                                 <a href="' . $URL_Redirect_pre . '" ' . $targetBlank . ' class="mo_oauth_btn mo_oauth_btn-primary">Click to Upgrade</a>
                            </div>

                            <div class="mo_oauth_pricing-list">
                                <ul>
                                    <li>1</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>Unlimited</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></li>
                                    <li></li>
                                    <li></li>

                                </ul>
                            </div>
                        </div>
                        <div class="mo_oauth_pricing-table mo_oauth_class_inline">
                            <div class="mo_oauth_pricing-header">
                                <p class="mo_oauth_pricing-title">Enterprise<br><span>(Domain & Page Restriction)<br>[One Time Payment]</span></p>
                                <p class="mo_oauth_pricing-rate"><sup>$</sup> 449<sup></sup></p>
                                 <a href="' . $URL_Redirect_ent . '" ' . $targetBlank . ' class="mo_oauth_btn mo_oauth_btn-primary">Click to upgrade</a>
                            </div>

                            <div class="mo_oauth_pricing-list">
                                <ul>
                                    <li>1*</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>&#x2714;</li>
                                    <li>Unlimited</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>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Pricing Table Section End -->
     </body>
    </html>',
    );
    $form['markup_5'] = array(
      '#markup' => '<h3>Steps to Upgrade to Premium Module</h3>' . '<ol><li>After clicking on <b>Click to Upgrade</b> button, 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.</li>' . '<li>Enter your card details and complete the payment. On successful payment completion, you will see the ' . 'link to download the premium module.</li>' . '<li>Once you download the premium module, just unzip it and replace the folder with existing module. Clear Drupal Cache from <a href= "' . $base_url . '/admin/config/development/performance" target="_blank">here</a>.</li></ol>',
    );
    $form['markup_7'] = array(
      '#markup' => '<p>* Multiple OAuth providers are supported using Xecurify Broker service. For more information contact us at using the <b>Support </b> button or by dropping us an email at <a href="mailto:drupalsupport@xecurify.com">drupalsupport@xecurify.com</a></p><br>
        <b>10 Days Return Policy - </b><br><br>
        At miniOrange, we want to ensure you are 100% happy with your purchase. If the premium module you purchased is not working as advertised and you have attempted to resolve any issues with our support team, which could not get resolved. We will refund the whole amount within 10 days of the purchase. Please email us at <a href="mailto:drupalsupport@xecurify.com">drupalsupport@xecurify.com</a> for any queries regarding the return policy.',
    );
    Utilities::AddrfdButton($form, $form_state);
    return $form;
  }
  public function submitForm(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) {
  }
  public function send_rfd_query(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) {
    $email = trim($form['customer_email']['#value']);
    $demo_plan = $form['demo_plan']['#value'];
    $description_doubt = trim($form['description_doubt']['#value']);
    $query = $demo_plan . ' -> ' . $description_doubt;
    Utilities::send_demo_query($email, $query, $description_doubt);
  }

}

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.
MiniorangeLicensing::buildForm public function Form constructor. Overrides FormInterface::buildForm
MiniorangeLicensing::getFormId public function Returns a unique string identifying the form. Overrides FormInterface::getFormId
MiniorangeLicensing::send_rfd_query public function
MiniorangeLicensing::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.