Projet

Général

Profil

Révision 59ae487e

Ajouté par Assos Assos il y a presque 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ldap/ldap_user/LdapUserConf.class.php
496 496
   */
497 497

  
498 498
  public function provisionLdapEntry($account, $ldap_user = NULL, $test_query = FALSE) {
499
    //debug('provisionLdapEntry account'); //debug($account);
500 499
    $watchdog_tokens = array();
501 500
    $result = array(
502 501
      'status' => NULL,
......
709 708
          );
710 709
        }
711 710
        else {
712
         //  //debug('modifyLdapEntry,dn=' . $proposed_ldap_entry['dn']);  //debug($attributes);
713
              // stick $proposed_ldap_entry in $ldap_entries array for drupal_alter call
711
          // stick $proposed_ldap_entry in $ldap_entries array for drupal_alter call
714 712
          $proposed_dn_lcase = drupal_strtolower($proposed_ldap_entry['dn']);
715 713
          $ldap_entries = array($proposed_dn_lcase => $attributes);
716 714
          $context = array(
......
833 831
      $prov_events = ldap_user_all_events();
834 832
    }
835 833
    $sid = $this->ldapEntryProvisionServer; //
836
    //debug("ldapEntryProvisionServer:$sid");
837 834
    if (!$sid) {
838 835
      return FALSE;
839 836
    }
......
911 908
  */
912 909

  
913 910
  function drupalUserToLdapEntry($account, $ldap_server, $params, $ldap_user_entry = NULL) {
914
  //debug('call to drupalUserToLdapEntry, account:'); //debug($account); //debug('ldap_server'); //debug($ldap_server);
915
  //debug('params'); //debug($params); //debug('ldap_user_entry');//debug($ldap_user_entry);
916 911
    $provision = (isset($params['function']) && $params['function'] == 'provisionLdapEntry');
917 912
    $result = LDAP_USER_PROV_RESULT_NO_ERROR;
918 913
    if (!$ldap_user_entry) {
......
931 926
    $prov_events = empty($params['prov_events']) ? ldap_user_all_events() : $params['prov_events'];
932 927

  
933 928
    $mappings = $this->getSynchMappings($direction, $prov_events);
934
     //debug('prov_events'); //debug(join(",",$prov_events));
935
  //  debug('mappings'); debug($mappings);
936
      // Loop over the mappings.
937 929
    foreach ($mappings as $field_key => $field_detail) {
938 930
      list($ldap_attr_name, $ordinal, $conversion) = ldap_servers_token_extract_parts($field_key, TRUE);  //trim($field_key, '[]');
939 931
      $ordinal = (!$ordinal) ? 0 : $ordinal;
......
942 934
      }
943 935

  
944 936
      $synched = $this->isSynched($field_key, $params['prov_events'], LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY);
945
    //  debug("isSynched $field_key: $synched");
946 937
      if ($synched) {
947 938
        $token = ($field_detail['user_attr'] == 'user_tokens') ? $field_detail['user_tokens'] : $field_detail['user_attr'];
948 939
        $value = ldap_servers_token_replace($account, $token, 'user_account');
......
1027 1018
        return FALSE;
1028 1019
      }
1029 1020
    }
1030
   // dpm('ldap_user 675');dpm($ldap_user);
1021

  
1031 1022
    if (!isset($user_edit['name']) && isset($account->name)) {
1032 1023
      $user_edit['name'] = $account->name;
1033 1024
      $watchdog_tokens['%username'] = $user_edit['name'];
......
1329 1320
    );
1330 1321
    if (!$result) {
1331 1322
      if (isset($this->synchMapping[$direction][$attr_token])) {
1332
        //debug($this->synchMapping[$direction][$attr_token]);
1333 1323
      }
1334 1324
      else {
1335
      //  debug("$attr_token not in ldapUserConf::synchMapping");
1336 1325
      }
1337 1326
    }
1338 1327
    return $result;
1339 1328
  }
1340 1329

  
1341

  
1342
} // end LdapUserConf class
1330
}

Formats disponibles : Unified diff