I put together this module to display a list of users. You can search by role or by keyword which looks at username and mail. It could probably use some adjustments like:
a) separating into pages instead of one big list and
b) handling unclean URLs in the form post
Any suggestions or modifications welcome, but for our purposes it works and maybe someone else could use it too:
<?php
// $Id: userlist.module,v 1.1 2006-06-15 alynner
/**
* @file
* List or search the directory of users by role or keyword.
*/
/**
* Implementation of hook_help().
*/
function userlist_help($section) {
switch ($section) {
case 'admin/modules#description':
return t('List or search the directory of users.');
}
}
/**
* Implementation of hook_node_name().
*/
function userlist_node_name($node) {
return t('User List');
}
/**
* Implementation of hook_perm().
*/
function userlist_perm() {
return array('access user list');
}
/**
* Implementation of hook_access().
*/
function userlist_access($op, $node) {
global $user;
if ($op == 'access') {
return user_access('access user list');
}
}
function userlist_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array('path' => 'admin/userlist',
'title' => t("userlist"),
'callback' => "userlist_page",
'access' => user_access("access user list"),
'type' => MENU_MODIFIABLE_BY_ADMIN );
}
return $items;
}
/**
function userlist_page(){
if (user_access("access user list")) {
$output.= '';
print theme("page", $output);
}
}
*/
/**
* Implementation of hook_page();
*/
function userlist_page() {
//
// filter form
//
$output .= '
General Search
Role(s):
All';
$select = db_query_range('SELECT rid, name FROM role ',0,1000);
while ($roles = db_fetch_object($select)){
$output .= 'rid.'">'.$roles->name.'';
}
$output .= '