summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/user.module61
-rw-r--r--modules/user/user.module61
2 files changed, 62 insertions, 60 deletions
diff --git a/modules/user.module b/modules/user.module
index 95f348179..cb1c44949 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -1415,36 +1415,36 @@ function user_admin_edit($edit = array()) {
}
}
- /*
- ** Display user form:
- */
+ /*
+ ** Display user form:
+ */
- $output .= form_item(t("User ID"), check_output($account->uid));
- $output .= form_textfield(t("Username"), "name", $account->name, 30, 55, t("Your full name or your preferred username: only letters, numbers and spaces are allowed."));
- $output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."));
+ $output .= form_item(t("User ID"), check_output($account->uid));
+ $output .= form_textfield(t("Username"), "name", $account->name, 30, 55, t("Your full name or your preferred username: only letters, numbers and spaces are allowed."));
+ $output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."));
- foreach (module_list() as $module) {
- if (module_hook($module, "user")) {
- $output .= module_invoke($module, "user", "edit_form", $edit, $account);
+ foreach (module_list() as $module) {
+ if (module_hook($module, "user")) {
+ $output .= module_invoke($module, "user", "edit_form", $edit, $account);
+ }
}
- }
- $options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n";
- foreach (theme_list() as $key => $value) {
- $options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n";
- }
- $output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site."));
- for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date("l, F dS, Y - h:i A", time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")";
- $output .= form_select(t("Time zone"), "timezone", $account->timezone, $zones, t("Select what time you currently have and your time zone settings will be set appropriate."));
- $output .= form_select(t("Language"), "language", $account->language, $languages, t("Selecting a different language will change the language of the site."));
- $output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\" /> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\" />", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password."));
- $output .= form_select(t("Status"), "status", $account->status, array(t("Blocked"), t("Active")));
- $output .= form_select(t("Role"), "rid", $account->rid, user_roles(1));
+ $options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n";
+ foreach (theme_list() as $key => $value) {
+ $options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n";
+ }
+ $output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site."));
+ for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date("l, F dS, Y - h:i A", time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")";
+ $output .= form_select(t("Time zone"), "timezone", $account->timezone, $zones, t("Select what time you currently have and your time zone settings will be set appropriate."));
+ $output .= form_select(t("Language"), "language", $account->language, $languages, t("Selecting a different language will change the language of the site."));
+ $output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\" /> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\" />", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password."));
+ $output .= form_select(t("Status"), "status", $account->status, array(t("Blocked"), t("Active")));
+ $output .= form_select(t("Role"), "rid", $account->rid, user_roles(1));
- $output .= form_submit(t("Save account"));
- $output .= form_submit(t("Delete account"));
+ $output .= form_submit(t("Save account"));
+ $output .= form_submit(t("Delete account"));
- $output = form($output);
+ $output = form($output);
}
else {
@@ -1462,17 +1462,18 @@ function user_admin_account() {
$queries[] = "WHERE r.name = '$value' ORDER BY u.uid DESC";
}
- $result = db_query("SELECT u.uid, u.name, u.timestamp FROM users u LEFT JOIN role r ON u.rid = r.rid ". $queries[$query ? $query : 0] ." LIMIT 50");
+ $result = pager_query("SELECT u.uid, u.name, u.timestamp FROM users u LEFT JOIN role r ON u.rid = r.rid ". $queries[$query ? $query : 0], 50);
- $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>" . t("username") . "</th><th>" . t("last access") . "</th><th>" . t("operations") . "</th></tr>";
+ $header = array(t("username"), t("last access"), t("operations"));
while ($account = db_fetch_object($result)) {
- $output .= " <tr><td>". format_name($account) ."</td><td>". format_date($account->timestamp, "small") ."</td><td align=\"center\">". la(t("edit account"), array("mod" => "user", "op" => "edit", "id" => $account->uid)) ."</td></tr>";
+ $rows[] = array(format_name($account), format_date($account->timestamp, "small"), la(t("edit account"), array("mod" => "user", "op" => "edit", "id" => $account->uid)));
}
- $output .= "</table>";
- return $output;
+ if ($pager = pager_display(NULL, 50, 0, "admin")) {
+ $rows[] = array(array("data" => $pager, "colspan" => 3));
+ }
+ return table($header, $rows);
}
function user_role_init() {
diff --git a/modules/user/user.module b/modules/user/user.module
index 95f348179..cb1c44949 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1415,36 +1415,36 @@ function user_admin_edit($edit = array()) {
}
}
- /*
- ** Display user form:
- */
+ /*
+ ** Display user form:
+ */
- $output .= form_item(t("User ID"), check_output($account->uid));
- $output .= form_textfield(t("Username"), "name", $account->name, 30, 55, t("Your full name or your preferred username: only letters, numbers and spaces are allowed."));
- $output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."));
+ $output .= form_item(t("User ID"), check_output($account->uid));
+ $output .= form_textfield(t("Username"), "name", $account->name, 30, 55, t("Your full name or your preferred username: only letters, numbers and spaces are allowed."));
+ $output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."));
- foreach (module_list() as $module) {
- if (module_hook($module, "user")) {
- $output .= module_invoke($module, "user", "edit_form", $edit, $account);
+ foreach (module_list() as $module) {
+ if (module_hook($module, "user")) {
+ $output .= module_invoke($module, "user", "edit_form", $edit, $account);
+ }
}
- }
- $options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n";
- foreach (theme_list() as $key => $value) {
- $options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n";
- }
- $output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site."));
- for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date("l, F dS, Y - h:i A", time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")";
- $output .= form_select(t("Time zone"), "timezone", $account->timezone, $zones, t("Select what time you currently have and your time zone settings will be set appropriate."));
- $output .= form_select(t("Language"), "language", $account->language, $languages, t("Selecting a different language will change the language of the site."));
- $output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\" /> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\" />", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password."));
- $output .= form_select(t("Status"), "status", $account->status, array(t("Blocked"), t("Active")));
- $output .= form_select(t("Role"), "rid", $account->rid, user_roles(1));
+ $options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n";
+ foreach (theme_list() as $key => $value) {
+ $options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n";
+ }
+ $output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site."));
+ for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date("l, F dS, Y - h:i A", time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")";
+ $output .= form_select(t("Time zone"), "timezone", $account->timezone, $zones, t("Select what time you currently have and your time zone settings will be set appropriate."));
+ $output .= form_select(t("Language"), "language", $account->language, $languages, t("Selecting a different language will change the language of the site."));
+ $output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\" /> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\" />", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password."));
+ $output .= form_select(t("Status"), "status", $account->status, array(t("Blocked"), t("Active")));
+ $output .= form_select(t("Role"), "rid", $account->rid, user_roles(1));
- $output .= form_submit(t("Save account"));
- $output .= form_submit(t("Delete account"));
+ $output .= form_submit(t("Save account"));
+ $output .= form_submit(t("Delete account"));
- $output = form($output);
+ $output = form($output);
}
else {
@@ -1462,17 +1462,18 @@ function user_admin_account() {
$queries[] = "WHERE r.name = '$value' ORDER BY u.uid DESC";
}
- $result = db_query("SELECT u.uid, u.name, u.timestamp FROM users u LEFT JOIN role r ON u.rid = r.rid ". $queries[$query ? $query : 0] ." LIMIT 50");
+ $result = pager_query("SELECT u.uid, u.name, u.timestamp FROM users u LEFT JOIN role r ON u.rid = r.rid ". $queries[$query ? $query : 0], 50);
- $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>" . t("username") . "</th><th>" . t("last access") . "</th><th>" . t("operations") . "</th></tr>";
+ $header = array(t("username"), t("last access"), t("operations"));
while ($account = db_fetch_object($result)) {
- $output .= " <tr><td>". format_name($account) ."</td><td>". format_date($account->timestamp, "small") ."</td><td align=\"center\">". la(t("edit account"), array("mod" => "user", "op" => "edit", "id" => $account->uid)) ."</td></tr>";
+ $rows[] = array(format_name($account), format_date($account->timestamp, "small"), la(t("edit account"), array("mod" => "user", "op" => "edit", "id" => $account->uid)));
}
- $output .= "</table>";
- return $output;
+ if ($pager = pager_display(NULL, 50, 0, "admin")) {
+ $rows[] = array(array("data" => $pager, "colspan" => 3));
+ }
+ return table($header, $rows);
}
function user_role_init() {