Projet

Général

Profil

Révision 5136ce55

Ajouté par Assos Assos il y a plus de 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.inc
121 121
/**
122 122
 * Replaces the email address in $ldap_user with one from the template in
123 123
 * $auth_conf.
124
 * 
124
 *
125 125
 * @param array $ldap_user
126 126
 *   LDAP user entry
127 127
 * @param LdapAuthenticationConf $auth_conf
......
156 156

  
157 157
  // Default to name
158 158
  $entered_name = $form_state['values']['name'];
159
  $authname_drupal_property = 'name';
159
  $authname_drupal_property = $form_field_name = 'name';
160 160

  
161 161
  // Email registration module populates name even though user entered email
162 162
  if (!empty($form_state['values']['email'])) {
163 163
    $entered_name = $form_state['values']['email'];
164 164
    $authname_drupal_property = 'mail';
165
    $form_field_name = 'email';
165 166
  }
166 167

  
167 168
  // $authname is the name the user is authenticated with from the logon form // patch 1599632
168 169
  $authname = $entered_name;
169 170

  
171
  if (empty($form_state['values']['pass']) || empty ($form_state['values'][$form_field_name])) {
172
    return FALSE;
173
  }
170 174
  /*
171 175
   * If a fake form state was passed into this function from
172 176
   * _ldap_authentication_user_login_sso(), there will be a value outside of the
......
266 270
  $email_template_tokens = array(
267 271
    '@username' => $drupal_accountname,
268 272
  );
269
  
273

  
270 274
  $email_template_used = FALSE;
271
  
275

  
272 276
  /**
273 277
   * Ensures that we respect the email template handling settings.
274 278
   */
......
288 292
        break;
289 293
    }
290 294
  }
291
  
295

  
292 296
  /**
293 297
   * VI. Find or create corresponding drupal account and set authmaps
294 298
   *
......
354 358
   * VI.C: existing Drupal account with incorrect email.  fix email if appropriate
355 359
   *
356 360
   */
357
  if ((!($auth_conf->templateUsageNeverUpdate && $email_template_used)) && 
358
      $drupal_account_exists && 
359
      $drupal_account->mail != $ldap_user['mail'] && 
361
  if ((!($auth_conf->templateUsageNeverUpdate && $email_template_used)) &&
362
      $drupal_account_exists &&
363
      $drupal_account->mail != $ldap_user['mail'] &&
360 364
      (
361 365
        $auth_conf->emailUpdate == LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_ENABLE_NOTIFY ||
362 366
        $auth_conf->emailUpdate == LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_ENABLE
......
448 452
    else {
449 453
      $user_edit = array('name' => $drupal_accountname, 'status' => 1);
450 454
    }
451
    
455

  
452 456
    // If the email template was used, we want to pass in the email that was
453 457
    // generated so that its not overridden by the provisioner.
454 458
    if ($email_template_used) {

Formats disponibles : Unified diff