summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-01-21 17:31:13 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-01-21 17:31:13 +0000
commit8c672011a267d193fa47cd7cbb523e90a643ee32 (patch)
tree79ad86b90c5748f10eaf7edafd0a64dd693c05c9 /modules/user/user.module
parent0683331acd0ee1ddb07bec2e68cece64e3ddbbc5 (diff)
downloadbrdo-8c672011a267d193fa47cd7cbb523e90a643ee32.tar.gz
brdo-8c672011a267d193fa47cd7cbb523e90a643ee32.tar.bz2
- moved user block from theme.inc to user.module.
* only problem is that the admin.php link is not available until the admin enables the block. * $theme->user is obsolete, will patch the themes properly in a later patch. - moved moderation block from theme.inc to queue.module. * removed theme_moderation_results(). - updated database/database.mysql.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 24a67d170..899901bda 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -454,6 +454,51 @@ function user_search($keys) {
return $find;
}
+function user_block() {
+ global $user;
+
+ if ($user->uid) {
+ // Display account settings:
+ $block[0]["subject"] = $user->name;
+
+ $output .= "<div style=\"width: 125;\">\n";
+
+ foreach (module_list() as $name) {
+ if (module_hook($name, "link")) {
+ $links = module_invoke($name, "link", "menu");
+ foreach ($links as $link) {
+ $output .= "$link<br />\n";
+ }
+ }
+ }
+
+ if (user_access("access administration pages")) {
+ $output .= "<br />\n";
+ $output .= "<a href=\"admin.php\">". strtr(t("administer %a"), array("%a" => variable_get("site_name", "drupal"))) ."</a><BR>\n";
+ }
+
+ $output .= "</div>";
+ }
+ else {
+ $block[0]["subject"] = t("Log in");
+
+ $output .= "<div align=\"center\">\n";
+ $output .= " <form action=\"module.php?mod=user&op=login\" method=\"post\">\n";
+ $output .= " <b>". t("Username") .":</b><br /><input name=\"edit[name]\" size=\"15\"><p />\n";
+ $output .= " <b>". t("Password") .":</b><br /><input name=\"edit[pass]\" size=\"15\" TYPE=\"password\"><br />\n";
+ $output .= form_checkbox(t("Remember me"), "remember_me", 1, 0);
+ $output .= " <input type=\"submit\" value=\"". t("Log in") ."\"><br />\n";
+ if (variable_get("account_register", 1)) $output .= " <a href=\"module.php?mod=user\" title=\"". t("Create a new user account.") ."\">". t("REGISTER") ."</a>\n";
+ $output .= " </form>\n";
+ $output .= "</div>\n";
+ }
+ $block[0]["content"] = $output;
+ $block[0]["info"] = t("User information");
+ $block[0]["link"] = "module.php?mod=user";
+
+ return $block;
+}
+
function user_link($type) {
if ($type == "page") {
$links[] = "<a href=\"module.php?mod=user\" title=\"". t("Create a user account, request a new password or edit your account settings.") ."\">". t("user account") ."</a>";