=== modified file 'modules/user/user.module'
--- modules/user/user.module	2007-09-19 18:00:52 +0000
+++ modules/user/user.module	2007-09-23 19:36:57 +0000
@@ -1744,9 +1744,9 @@ function user_filters() {
   if (count($roles)) {
     $filters['role'] = array(
       'title' => t('role'),
-      'where' => "ur.rid = %d",
+      'where' => 'ur$index.rid = %d',
       'options' => $roles,
-      'join' => '',
+      'join' => 'INNER JOIN {users_roles} ur$index ON ur$index.uid = u.uid',
     );
   }
 
@@ -1784,7 +1784,7 @@ function user_build_filter_query() {
 
   // Build query
   $where = $args = $join = array();
-  foreach ($_SESSION['user_overview_filter'] as $filter) {
+  foreach ($_SESSION['user_overview_filter'] as $index => $filter) {
     list($key, $value) = $filter;
     // This checks to see if this permission filter is an enabled permission for the authenticated role.
     // If so, then all users would be listed, and we can skip adding it to the filter query.
@@ -1796,9 +1796,9 @@ function user_build_filter_query() {
         continue;
       }
     }
-    $where[] = $filters[$key]['where'];
+    $where[] = str_replace('$index', $index, $filters[$key]['where']);
     $args[] = $value;
-    $join[] = $filters[$key]['join'];
+    $join[] = str_replace('$index', $index, $filters[$key]['join']);
   }
   $where = !empty($where) ? 'AND '. implode(' AND ', $where) : '';
   $join = !empty($join) ? ' '. implode(' ', array_unique($join)) : '';

