From 0f567be0ed1de29ecf213a19c96ebdc6611d196b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 10 Apr 2001 20:07:27 +0000 Subject: - improved administrator interface of account, node, story and book by (1) adding a few extra features to "easify" navigation and (b) to start using "status messages" as once suggested on the mailing list by Jeroen --- modules/account.module | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'modules/account.module') diff --git a/modules/account.module b/modules/account.module index 7008bd7ec..88c75b494 100644 --- a/modules/account.module +++ b/modules/account.module @@ -4,12 +4,6 @@ $module = array("help" => "account_help", "find" => "account_find", "admin" => "account_admin"); -$queries = array(0 => array("users recently visiting", "ORDER BY last_access DESC"), - 1 => array("users recently joining", "ORDER BY id DESC"), - 2 => array("users with access rights", "WHERE access != '' ORDER BY last_access DESC"), - 3 => array("users with pending accounts", "WHERE status = 1 ORDER BY last_access DESC"), - 4 => array("users with blocked accounts", "WHERE status = 0 ORDER BY last_access DESC")); - function account_help() { ?>

The account-module is responsible for maintaining the user database. It automatically handles tasks like registration, authentication, access control, password retrieval, user settings and much more.

@@ -90,12 +84,11 @@ function account_ac() { return $output; } -function account_overview($query = 0) { - global $queries; +function account_overview($query = array()) { - $result = db_query("SELECT id, userid, last_access FROM users ". $queries[$query][1] ." LIMIT 50"); + $result = db_query("SELECT id, userid, last_access FROM users $query[1] LIMIT 50"); - $output .= status($queries[$query][0]); + $output .= status($query[0]); $output .= "\n"; $output .= " \n"; while ($account = db_fetch_object($result)) { @@ -227,18 +220,24 @@ function account_view($name) { } } -function account_query() { - global $queries; - foreach ($queries as $key=>$array) { - $output .= "
  • $array[0]
  • \n"; +function account_query($type = "") { + $queries = array(0 => array("users recently visiting", "ORDER BY last_access DESC"), 1 => array("users recently joining", "ORDER BY id DESC"), 2 => array("users with access rights", "WHERE access != '' ORDER BY last_access DESC"), 3 => array("users with pending accounts", "WHERE status = 1 ORDER BY last_access DESC"), 4 => array("users with blocked accounts", "WHERE status = 0 ORDER BY last_access DESC")); + return ($queries[$type] ? $queries[$type] : $queries); +} + +function account_listing() { + foreach (account_query() as $key=>$array) { + $output .= "
  • $array[0]
  • \n"; } return "
      $output
    \n"; } function account_admin() { - global $op, $edit, $id, $mod, $keys, $order, $name, $query; + global $op, $edit, $id, $mod, $keys, $order, $name, $type; - print "access control | account queries | search account | overview | help
    "; + print "access control | account listings | search account | overview | help
    "; + + $type = ($type ? $type : 1); switch ($op) { case "access": @@ -259,7 +258,7 @@ function account_admin() { case "Delete account": case "delete": print status(account_delete(check_input($name))); - print account_overview(); + print account_overview(account_query($type)); break; case "Edit account": case "edit": @@ -268,6 +267,9 @@ function account_admin() { case "help": print account_help(); break; + case "listing": + print account_listing(); + break; case "search": print search_form($keys); print search_data($keys, $mod); @@ -280,11 +282,8 @@ function account_admin() { case "view": print account_view($name); break; - case "query": - print account_query(); - break; default: - print account_overview($query); + print account_overview(account_query($type)); } } -- cgit v1.2.3
    usernamelast accessoperations