diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-08-21 15:47:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-08-21 15:47:50 +0000 |
commit | 8d013b16662097d422ffcd60658ce64bc2b1fbd8 (patch) | |
tree | 0598c25ab16dd40cff1fc2ee30a71d032531f05b /modules/user.module | |
parent | 0bbe58901ed15bc69fcdd6014b3e43904dd05ef3 (diff) | |
download | brdo-8d013b16662097d422ffcd60658ce64bc2b1fbd8.tar.gz brdo-8d013b16662097d422ffcd60658ce64bc2b1fbd8.tar.bz2 |
- Applied Moshe's tablesort patch! Note that I changed the arrow images
because those of Moshe where not identical.
Diffstat (limited to 'modules/user.module')
-rw-r--r-- | modules/user.module | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/user.module b/modules/user.module index c05bec7c5..cae3014fc 100644 --- a/modules/user.module +++ b/modules/user.module @@ -1608,21 +1608,29 @@ function user_admin_edit($edit = array()) { function user_admin_account() { $query = arg(3); - $queries = array("ORDER BY u.timestamp DESC", "ORDER BY u.uid DESC", "WHERE u.status = 0 ORDER BY u.uid DESC"); + $queries = array("", "WHERE u.status = 0"); foreach (user_roles(1) as $key => $value) { - $queries[] = "WHERE r.name = '$value' ORDER BY u.uid DESC"; + $queries[] = "WHERE r.name = '$value'"; } - $result = pager_query("SELECT u.uid, u.name, u.timestamp FROM {role} r INNER JOIN {users} u ON r.rid = u.rid ". $queries[$query ? $query : 0], 50); + $sql = "SELECT u.uid, u.name, u.timestamp FROM {role} r INNER JOIN {users} u ON r.rid = u.rid ". $queries[$query ? $query : 0]; + + $header = array( + array ("data" => t("uid"), "field" => "u.uid"), + array ("data" => t("username"), "field" => "u.name"), + array ("data" => t("last access"), "field" => "u.timestamp", "sort" => "asc"), + t("operations") + ); + $sql .= tablesort_sql($header); + $result = pager_query($sql, 50); - $header = array(t("username"), t("last access"), t("operations")); while ($account = db_fetch_object($result)) { - $rows[] = array(format_name($account), format_date($account->timestamp, "small"), l(t("edit account"), "admin/user/edit/$account->uid")); + $rows[] = array($account->uid, format_name($account), format_date($account->timestamp, "small"), l(t("edit account"), "admin/user/edit/$account->uid")); } - $pager = pager_display(NULL, 50, 0, "admin"); + $pager = pager_display(NULL, 50, 0, "admin", tablesort_pager()); if (!empty($pager)) { - $rows[] = array(array("data" => $pager, "colspan" => 3)); + $rows[] = array(array("data" => $pager, "colspan" => 4)); } return table($header, $rows); } |