Loading modules/samlauth_user_fields/src/Form/SamlauthMappingDeleteForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ class SamlauthMappingDeleteForm extends ConfirmFormBase { */ public function buildForm(array $form, FormStateInterface $form_state, $mapping_id = NULL) { if ($mapping_id !== NULL) { $mappings = $this->configFactory()->get(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); $mappings = $this->configFactory()->getEditable(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); // Set these values for the confirm message to pick up on them. $this->attributeName = $mappings[$mapping_id]['attribute_name']; Loading modules/samlauth_user_fields/src/Form/SamlauthMappingEditForm.php +2 −2 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ class SamlauthMappingEditForm extends FormBase { */ public function buildForm(array $form, FormStateInterface $form_state, $mapping_id = NULL) { $user_fields = $this->entityFieldManager->getFieldDefinitions('user', 'user'); $mappings = $this->configFactory()->get(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); $mappings = $this->configFactory()->getEditable(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); // @todo make code that captures all attributes from a SAML authentication // message (only if enabled here via a special temporary option) and Loading Loading @@ -190,7 +190,7 @@ class SamlauthMappingEditForm extends FormBase { // If this is a new mapping, check to make sure a 'same' one isn't already // defined. $mappings = $this->configFactory()->get(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); $mappings = $this->configFactory()->getEditable(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); if (is_array($mappings)) { $our_mapping_id = $form_state->getValue('mapping_id'); $our_match_id = $form_state->getValue('link_user_order'); Loading modules/samlauth_user_fields/src/Form/SamlauthMappingListForm.php +5 −10 Original line number Diff line number Diff line Loading @@ -51,12 +51,7 @@ class SamlauthMappingListForm extends ConfigFormBase { * {@inheritdoc} */ protected function getEditableConfigNames() { // I'm using ConfigFormBase for the unified save button / message, but // don't want to use ConfigFormBase::config(), to keep a unified way of // getting config values in forms / not obfuscate call structures and get // confused later. So this method/value is unneeded, but ConfigFormBase // requires it. Let's make it empty. return []; return [UserFieldsEventSubscriber::CONFIG_OBJECT_NAME]; } /** Loading @@ -80,7 +75,7 @@ class SamlauthMappingListForm extends ConfigFormBase { * The form structure. */ public function buildForm(array $form, FormStateInterface $form_state, $mapping_id = NULL) { $config = $this->configFactory()->get(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME); $config = $this->config(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME); // The bulk of this page is not a form at all, but a table. We're putting // that on the same page as the form options, because we have only two Loading @@ -90,7 +85,7 @@ class SamlauthMappingListForm extends ConfigFormBase { $mappings = $config->get('field_mappings'); $form = $this->listMappings(is_array($mappings) ? $mappings : []); if ($this->configFactory()->get(SamlController::CONFIG_OBJECT_NAME)->get('map_users')) { if ($this->config(SamlController::CONFIG_OBJECT_NAME)->get('map_users')) { $form['config'] = [ '#type' => 'fieldset', '#title' => $this->t('Configuration for linking'), Loading Loading @@ -123,7 +118,7 @@ class SamlauthMappingListForm extends ConfigFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->configFactory()->getEditable(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME) $this->config(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME) ->set('link_first_user', $form_state->getValue('link_first_user')) ->set('ignore_blocked', $form_state->getValue('ignore_blocked')) ->save(); Loading @@ -141,7 +136,7 @@ class SamlauthMappingListForm extends ConfigFormBase { * A renderable content array. */ public function listMappings(array $mappings) { $linking_enabled = $this->configFactory()->get(SamlController::CONFIG_OBJECT_NAME)->get('map_users'); $linking_enabled = $this->config(SamlController::CONFIG_OBJECT_NAME)->get('map_users'); $output['table'] = [ '#theme' => 'table', Loading modules/samlauth_user_roles/src/Form/SamlauthRoleMappingForm.php +3 −8 Original line number Diff line number Diff line Loading @@ -49,12 +49,7 @@ class SamlauthRoleMappingForm extends ConfigFormBase { * {@inheritdoc} */ protected function getEditableConfigNames() { // I'm using ConfigFormBase for the unified save button / message, but // don't want to use ConfigFormBase::config(), to keep a unified way of // getting config values in forms / not obfuscate call structures and get // confused later. So this method/value is unneeded, but ConfigFormBase // requires it. Let's make it empty. return []; return [UserRolesEventSubscriber::CONFIG_OBJECT_NAME]; } /** Loading @@ -68,7 +63,7 @@ class SamlauthRoleMappingForm extends ConfigFormBase { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->configFactory()->get(UserRolesEventSubscriber::CONFIG_OBJECT_NAME); $config = $this->config(UserRolesEventSubscriber::CONFIG_OBJECT_NAME); $roles = $this->getRoleLabels(); $form['only_first_login'] = [ Loading Loading @@ -258,7 +253,7 @@ class SamlauthRoleMappingForm extends ConfigFormBase { } } $this->configFactory()->getEditable(UserRolesEventSubscriber::CONFIG_OBJECT_NAME) $this->config(UserRolesEventSubscriber::CONFIG_OBJECT_NAME) ->set('only_first_login', $form_state->getValue('only_first_login')) ->set('unassign_roles', array_filter($form_state->getValue('unassign_roles'))) ->set('default_roles', array_filter($form_state->getValue('default_roles'))) Loading src/Form/SamlauthConfigureForm.php +3 −8 Original line number Diff line number Diff line Loading @@ -93,12 +93,7 @@ class SamlauthConfigureForm extends ConfigFormBase { * {@inheritdoc} */ protected function getEditableConfigNames() { // I'm using ConfigFormBase for the unified save button / message, but // don't want to use ConfigFormBase::config(), to keep a unified way of // getting config values in forms / not obfuscate call structures and get // confused later. So this method/value is unneeded, but ConfigFormBase // requires it. Let's make it empty. return []; return [SamlController::CONFIG_OBJECT_NAME]; } /** Loading @@ -112,7 +107,7 @@ class SamlauthConfigureForm extends ConfigFormBase { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->configFactory()->get(SamlController::CONFIG_OBJECT_NAME); $config = $this->config(SamlController::CONFIG_OBJECT_NAME); $form['saml_login_logout'] = [ '#type' => 'details', Loading Loading @@ -1420,7 +1415,7 @@ class SamlauthConfigureForm extends ConfigFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $config = $this->configFactory()->getEditable(SamlController::CONFIG_OBJECT_NAME); $config = $this->config(SamlController::CONFIG_OBJECT_NAME); $sp_key_type = $form_state->getValue('sp_key_cert_type'); if ($sp_key_type) { Loading Loading
modules/samlauth_user_fields/src/Form/SamlauthMappingDeleteForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ class SamlauthMappingDeleteForm extends ConfirmFormBase { */ public function buildForm(array $form, FormStateInterface $form_state, $mapping_id = NULL) { if ($mapping_id !== NULL) { $mappings = $this->configFactory()->get(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); $mappings = $this->configFactory()->getEditable(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); // Set these values for the confirm message to pick up on them. $this->attributeName = $mappings[$mapping_id]['attribute_name']; Loading
modules/samlauth_user_fields/src/Form/SamlauthMappingEditForm.php +2 −2 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ class SamlauthMappingEditForm extends FormBase { */ public function buildForm(array $form, FormStateInterface $form_state, $mapping_id = NULL) { $user_fields = $this->entityFieldManager->getFieldDefinitions('user', 'user'); $mappings = $this->configFactory()->get(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); $mappings = $this->configFactory()->getEditable(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); // @todo make code that captures all attributes from a SAML authentication // message (only if enabled here via a special temporary option) and Loading Loading @@ -190,7 +190,7 @@ class SamlauthMappingEditForm extends FormBase { // If this is a new mapping, check to make sure a 'same' one isn't already // defined. $mappings = $this->configFactory()->get(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); $mappings = $this->configFactory()->getEditable(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME)->get('field_mappings'); if (is_array($mappings)) { $our_mapping_id = $form_state->getValue('mapping_id'); $our_match_id = $form_state->getValue('link_user_order'); Loading
modules/samlauth_user_fields/src/Form/SamlauthMappingListForm.php +5 −10 Original line number Diff line number Diff line Loading @@ -51,12 +51,7 @@ class SamlauthMappingListForm extends ConfigFormBase { * {@inheritdoc} */ protected function getEditableConfigNames() { // I'm using ConfigFormBase for the unified save button / message, but // don't want to use ConfigFormBase::config(), to keep a unified way of // getting config values in forms / not obfuscate call structures and get // confused later. So this method/value is unneeded, but ConfigFormBase // requires it. Let's make it empty. return []; return [UserFieldsEventSubscriber::CONFIG_OBJECT_NAME]; } /** Loading @@ -80,7 +75,7 @@ class SamlauthMappingListForm extends ConfigFormBase { * The form structure. */ public function buildForm(array $form, FormStateInterface $form_state, $mapping_id = NULL) { $config = $this->configFactory()->get(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME); $config = $this->config(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME); // The bulk of this page is not a form at all, but a table. We're putting // that on the same page as the form options, because we have only two Loading @@ -90,7 +85,7 @@ class SamlauthMappingListForm extends ConfigFormBase { $mappings = $config->get('field_mappings'); $form = $this->listMappings(is_array($mappings) ? $mappings : []); if ($this->configFactory()->get(SamlController::CONFIG_OBJECT_NAME)->get('map_users')) { if ($this->config(SamlController::CONFIG_OBJECT_NAME)->get('map_users')) { $form['config'] = [ '#type' => 'fieldset', '#title' => $this->t('Configuration for linking'), Loading Loading @@ -123,7 +118,7 @@ class SamlauthMappingListForm extends ConfigFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->configFactory()->getEditable(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME) $this->config(UserFieldsEventSubscriber::CONFIG_OBJECT_NAME) ->set('link_first_user', $form_state->getValue('link_first_user')) ->set('ignore_blocked', $form_state->getValue('ignore_blocked')) ->save(); Loading @@ -141,7 +136,7 @@ class SamlauthMappingListForm extends ConfigFormBase { * A renderable content array. */ public function listMappings(array $mappings) { $linking_enabled = $this->configFactory()->get(SamlController::CONFIG_OBJECT_NAME)->get('map_users'); $linking_enabled = $this->config(SamlController::CONFIG_OBJECT_NAME)->get('map_users'); $output['table'] = [ '#theme' => 'table', Loading
modules/samlauth_user_roles/src/Form/SamlauthRoleMappingForm.php +3 −8 Original line number Diff line number Diff line Loading @@ -49,12 +49,7 @@ class SamlauthRoleMappingForm extends ConfigFormBase { * {@inheritdoc} */ protected function getEditableConfigNames() { // I'm using ConfigFormBase for the unified save button / message, but // don't want to use ConfigFormBase::config(), to keep a unified way of // getting config values in forms / not obfuscate call structures and get // confused later. So this method/value is unneeded, but ConfigFormBase // requires it. Let's make it empty. return []; return [UserRolesEventSubscriber::CONFIG_OBJECT_NAME]; } /** Loading @@ -68,7 +63,7 @@ class SamlauthRoleMappingForm extends ConfigFormBase { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->configFactory()->get(UserRolesEventSubscriber::CONFIG_OBJECT_NAME); $config = $this->config(UserRolesEventSubscriber::CONFIG_OBJECT_NAME); $roles = $this->getRoleLabels(); $form['only_first_login'] = [ Loading Loading @@ -258,7 +253,7 @@ class SamlauthRoleMappingForm extends ConfigFormBase { } } $this->configFactory()->getEditable(UserRolesEventSubscriber::CONFIG_OBJECT_NAME) $this->config(UserRolesEventSubscriber::CONFIG_OBJECT_NAME) ->set('only_first_login', $form_state->getValue('only_first_login')) ->set('unassign_roles', array_filter($form_state->getValue('unassign_roles'))) ->set('default_roles', array_filter($form_state->getValue('default_roles'))) Loading
src/Form/SamlauthConfigureForm.php +3 −8 Original line number Diff line number Diff line Loading @@ -93,12 +93,7 @@ class SamlauthConfigureForm extends ConfigFormBase { * {@inheritdoc} */ protected function getEditableConfigNames() { // I'm using ConfigFormBase for the unified save button / message, but // don't want to use ConfigFormBase::config(), to keep a unified way of // getting config values in forms / not obfuscate call structures and get // confused later. So this method/value is unneeded, but ConfigFormBase // requires it. Let's make it empty. return []; return [SamlController::CONFIG_OBJECT_NAME]; } /** Loading @@ -112,7 +107,7 @@ class SamlauthConfigureForm extends ConfigFormBase { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->configFactory()->get(SamlController::CONFIG_OBJECT_NAME); $config = $this->config(SamlController::CONFIG_OBJECT_NAME); $form['saml_login_logout'] = [ '#type' => 'details', Loading Loading @@ -1420,7 +1415,7 @@ class SamlauthConfigureForm extends ConfigFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $config = $this->configFactory()->getEditable(SamlController::CONFIG_OBJECT_NAME); $config = $this->config(SamlController::CONFIG_OBJECT_NAME); $sp_key_type = $form_state->getValue('sp_key_cert_type'); if ($sp_key_type) { Loading