<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Index: pages/edituser.inc.php
===================================================================
--- pages/edituser.inc.php      (Revision 6372)
+++ pages/edituser.inc.php      (Arbeitskopie)
@@ -57,6 +57,8 @@
   {
     // Load the user's information
     $user_data = dbFetchRow("SELECT * FROM users WHERE user_id = ?", array($vars['user_id']));
+    $user_data['username'] = auth_username_by_id($vars['user_id']);
+    $user_data['level'] = auth_user_level($user_data['username']);
 
     // Become the selected user. Dirty.
     // FIXME this functionality is currently BROKEN. Commented out the link until we handle this better.
Index: includes/authenticate-functions.inc.php
===================================================================
--- includes/authenticate-functions.inc.php     (Revision 6372)
+++ includes/authenticate-functions.inc.php     (Arbeitskopie)
@@ -129,6 +129,19 @@
 }
 
 // DOCME needs phpdoc block
+function auth_username_by_id($user_id)
+{
+  global $config;
+
+  if (function_exists($config['auth_mechanism'] . '_auth_username_by_id'))
+  {
+    return call_user_func($config['auth_mechanism'] . '_auth_username_by_id', $user_id);
+  } else {
+    return call_user_func('mysql_auth_username_by_id', $user_id);
+  }
+}
+
+// DOCME needs phpdoc block
 function deluser($username)
 {
   global $config;
Index: includes/authentication/mysql.inc.php
===================================================================
--- includes/authentication/mysql.inc.php       (Revision 6372)
+++ includes/authentication/mysql.inc.php       (Arbeitskopie)
@@ -92,6 +92,13 @@
 }
 
 // DOCME needs phpdoc block
+function mysql_auth_username_by_id($user_id)
+{
+  return dbFetchCell("SELECT `username` FROM `users` WHERE `user_id` = ?", array($user_id));
+}
+  
+
+// DOCME needs phpdoc block
 function mysql_auth_user_level($username)
 {
   return dbFetchCell("SELECT `level` FROM `users` WHERE `username` = ?", array($username));
Index: includes/authentication/ldap.inc.php
===================================================================
--- includes/authentication/ldap.inc.php        (Revision 6372)
+++ includes/authentication/ldap.inc.php        (Arbeitskopie)
@@ -287,14 +287,36 @@
 }
 
 // DOCME needs phpdoc block
+function ldap_auth_username_by_id($user_id)
+{
+  $userlist = ldap_auth_user_list();
+  foreach($userlist as $user){
+    if($user['user_id'] == $user_id){
+      return $user['username'];
+    }
+  }
+  return "";
+}
+
+// DOCME needs phpdoc block
 function ldap_auth_user_list()
 {
   global $config, $ds;
 
   ldap_init();
   ldap_bind_dn();
   $filter = '(objectClass=' . $config['auth_ldap_objectclass'] . ')';
+  if(count($config['auth_ldap_group']) == 1){
+    $filter = '(&amp;'.$filter.'(memberof='.$config['auth_ldap_group'][0].'))';
+  }
+  elseif(count($config['auth_ldap_group']) &gt; 1){
+    $group_filter = '';
+    foreach($config['auth_ldap_group'] as $group){
+      $group_filter .= '(memberof='.$group.')';
+    }
+    $filter = '(&amp;'.$filter.'(|'.$group_filter.'))';
+  }
 
   print_debug("LDAP[UserList][Filter][$filter][" . trim($config['auth_ldap_suffix'], ', ') . "]");
   $search = ldap_search($ds, trim($config['auth_ldap_suffix'], ', '), $filter);</pre></body></html>