From fead09a8de391e2419bdac150a8b63c0228d16a2 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 30 Apr 2001 17:13:08 +0000 Subject: Welp. Large commit ahead. CHANGES: - Added "read" and "write" permissions into drupal but removed it again because - when finished after 3 hours of work - it was considered nothing but added complexity that didn't buy us anything. :I (I'll explain this in detail on the mailing list, I guess.) - Added a very simple help.module to group all available documentation on a single page. - Fixed bug in node_control(), book.module: UnConeD forgot to global $user when updating the combobox code. - Removed static wishlist.module: in future, the wishlist can be maintained as a page in our collaborative book. - Revised most of settings.module: tidied up the code and the descriptions to accompany the settings and introduced a new "default maximum number of nodes to display on the main page" variable. - Revised most of comment.module: the administration interface looks better now, integrated node permissions, and -finally- made it possible to delete comments. - Polished on: + account.module + structure.module + locale.module + module.module + forum.module - Form-ified: + account.php + account.module + setting.module + cvs.module + submit.php + comment.module + forum.module + book.module + page.module + locale.module - Updated CHANGELOG INFO: - Designed a "generic tracker system with optional backends" on paper. The idea is to allow registered users to hot-list certain topics, individual nodes or threads (comments) and to "plug-in" output backends like - for instance - an e-mail digest. The design requires "intelligent blocks" though. TODO: - I want to tidy up the headline.module and backend.class as well as merge in headlineRSS10.module. Julian spent quite some time working on headline.module but I'm not sure what he changed and whether he'd contribute it back? --- modules/account.module | 71 ++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 37 deletions(-) (limited to 'modules/account.module') diff --git a/modules/account.module b/modules/account.module index 72687a0e0..6dbf54977 100644 --- a/modules/account.module +++ b/modules/account.module @@ -69,7 +69,7 @@ function account_ac() { $output .= "\n"; $output .= " \n"; while ($rule = db_fetch_object($result)) { - $output .= " \n"; + $output .= " \n"; } $output .= " \n"; $output .= " \n"; @@ -117,7 +117,7 @@ function account_blocks($id) { } function account_nodes($id) { - $result = db_query("SELECT * FROM node WHERE author = $id ORDER BY timestamp DESC"); + $result = db_query("SELECT * FROM node WHERE author = $id ORDER BY timestamp DESC LIMIT 30"); while ($node = db_fetch_object($result)) { $output .= "
  • nid\">$node->title ($node->type)
  • \n"; } @@ -125,7 +125,7 @@ function account_nodes($id) { } function account_comments($id) { - $result = db_query("SELECT * FROM comments WHERE author = '$id' ORDER BY timestamp DESC"); + $result = db_query("SELECT * FROM comments WHERE author = '$id' ORDER BY timestamp DESC LIMIT 30"); while ($comment = db_fetch_object($result)) { $output .= "
  • lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">$comment->subject
  • \n"; } @@ -158,33 +158,28 @@ function account_edit($name) { $access .= ""; } - $status = array(0 => "blocked", 1 => "not confirmed", 2 => "open"); + $status = array("blocked", "not confirmed", "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"; - return $output; + $form .= form_item("ID", $account->id); + $form .= form_item(t("Username"), check_output($account->userid)); + $form .= form_select(t("Status"), "status", $account->status, array("blocked", "not confirmed", "open")); + $form .= form_item(t("Administrator access"), ""); + $form .= form_textfield(t("Real name"), "name", $account->name, 30, 55); + $form .= form_textfield(t("Real e-mail address"), "real_email", $account->real_email, 30, 55); + $form .= form_textfield(t("Fake e-mail address"), "fake_email", $account->fake_email, 30, 55); + $form .= form_textfield(t("Homepage"), "url", $account->url, 30, 55); + $form .= form_textarea(t("Bio"), "bio", $account->bio, 35, 5); + $form .= form_textarea(t("Signature"), "signature", $account->signature, 35, 5); + $form .= form_hidden("userid", $account->userid); + $form .= form_submit("View account"); + $form .= form_submit("Save account"); + + return form("admin.php?mod=account", $form); } } @@ -194,7 +189,10 @@ function account_view($name) { $result = db_query("SELECT * FROM users WHERE userid = '$name'"); if ($account = db_fetch_object($result)) { - $output .= "
    \n"; + $form .= form_hidden("userid", $account->userid); + $form .= form_submit("Edit account"); + $form .= form_submit("Delete account"); + $output .= "

    masktypereasonoparations
    $rule->mask$rule->type". check_output($rule->reason) ."id\">delete rule
    $rule->mask$rule->type". check_output($rule->reason) ."id\">delete rule
    Use regular expressions (regexs) to specify the mask pattern.
    \n"; $output .= " \n"; $output .= " \n"; @@ -203,19 +201,19 @@ function account_view($name) { $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
    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) ."
    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) ."
    Bio:". 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\">
    Recent nodes:". check_output(account_nodes($account->id)) ."
    Recent comments:". check_output(account_comments($account->id)) ."
    ". form("admin.php?mod=account", $form) ."
    \n"; - $output .= "\n"; + return $output; } } @@ -244,13 +242,12 @@ function account_admin() { print status(account_ac_check($edit)); print account_ac(); break; - case "delete rule": + case "delete": print status(account_ac_del($id)); print account_ac(); break; case "Delete account": - case "delete": - print status(account_delete(check_input($name))); + print status(account_delete($edit[userid])); print account_overview(account_query($type)); break; case "Edit account": @@ -268,8 +265,8 @@ function account_admin() { print search_data($keys, $mod); break; case "Save account": - print status(account_edit_save(check_input($name), $edit)); - print account_view(check_input($name)); + print status(account_edit_save(check_input($edit[userid]), $edit)); + print account_view(check_input($edit[userid])); break; case "View account": case "view": -- cgit v1.2.3