diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2002-04-14 19:34:04 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2002-04-14 19:34:04 +0000 |
commit | 559276162095e907db21dd3da3c1bea13b4b7c62 (patch) | |
tree | eaa3a34b8261c88e0dffd48059ceb0cd0577251b /modules/drupal | |
parent | 3ffe07f57c6fd177e2693d1e4b60178644036a4b (diff) | |
download | brdo-559276162095e907db21dd3da3c1bea13b4b7c62.tar.gz brdo-559276162095e907db21dd3da3c1bea13b4b7c62.tar.bz2 |
This is a major change to the system, needs more testing!
Committing Changes by Moshe Weitzman:
- admin_user_account(), user_edit(), and user_view() no longer have any
hard code for authentication modules. instead authentication modules
implement the _user hook.
- fixed a couple 'help' typos.
- linked the 'REGISTER' text in the login block to the register page.
this page now advertises DA better if site employs DA.
- admins may now edit everything about a user account (was a feature
request).
- user #1 may now login immediately, in addition to receiving his
password via email.
Other changes:
- modules and themes are now enabled/disabled in the administrative /
settings / modules | themes pages. Requires SQL update and things must
be enabled before your site returns to normal. TODO: enable all
functionality. (For now just do UPDATE system SET status = 1;)
- removed $themes from conf.php.
- added a $theme->system() function where theme can specify settings.
All themes in the Drupal CVS have been updated to use this.
- added _system hook to modules. TODO: update modules to use this.
- changed strange use of sprintf to the usual strtr. The disadvantage of
sprintf is that it requires translations to keep the string order,
which may not be possible in all languages.
- an invalid/nonexisting theme in a user profile will now fallback to the
BaseTheme instead of crashing.
Diffstat (limited to 'modules/drupal')
-rw-r--r-- | modules/drupal/drupal.module | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index 2609a78b2..da8536141 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -110,8 +110,9 @@ function drupal_auth($username, $password, $server) { $message = new xmlrpcmsg("drupal.login", array(new xmlrpcval($username, "string"), new xmlrpcval($password, "string"))); + // TODO remove hard coded Port 80 + // TODO manage server/path such that HTTP_HOST/xml.rpc.php is not assumed $client = new xmlrpc_client("/xmlrpc.php", $server, 80); - $result = $client->send($message, 5); if ($result && !$result->faultCode()) { $value = $result->value(); @@ -131,11 +132,29 @@ function drupal_page() { function drupal_auth_help() { $site = variable_get("site_name", "this web site"); - $output = " - <p><a href=\"http://www.drupal.org\">Drupal</a> is the name of the software which powers %s. There are Drupal websites all over the world, and many of them share their registration databases so that users may freely login to any Drupal site using a single <b>Drupal ID</b>.</p> - <p>So please feel free to login to your account here at %s with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <b>username</b>@<i>server</i>. An example of valid Drupal ID is <b>mwlily</b><i>@www.drupal.org</i>.</p>"; + $output = "<p><a href=\"http://www.drupal.org\">Drupal</a> is the name of the software which powers %s. There are Drupal websites all over the world, and many of them share their registration databases so that users may freely login to any Drupal site using a single <b>Drupal ID</b>.</p>\n"; + $output .= "<p>So please feel free to login to your account here at %s with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <b>username</b>@<i>server</i>. An example of valid Drupal ID is <b>mwlily</b><i>@www.drupal.org</i>.</p>"; + + return strtr(t($output), array("%s" => "<i>$site</i>")); +} - return sprintf(t($output), $site, $site); +function drupal_user($type, $edit, $user) { + global $HTTP_HOST; + + $module = "drupal"; + $name = module_invoke($module, "info", "name"); + switch ($type) { + case "view_private": + $result = user_get_authname($user, $module); + if ($result) { + $output .= form_item("$name ID", $result); + } + else { + // TODO: use a variation of path_uri() instead of $HTTP_HOST below + $output .= form_item("$name ID", "$user->name@$HTTP_HOST"); + } + return $output; + } } ?>
\ No newline at end of file |