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/LdapUserConf.class.php
69 69
   */
70 70
  public $userConflictResolve = LDAP_USER_CONFLICT_RESOLVE_DEFAULT;
71 71

  
72
  /**
73
   * Whether to allow/disallow provisioning accounts that have the same email.
74
   * Depending on whether the "sharedemail" module is enabled, this variable
75
   * will (by default) be set accordingly.  It can be overridden by an admin.
76
   *
77
   * @var int
78
   *    LDAP_USER_ACCOUNTS_WITH_SAME_EMAIL_DISABLED (0)
79
   *    LDAP_USER_ACCOUNTS_WITH_SAME_EMAIL_ENABLED (1)
80
   */
81
  public $accountsWithSameEmail = LDAP_USER_ACCOUNTS_WITH_SAME_EMAIL_DISABLED;
82

  
72 83
  /**
73 84
   * drupal account creation model
74 85
   *
......
181 192
    'orphanedDrupalAcctBehavior',
182 193
    'orphanedCheckQty',
183 194
    'userConflictResolve',
195
    'accountsWithSameEmail',
184 196
    'manualAccountConflict',
185 197
    'acctCreation',
186 198
    'ldapUserSynchMappings',
......
231 243
    }
232 244
    else {
233 245
      $this->inDatabase = FALSE;
246
      // By default this variable should be 0 if the "sharedemail" module
247
      // is not enabled, or 1 if the module is.
248
      $this->accountsWithSameEmail = (int)module_exists('sharedemail');
234 249
    }
235 250
    // determine account creation configuration
236 251
    $user_register = variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL);
......
1078 1093
            );
1079 1094
            return FALSE;
1080 1095
          }
1081
          if ($account_with_same_email = user_load_by_mail($user_edit['mail'])) {
1096
          if(($this->accountsWithSameEmail == LDAP_USER_ACCOUNTS_WITH_SAME_EMAIL_DISABLED) && ($account_with_same_email = user_load_by_mail($user_edit['mail']))) {
1082 1097
            $watchdog_tokens['%email'] = $user_edit['mail'];
1083 1098
            $watchdog_tokens['%duplicate_name'] = $account_with_same_email->name;
1084 1099
            watchdog('ldap_user', 'LDAP user %drupal_username has email address

Also available in: Unified diff