From 94d6b63f390a970ff96fb38df91a8b2ca2f1eec5 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 9 Apr 2001 16:31:34 +0000 Subject: - small improvement to admin interface --- modules/account.module | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'modules/account.module') diff --git a/modules/account.module b/modules/account.module index e893726a1..7008bd7ec 100644 --- a/modules/account.module +++ b/modules/account.module @@ -4,6 +4,12 @@ $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.

@@ -84,9 +90,12 @@ function account_ac() { return $output; } -function account_overview() { - $result = db_query("SELECT id, userid, last_access FROM users ORDER BY last_access DESC LIMIT 50"); +function account_overview($query = 0) { + global $queries; + + $result = db_query("SELECT id, userid, last_access FROM users ". $queries[$query][1] ." LIMIT 50"); + $output .= status($queries[$query][0]); $output .= "\n"; $output .= " \n"; while ($account = db_fetch_object($result)) { @@ -218,10 +227,18 @@ function account_view($name) { } } +function account_query() { + global $queries; + foreach ($queries as $key=>$array) { + $output .= "
  • $array[0]
  • \n"; + } + return "
      $output
    \n"; +} + function account_admin() { - global $op, $edit, $id, $mod, $keys, $order, $name; + global $op, $edit, $id, $mod, $keys, $order, $name, $query; - print " access control | search account | overview | help
    \n"; + print "access control | account queries | search account | overview | help
    "; switch ($op) { case "access": @@ -255,16 +272,19 @@ function account_admin() { print search_form($keys); print search_data($keys, $mod); break; + case "Save account": + print status(account_edit_save(check_input($name), $edit)); + print account_view(check_input($name)); + break; case "View account": case "view": print account_view($name); break; - case "Save account": - print status(account_edit_save(check_input($name), $edit)); - print account_view(check_input($name)); + case "query": + print account_query(); break; default: - print account_overview(); + print account_overview($query); } } -- cgit v1.2.3
    usernamelast accessoperations