Commit 9eb0067c authored by Dries's avatar Dries

- Fixed off-by-one error in user admin pages.
parent 7eb33053
......@@ -496,11 +496,9 @@ function user_link($type) {
menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
menu("admin/user/help", "help", "user_help", NULL, 9);
menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
menu("admin/user/account/0", "active users", "user_admin", user_help("admin/user/account/0"), 1);
menu("admin/user/account/1", "new users", "user_admin", user_help("admin/user/account/1"), 2);
menu("admin/user/account/2", "blocked users", "user_admin", user_help("admin/user/account/2"), 3);
menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
$i = 3;
$i = 2;
foreach (user_roles(1) as $key => $value) {
menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
}
......@@ -1591,7 +1589,8 @@ function user_admin_edit($edit = array()) {
function user_admin_account() {
$query = arg(3);
$queries = array("", "WHERE u.status = 0");
$queries[] = "";
$queries[] = "WHERE u.status = 0";
foreach (user_roles(1) as $key => $value) {
$queries[] = "WHERE r.name = '$value'";
}
......@@ -1601,7 +1600,7 @@ function user_admin_account() {
$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"),
array ("data" => t("last access"), "field" => "u.timestamp", "sort" => "desc"),
t("operations")
);
$sql .= tablesort_sql($header);
......
......@@ -496,11 +496,9 @@ function user_link($type) {
menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
menu("admin/user/help", "help", "user_help", NULL, 9);
menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
menu("admin/user/account/0", "active users", "user_admin", user_help("admin/user/account/0"), 1);
menu("admin/user/account/1", "new users", "user_admin", user_help("admin/user/account/1"), 2);
menu("admin/user/account/2", "blocked users", "user_admin", user_help("admin/user/account/2"), 3);
menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
$i = 3;
$i = 2;
foreach (user_roles(1) as $key => $value) {
menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
}
......@@ -1591,7 +1589,8 @@ function user_admin_edit($edit = array()) {
function user_admin_account() {
$query = arg(3);
$queries = array("", "WHERE u.status = 0");
$queries[] = "";
$queries[] = "WHERE u.status = 0";
foreach (user_roles(1) as $key => $value) {
$queries[] = "WHERE r.name = '$value'";
}
......@@ -1601,7 +1600,7 @@ function user_admin_account() {
$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"),
array ("data" => t("last access"), "field" => "u.timestamp", "sort" => "desc"),
t("operations")
);
$sql .= tablesort_sql($header);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment