You are here

class MiniorangeSignonSettings in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

Hierarchy

Expanded class hierarchy of MiniorangeSignonSettings

1 string reference to 'MiniorangeSignonSettings'
miniorange_saml.routing.yml in ./miniorange_saml.routing.yml
miniorange_saml.routing.yml

File

src/Form/MiniorangeSignonSettings.php, line 17
Contains Login Settings for miniOrange SAML Login Module.

Namespace

Drupal\miniorange_saml\Form
View source
class MiniorangeSignonSettings extends FormBase {
  public function getFormId() {
    return 'miniorange_saml_login_setting';
  }
  public function buildForm(array $form, FormStateInterface $form_state) {
    global $base_url;
    $form['miniorange_saml_markup_library'] = array(
      '#attached' => array(
        'library' => array(
          'miniorange_saml/miniorange_saml.admin',
        ),
      ),
    );
    $form['markup_start'] = array(
      '#markup' => t('<div class="mo_saml_sp_table_layout_1"><div id="signon_settings_tab" class="mo_saml_table_layout mo_saml_sp_container">'),
    );

    /**
     * Create container to hold @SigninSettings form elements.
     */
    $form['mo_saml_singnin_settings'] = array(
      '#type' => 'fieldset',
      //'#title' => t('Signin Settings'),
      '#attributes' => array(
        'style' => 'padding:2% 2% 5%; margin-bottom:2%',
      ),
      '#prefix' => '<div class="mo_saml_font_for_heading_none_float">SIGNIN SETTINGS</div><hr>',
    );
    $form['mo_saml_singnin_settings']['markup_top'] = array(
      '#markup' => t('<div class="mo_saml_highlight_background_note_1"><b>Note:</b> All the features are available in <a href="' . $base_url . MiniorangeSAMLConstants::LICENSING_TAB_URL . '">Standard, Premium and Enterprise</a> versions of the module</div><br>'),
    );
    $form['mo_saml_singnin_settings']['miniorange_saml_disable_autocreate_users'] = array(
      '#type' => 'checkbox',
      '#title' => t('Check this option if you want to disable <b>auto creation</b> of users if user does not exist.'),
      '#disabled' => TRUE,
      '#description' => t('<b>Note: </b>If you enable this feature new user wont be created, only existing users can login using SSO.<br><br>'),
    );
    $form['mo_saml_singnin_settings']['miniorange_saml_force_auth'] = array(
      '#type' => 'checkbox',
      '#title' => t('Protect website against anonymous access'),
      '#description' => t('<b>Note: </b>Users will be redirected to your IdP for login in case user is not logged in and tries to access website.<br><br>'),
      '#disabled' => TRUE,
    );
    $form['mo_saml_singnin_settings']['miniorange_saml_auto_redirect'] = array(
      '#type' => 'checkbox',
      '#title' => t('Check this option if you want to <b>auto redirect the user to IdP.</b>'),
      '#description' => t('<b>Note:</b> Users will be redirected to your IdP for login when the login page is accessed.<br><br>'),
      '#disabled' => TRUE,
    );
    $form['mo_saml_singnin_settings']['miniorange_saml_enable_backdoor'] = array(
      '#type' => 'checkbox',
      '#title' => t('Check this option if you want to enable <b>backdoor login.</b>'),
      '#disabled' => TRUE,
      '#description' => t('<b>Note: </b>Checking this option <b>creates a backdoor to login to your website using Drupal credentials</b>
              <br>incase you get locked out of your IdP. <br><b>Note down this URL: <span style="color: #FF0000"><code>We provide backdoor URL in standard, premium & enterprise version of the module.</code></span></b><br><br>'),
    );
    $form['mo_saml_singnin_settings']['miniorange_saml_default_relaystate'] = array(
      '#type' => 'textfield',
      '#title' => t('Default Redirect URL after login.'),
      '#attributes' => array(
        'style' => 'width:700px; background-color: hsla(0,0%,0%,0.08) !important',
        'placeholder' => t('Enter Default Redirect URL'),
      ),
      '#disabled' => TRUE,
      '#suffix' => '<br>',
    );
    $form['mo_saml_singnin_settings']['mo_saml_domain_restriction'] = array(
      '#type' => 'fieldset',
      //'#title' => t('Domain Restriction'),
      '#attributes' => array(
        'style' => 'padding:2% 2%; margin-bottom:2%',
      ),
    );
    $form['mo_saml_singnin_settings']['mo_saml_domain_restriction']['miniorange_saml_domain_restriction_checkbox'] = array(
      '#type' => 'checkbox',
      '#title' => t('Check this option if you want  <b>Domain Restriction <a href="' . $base_url . MiniorangeSAMLConstants::LICENSING_TAB_URL . '">[Enterprise]</a></b>'),
      '#disabled' => TRUE,
    );
    $form['mo_saml_singnin_settings']['mo_saml_domain_restriction']['miniorange_saml_allow_or_block_domains'] = array(
      '#type' => 'radios',
      '#maxlength' => 1,
      '#options' => array(
        0 => t('I want to allow only some of the domains'),
        1 => t('I want to block some of the domains'),
      ),
      '#disabled' => TRUE,
    );
    $form['mo_saml_singnin_settings']['mo_saml_domain_restriction']['miniorange_saml_domains'] = array(
      '#type' => 'textfield',
      '#title' => t('Enter list of domains'),
      '#attributes' => array(
        'style' => 'width:700px; background-color: hsla(0,0%,0%,0.08) !important',
        'placeholder' => t('Enter semicolon(;) separated domains (Eg. xxxx.com; xxxx.com)'),
      ),
      '#disabled' => TRUE,
      '#suffix' => '',
    );
    $form['mo_saml_singnin_settings']['miniorange_saml_gateway_config_submit'] = array(
      '#type' => 'submit',
      '#value' => t('Save Configuration'),
      '#disabled' => TRUE,
      '#prefix' => '<br><br>',
      '#suffix' => '<br><br></div>',
    );
    Utilities::advertiseNetworkSecurity($form, $form_state, 'SCIM');
    return $form;
  }
  public function submitForm(array &$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.
MiniorangeSignonSettings::buildForm public function Form constructor. Overrides FormInterface::buildForm
MiniorangeSignonSettings::getFormId public function Returns a unique string identifying the form. Overrides FormInterface::getFormId
MiniorangeSignonSettings::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.