--- ../../3rdtols/ldap_integration/ldap_integration/LDAPInterface.php	2005-10-30 02:10:20.000000000 +0100
+++ LDAPInterface.php	2005-11-01 18:00:52.001249432 +0100
@@ -53,7 +53,7 @@
   
   // Code contributed by allrite@drupal.org (http://allrite.net)
   // Patched (2005-09-06) by sfrancis@drupal.org
-  function connect_ADstyle($name = '', $base_dn = '', $pass = '') {
+  function connect_ADstyle($user_att = '', $name = '', $base_dn = '', $pass = '') {
     global $ldap;
     
     // If a connection already exists, it should be terminated
@@ -65,7 +65,7 @@
     
     // Bind anonymously
     $res = false;
-    $dn = 'sAMAccountName=' . $name;
+    $dn = $user_att.'='. $name;
     //srf
     global $ldap;
     //srf - the base dn is already passed as an argument to this function $anon_res = @ldap_search($this->connection, variable_get('ldap_base_dn', ''), $dn);
@@ -95,10 +95,10 @@
   }
 
   // Code contributed by sfrancis@drupal.org
-  function name_to_dn_AD($name = '', $base_dn = '') {
+  function name_to_dn_AD($user_att = '', $name = '', $base_dn = '') {
     global $ldap;
 
-    $dn = 'sAMAccountName=' . $name;
+    $dn = $user_att.'=' . $name;
     $res = @ldap_search($this->connection, $base_dn, $dn);
     if ($res) {
       if (ldap_count_entries($this->connection, $res) !=1) {
@@ -200,4 +200,4 @@
   }
 }
 
