Project

General

Profile

Revision b42754b9

Added by Assos Assos almost 7 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/ldap/ldap_user/LdapUserConfAdmin.class.php
33 33
  public $userConflictResolveDefault = LDAP_USER_CONFLICT_RESOLVE_DEFAULT;
34 34
  public $userConflictOptions;
35 35

  
36
  public $accountsWithSameEmailDescription;
37
  public $accountsWithSameEmailOptions;
38

  
36 39
  public $acctCreationDescription = '';
37 40
  public $acctCreationDefault = LDAP_USER_ACCT_CREATION_LDAP_BEHAVIOR_DEFAULT;
38 41
  public $acctCreationOptions;
......
163 166
      '#description' => t( $this->userConflictResolveDescription),
164 167
    );
165 168

  
169
    $form['basic_to_drupal']['accountsWithSameEmail'] = array(
170
      '#type' => 'radios',
171
      '#title' => t('Existing Account with Same Email Address'),
172
      '#default_value' => $this->accountsWithSameEmail,
173
      '#options' => $this->accountsWithSameEmailOptions,
174
      '#description' => t($this->accountsWithSameEmailDescription),
175
      '#disabled' => (module_exists('sharedemail') === FALSE),
176
    );
177

  
166 178
    $form['basic_to_drupal']['acctCreation'] = array(
167 179
      '#type' => 'radios',
168 180
      '#title' => t('Application of Drupal Account settings to LDAP Authenticated Users'),
......
382 394
      $this->addServerMappingFields($form, $direction);
383 395
    }
384 396

  
385
    foreach (array('orphanedCheckQty', 'orphanedDrupalAcctBehavior', 'acctCreation', 'userConflictResolve', 'drupalAcctProvisionTriggers', 'mappings__' . LDAP_USER_PROV_DIRECTION_TO_DRUPAL_USER) as $input_name) {
397
    foreach (array('orphanedCheckQty', 'orphanedDrupalAcctBehavior', 'acctCreation', 'userConflictResolve', 'accountsWithSameEmail', 'drupalAcctProvisionTriggers', 'mappings__' . LDAP_USER_PROV_DIRECTION_TO_DRUPAL_USER) as $input_name) {
386 398
      $form['basic_to_drupal'][$input_name]['#states']['invisible'] =
387 399
        array(
388 400
          ':input[name=drupalAcctProvisionServer]' => array('value' => 'none'),
......
596 608

  
597 609
    $this->manualAccountConflict = $values['manualAccountConflict'];
598 610
    $this->userConflictResolve  = ($values['userConflictResolve']) ? (int)$values['userConflictResolve'] : NULL;
611
    $this->accountsWithSameEmail = ($values['accountsWithSameEmail']) ? (int)$values['accountsWithSameEmail'] : NULL;
599 612
    $this->acctCreation  = ($values['acctCreation']) ? (int)$values['acctCreation'] : NULL;
600 613
    $this->disableAdminPasswordField = $values['disableAdminPasswordField'];
601 614
   // $this->wsKey  = ($values['wsKey']) ? $values['wsKey'] : NULL;
......
741 754
          ||
742 755
          (isset($mapping['configurable_to_ldap']) && $mapping['configurable_to_ldap']  && $direction == LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY)
743 756
          ) {
744
          $user_attr_options[$target_id] = substr($mapping['name'], 0, 25);
757
          $user_attr_options[$target_id] = substr($target_id, 1, -1);
745 758
        }
746 759
      }
747 760
    }
748
    $user_attr_options['user_tokens'] = '-- user tokens --';
761

  
762
    if ($direction == LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY) {
763
      $user_attr_options['user_tokens'] = '-- user tokens --';
764
    }
749 765

  
750 766
    $row = 0;
751 767

  
......
1016 1032
      LDAP_USER_CONFLICT_RESOLVE => t('Associate Drupal account with the LDAP entry.  This option
1017 1033
      is useful for creating accounts and assigning roles before an LDAP user authenticates.'),
1018 1034
      );
1019

  
1035
    $values['accountsWithSameEmailDescription'] = t('Allows provisioning a Drupal user account from LDAP regardless of whether another Drupal user account has the same email address. This setting depends on the "sharedemail" contrib module being enabled. ');
1036
    if (!module_exists('sharedemail')) {
1037
      $values['accountsWithSameEmailDescription'] .= t('The module is not currently enabled; you must install/enable it if you want to use this setting.');
1038
    }
1039
    $values['accountsWithSameEmailOptions'] = array(
1040
      LDAP_USER_ACCOUNTS_WITH_SAME_EMAIL_DISABLED => t('Prevent provisioning a user account if an existing account has the same email address.'),
1041
      LDAP_USER_ACCOUNTS_WITH_SAME_EMAIL_ENABLED => t('Allow provisioning a user account that has the same email address as another user account.'),
1042
      );
1020 1043
    $values['acctCreationOptions'] = array(
1021 1044
      LDAP_USER_ACCT_CREATION_LDAP_BEHAVIOR => t('Account creation settings at
1022 1045
        /admin/config/people/accounts/settings do not affect "LDAP Associated" Drupal accounts.'),

Also available in: Unified diff