Projet

Général

Profil

Révision be58a50c

Ajouté par Assos Assos il y a environ 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ldap/ldap_servers/LdapServer.class.php
327 327
      return LDAP_CONNECT_ERROR;
328 328
    }
329 329

  
330
    if ($anon_bind !== FALSE && $userdn === NULL && $pass === NULL && $this->bind_method == LDAP_SERVERS_BIND_METHOD_ANON) {
330
    if ($anon_bind === FALSE && $userdn === NULL && $pass === NULL && $this->bind_method == LDAP_SERVERS_BIND_METHOD_ANON) {
331 331
      $anon_bind = TRUE;
332 332
    }
333 333
    if ($anon_bind === TRUE) {
......
463 463
      return FALSE;
464 464
    }
465 465

  
466
    if (!empty($attributes['unicodePwd']) && ($this->ldap_type == 'ad')) {
467
      $attributes['unicodePwd'] = ldap_servers_convert_password_for_active_directory_unicodePwd($attributes['unicodePwd']);
468
    }
469

  
466 470
    $result = @ldap_add($this->connection, $dn, $attributes);
467 471
    if (!$result) {
468 472
      $error = "LDAP Server ldap_add(%dn) Error Server ID = %sid, LDAP Err No: %ldap_errno LDAP Err Message: %ldap_err2str ";
469 473
      $tokens = array('%dn' => $dn, '%sid' => $this->sid, '%ldap_errno' => ldap_errno($this->connection), '%ldap_err2str' => ldap_err2str(ldap_errno($this->connection)));
470
      debug(t($error, $tokens));
474
      //debug(t($error, $tokens));
471 475
      watchdog('ldap_server', $error, $tokens, WATCHDOG_ERROR);
472 476
    }
473 477

  
......
549 553
        $old_attributes =  $entries[0];
550 554
      }
551 555
    }
556

  
557
    if (!empty($attributes['unicodePwd']) && ($this->ldap_type == 'ad')) {
558
      $attributes['unicodePwd'] = ldap_servers_convert_password_for_active_directory_unicodePwd($attributes['unicodePwd']);
559
    }
560

  
552 561
    $attributes = $this->removeUnchangedAttributes($attributes, $old_attributes);
553 562

  
554 563
    foreach ($attributes as $key => $cur_val) {
......
1139 1148
        && isset($ldap_entry[$this->unique_persistent_attr][0])
1140 1149
        && is_scalar($ldap_entry[$this->unique_persistent_attr][0])
1141 1150
        ) {
1142
      $puid = $ldap_entry[$this->unique_persistent_attr][0];
1151
      if (is_array($ldap_entry[$this->unique_persistent_attr])) {
1152
        $puid = $ldap_entry[$this->unique_persistent_attr][0];
1153
      }
1154
      else {
1155
        $puid = $ldap_entry[$this->unique_persistent_attr];
1156
      }
1143 1157
      return ($this->unique_persistent_attr_binary) ? ldap_servers_binary($puid) : $puid;
1144 1158
    }
1145 1159
    else {

Formats disponibles : Unified diff