"account_help", "find" => "account_find", "admin" => "account_admin"); function account_help() { ?>

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

The required administration can be accomplished through the "account" interface of the administration section. From here administrators can get a quick overview of all registered users and view/edit specific accounts using the links provided. Some useful operations include blocking specific accounts (e.g. a troublesome user) and giving/taking administration permissions. Note that you should only give these permissions to people you trust!

Check the documentation page for detailed information about user management.

$account->userid, "link" => (user_access($user, "account") ? "admin.php?mod=account&op=view&name=$account->userid" : "account.php?op=view&name=$account->userid"), "user" => $account->userid)); } return $find; } function account_search() { global $keys, $mod; print search_form($keys); print search_data($keys, $mod); } function account_display($order = "username") { $result = db_query("SELECT id, userid, last_access FROM users ORDER BY last_access DESC LIMIT 50"); $output .= "\n"; $output .= " \n"; while ($account = db_fetch_object($result)) { $output .= " \n"; } $output .= "
usernamelast accessoperations
". format_username($account->userid) ."". format_date($account->last_access) ."userid\">viewuserid\">edituserid\">delete
\n"; print $output; } function account_access($account) { $data = explode(";", $account->access); foreach ($data as $array) { $access = explode(":", $array); if ($access[0]) $output .= " $access[0]"; } return $output; } function account_blocks($id) { $result = db_query("SELECT * FROM layout WHERE user = '$id'"); while ($layout = db_fetch_object($result)) { $output .= "
  • $layout->block
  • \n"; } return $output; } function account_nodes($id) { $result = db_query("SELECT * FROM nodes WHERE author = $id ORDER BY timestamp DESC"); while ($node = db_fetch_object($result)) { $output .= "
  • nid\">$node->title ($node->type)
  • \n"; } return $output; } function account_comments($id) { $result = db_query("SELECT * FROM comments WHERE author = '$id' ORDER BY timestamp DESC"); while ($comment = db_fetch_object($result)) { $output .= "
  • lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">$comment->subject
  • \n"; } return $output; } function account_delete($name) { $result = db_query("SELECT * FROM users WHERE userid = '$name' AND status = 0 AND id > 1"); if ($account = db_fetch_object($result)) { db_query("DELETE FROM users WHERE id = '$account->id'"); } else { print "

    Failed to delete account '". format_username($name) ."': the account must be blocked first.

    "; } } function account_edit_save($name, $edit) { foreach ($edit as $key=>$value) if ($key != "access") $query .= "$key = '". addslashes($value) ."', "; db_query("UPDATE users SET $query access = '' WHERE userid = '$name'"); if ($edit[access]) foreach ($edit[access] as $key=>$value) user_set(user_load($name), "access", $value, 1); watchdog("message", "account: modified user '$name'"); } function account_edit($name) { global $access, $account; function access($name, $module) { global $access, $account; $access .= ""; } $status = array(0 => "blocked", 1 => "not confirmed", 2 => "open"); $result = db_query("SELECT * FROM users WHERE userid = '$name'"); if ($account = db_fetch_object($result)) { foreach ($status as $key=>$value) { $stat .= " \n"; } module_iterate("access"); $output .= "
    \n"; $output .= "ID:
    $account->id

    \n"; $output .= "Username:
    ". check_output($account->userid) ."

    \n"; $output .= "Status:

    \n"; $output .= "Administrator access:

    \n"; $output .= "Real name:
    name\">

    \n"; $output .= "Real e-mail address:
    real_email\">

    \n"; $output .= "Fake e-mail address:
    fake_email\">

    \n"; $output .= "URL of homepage:
    url\">

    \n"; $output .= "Bio information:

    \n"; $output .= "Signature:

    \n"; $output .= "userid\">\n"; $output .= "\n"; $output .= "\n"; $output .= "

    \n"; print "$output"; } } function account_view($name) { $status = array(0 => "blocked", 1 => "not confirmed", 2 => "open"); $result = db_query("SELECT * FROM users WHERE userid = '$name'"); if ($account = db_fetch_object($result)) { $output .= "
    \n"; $output .= "\n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= "
    ID:$account->id
    Username:$account->userid
    Status:". $status[$account->status] ."
    Access:". check_output(account_access($account)) ."
    Real name:". check_output($account->name) ."
    Real e-mail address:". format_email($account->real_email) ."
    Fake e-mail address:". check_output($account->fake_email) ."
    URL of homepage:". format_url($account->url) ."
    Last access:". format_date($account->last_access) ." from ". check_output($account->last_host) ."
    User rating:". check_output($account->rating) ."
    Bio information:". check_output($account->bio) ."
    Signature:". check_output($account->signature) ."
    Theme:". check_output($account->theme) ."
    Timezone:". check_output($account->timezone / 3600) ."
    Selected blocks:". check_output(account_blocks($account->id)) ."
    Submitted nodes:". check_output(account_nodes($account->id)) ."
    Submitted comments:". check_output(account_comments($account->id)) ."
    userid\">
    \n"; $output .= "
    \n"; print "$output"; } } function account_admin() { global $op, $edit, $order, $name; print "overview | search account | help
    \n"; switch ($op) { case "Delete account": case "delete": account_delete(check_input($name)); account_display(); break; case "Edit account": case "edit": account_edit(check_input($name)); break; case "help": account_help(); break; case "search": account_search(); break; case "View account": case "view": account_view($name); break; case "Save account": account_edit_save(check_input($name), $edit); account_view(check_input($name)); break; default: account_display(); } } ?>