Commit ff311df8 authored by Roderik Muit's avatar Roderik Muit
Browse files

Issue #3246987 by andrewmk, roderik: fix configuration variables to map an existing user.

parent 91075077
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -124,23 +124,11 @@ function samlauth_configure_form() {
    '#default_value' => variable_get('samlauth_unique_id_attribute', 'eduPersonTargetedID'),
  );

  $form['user_info']['samlauth_map_users'] = array(
  $form['user_info']['samlauth_map_users_email'] = array(
    '#type' => 'checkbox',
    '#title' => t('Attempt to map SAML users to existing local users?'),
    '#title' => t('Attempt to map SAML users to existing local users by email?'),
    '#description' => t('If this option is enabled and a SAML authentication response is received for a user that already exists locally, and the user\'s email matches the configured attribute, the SAML user will be mapped to the local user and then logged in.'),
    '#default_value' => variable_get('samlauth_map_users', FALSE),
  );

  $form['user_info']['samlauth_map_users_email'] = array(
    '#type' => 'textfield',
    '#title' => t('Email attribute (for mapping)'),
    '#description' => t('This attribute will be used for mapping SAML users to local Drupal users.'),
    '#default_value' => variable_get('samlauth_map_users_email', FALSE),
    '#states' => array(
      'invisible' => array(
        ':input[name="samlauth_map_users"]' => array('checked' => FALSE),
      ),
    ),
    '#default_value' => (bool) variable_get('samlauth_map_users_email', FALSE),
  );

  $form['user_info']['samlauth_create_users'] = array(
+2 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ function samlauth_uninstall() {
    'samlauth_idp_change_password_service',
    'samlauth_idp_x509_certificate',
    'samlauth_unique_id_attribute',
    'samlauth_map_users',
    'samlauth_map_users_email',
    'samlauth_create_users',
    'samlauth_user_name_attribute',
@@ -33,6 +32,8 @@ function samlauth_uninstall() {
    'samlauth_security_messages_sign',
    'samlauth_security_name_id_sign',
    'samlauth_security_request_authn_context',
    // Was used by (at least saved by the UI of) previous versions:
    'samlauth_map_users',
  );
  foreach ($variables as $variable) {
    variable_del($variable);