Index: wp-admin/users.php
===================================================================
--- wp-admin/users.php	(revision 3850)
+++ wp-admin/users.php	(working copy)
@@ -84,7 +84,7 @@
 	}
 
 	if ( !current_user_can('delete_users') )
-		$error = new WP_Error('edit_users', __('You can&#8217;t delete users.'));
+		$errors = new WP_Error('edit_users', __('You can&#8217;t delete users.'));
 
 	$userids = $_POST['users'];
 
@@ -155,9 +155,58 @@
 
 	include ('admin-header.php');
 
-	$userids = $wpdb->get_col("SELECT ID FROM $wpdb->users;");
+	//
+	// Paging and Search by Mark Jaquith, June 6th, 2006
+	// 
 
-	foreach($userids as $userid) {
+	$users_per_page = 50;
+
+	$page = (int) $_GET['userspage'];
+	if ( !$page )
+		$page = 1;
+
+	$starton = ($page - 1) * $users_per_page;
+
+	$limit = 'LIMIT ' . $starton . ',' .  $users_per_page;
+
+	$search_term = $_GET['usersearch'];
+	if ( $search_term ) {
+		$search = array();
+		$search_sql = 'AND (';
+		foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
+			$searches[] = $col . " LIKE '%$search_term%'";
+		$search_sql .= implode(' OR ', $searches);
+		$search_sql .= ')';
+	}
+
+	if ( !$search_term && $page == 1 && $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users") > $users_per_page )
+		$too_many_users = sprintf(__('Because this blog has more than %s users, they cannot all be shown on one page.  Use the paging or search functionality in order to find the user you want to edit.'), $users_per_page);
+
+	$from_where = "FROM $wpdb->users WHERE 1=1 $search_sql";
+	$userids = $wpdb->get_col('SELECT ID ' . $from_where . $limit);
+
+	if ( $userids ) {
+		$total_users_for_this_query = $wpdb->get_var('SELECT COUNT(ID) ' . $from_where); // no limit
+	} else {
+		$errors = new WP_Error('no_matching_users_found', __('No matching users were found!'));
+	}
+
+	// Now for the paging
+	if ( $total_users_for_this_query > $users_per_page ) { // have to page the results
+		$prev_page = ( $page > 1) ? true : false;
+		$next_page = ( ($page * $users_per_page) < $total_users_for_this_query ) ? true : false;
+		$paging_text = '';
+		if ( $prev_page )
+			$paging_text .= '<p class="alignleft"><a href="' . add_query_arg('userspage', $page - 1) . '">&laquo; Previous Page</a></p>';
+		if ( $next_page )
+			$paging_text .= '<p class="alignright"><a href="' . add_query_arg('userspage', $page + 1) . '">Next Page &raquo;</a></p>';
+		if ( $prev_page || $next_page )
+			$paging_text .= '<br style="clear:both" />';
+	}
+
+	// DONE WITH PAGING AND SEARCH
+
+	foreach ( (array) $userids as $userid ) {
 		$tmp_user = new WP_User($userid);
 		$roles = $tmp_user->roles;
 		$role = array_shift($roles);
@@ -197,8 +246,9 @@
 		<?php
 			break;
 		}
-	endif; 
-	if ( is_wp_error( $errors ) ) : ?>
+	endif; ?>
+
+<?php if ( is_wp_error( $errors ) ) : ?>
 	<div class="error">
 		<ul>
 		<?php
@@ -207,14 +257,39 @@
 		?>
 		</ul>
 	</div>
-	<?php 
-	endif;
-	?>
+<?php endif; ?>
 
+<?php if ( $too_many_users ) : ?>
+	<div id="message" class="updated">
+		<p><?php echo $too_many_users; ?></p>
+	</div>
+<?php endif; ?>
+
+<div class="wrap">
+	<h2><?php _e('Search For Users'); ?></h2>
+	<form action="" method="get" name="search" id="search">
+		<p><input type="text" name="usersearch" id="usersearch" value="<?php echo wp_specialchars($_GET['usersearch']); ?>" /> <input type="submit" value="Search &raquo;" /></p>
+	</form>
+	<?php if ( $search_term ) : ?>
+		<p><a href="users.php"><?php _e('&laquo; Back to All Users'); ?></a></p>
+	<?php endif; ?>
+</div>
+
+<?php if ( $userids ) : ?>
+
 <form action="" method="post" name="updateusers" id="updateusers">
 <?php wp_nonce_field('bulk-users') ?>
 <div class="wrap">
-	<h2><?php _e('User List by Role'); ?></h2>
+	<?php if ( $search_term ) : ?>
+		<h2><?php printf(__('Users Matching "%s" by Role'), $search_term); ?></h2>
+		<div class="user-paging-text"><?php echo $paging_text; ?></div>
+	<?php else : ?>
+		<h2><?php _e('User List by Role'); ?></h2>
+		<?php if ( $paging_text ) : ?>
+			<div class="user-paging-text"><?php echo $paging_text; ?></p></div>
+		<?php endif; ?>
+	<?php endif; ?>
+	<h3><?php printf(__('Results %1$s - %2$s of %3$s shown below'), $starton + 1, min($starton + $users_per_page, $total_users_for_this_query), $total_users_for_this_query); ?></h3>
 <table class="widefat">
 <?php
 foreach($roleclasses as $role => $roleclass) {
@@ -222,17 +297,15 @@
 ?>
 
 <tr>
-	<th colspan="8" align="left"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th>
+	<th colspan="7" align="left"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th>
 </tr>
-<thead>
-<tr>
+<tr class="thead">
 	<th style="text-align: left"><?php _e('ID') ?></th>
 	<th style="text-align: left"><?php _e('Username') ?></th>
 	<th style="text-align: left"><?php _e('Name') ?></th>
 	<th style="text-align: left"><?php _e('E-mail') ?></th>
 	<th style="text-align: left"><?php _e('Website') ?></th>
-	<th><?php _e('Posts') ?></th>
-	<th>&nbsp;</th>
+	<th colspan="2"><?php _e('Actions') ?></th>
 </tr>
 </thead>
 <tbody id="role-<?php echo $role; ?>"><?php
@@ -250,6 +323,7 @@
 ?>
 </table>
 
+<div class="user-paging-text"><?php echo $paging_text; ?></div>
 
 	<h2><?php _e('Update Users'); ?></h2>
   <ul style="list-style:none;">
@@ -263,6 +337,8 @@
 </div>
 </form>
 
+<?php endif; // if users were returned ?>
+
 <div class="wrap">
 <h2><?php _e('Add New User') ?></h2>
 <?php echo '<p>'.sprintf(__('Users can <a href="%1$s">register themselves</a> or you can manually create users here.'), get_settings('siteurl').'/wp-register.php').'</p>'; ?>
Index: wp-admin/wp-admin.css
===================================================================
--- wp-admin/wp-admin.css	(revision 3850)
+++ wp-admin/wp-admin.css	(working copy)
@@ -52,7 +52,7 @@
 	font-size: 16px;
 }
 
-thead {
+thead, .thead {
 	background: #dfdfdf
 }
 
Index: wp-admin/admin-functions.php
===================================================================
--- wp-admin/admin-functions.php	(revision 3850)
+++ wp-admin/admin-functions.php	(working copy)
@@ -729,15 +729,18 @@
 	if (strlen($short_url) > 35)
 		$short_url =  substr($short_url, 0, 32).'...';
 	$numposts = get_usernumposts($user_object->ID);
-	if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_object->ID' title='" . __('View posts') . "'>$numposts</a>";
 	$r = "<tr id='user-$user_object->ID'$style>
 		<td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td>
 		<td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td>
 		<td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td>
 		<td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td>
 		<td><a href='$url' title='website: $url'>$short_url</a></td>";
-	$r .= "\n\t\t<td align='center'>$numposts</td>";
-	$r .= "\n\t\t<td>";
+	$r .= "\n\t\t<td align='center'>";
+	if ($numposts > 0) {
+		$r .= "<a href='edit.php?author=$user_object->ID' title='" . __('View posts by this author') . "' class='edit'>";
+		$r .= sprintf(__('View %1$s %2$s'), $numposts, __ngettext('post', 'posts', $numposts));
+	}
+	$r .= "</td>\n\t\t<td>";
 	if ( current_user_can('edit_user', $user_object->ID) )
 		$r .= "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>";
 	$r .= "</td>\n\t</tr>";
@@ -966,7 +969,7 @@
 	</tr>
 
 </table>
-<p class="submit"><input type="submit" id="updatemetasub" name="updatemeta" tabindex="9" value="<?php _e('Add Custom Field &raquo;') ?>" /></p>
+<p class="submit"><input type="submit" id="newmetasub" name="newmeta" tabindex="9" value="<?php _e('Add Custom Field &raquo;') ?>" /></p>
 <?php
 
 }
Index: wp-admin/menu.php
===================================================================
--- wp-admin/menu.php	(revision 3850)
+++ wp-admin/menu.php	(working copy)
@@ -11,7 +11,7 @@
 $menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php');
 $menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
 if ( current_user_can('edit_users') )
-	$menu[35] = array(__('Users'), 'read', 'profile.php');
+	$menu[35] = array(__('Users'), 'read', 'users.php');
 else
 	$menu[35] = array(__('Profile'), 'read', 'profile.php');
 $menu[40] = array(__('Options'), 'manage_options', 'options-general.php');
@@ -34,8 +34,8 @@
 $submenu['link-manager.php'][10] = array(__('Add Bookmark'), 'manage_links', 'link-add.php');
 $submenu['link-manager.php'][20] = array(__('Import Bookmarks'), 'manage_links', 'link-import.php');
 
+$submenu['profile.php'][10] = array(__('Authors &amp; Users'), 'edit_users', 'users.php');
 $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
-$submenu['profile.php'][10] = array(__('Authors &amp; Users'), 'edit_users', 'users.php');
 
 $submenu['options-general.php'][10] = array(__('General'), 'manage_options', 'options-general.php');
 $submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php');
