summaryrefslogtreecommitdiff
path: root/modules/drupal/drupal.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-11-14 20:30:08 +0000
committerDries Buytaert <dries@buytaert.net>2001-11-14 20:30:08 +0000
commite42d97b5ce6b7a54c016ceeddd22d79b17595977 (patch)
tree3c8751cf735fc12cb282401e851c0f14cd237985 /modules/drupal/drupal.module
parentdeaf0271031b6040356c9c23595a00974ce51a6f (diff)
downloadbrdo-e42d97b5ce6b7a54c016ceeddd22d79b17595977.tar.gz
brdo-e42d97b5ce6b7a54c016ceeddd22d79b17595977.tar.bz2
User module and DA modules:
+ Updated the documentation to use a Jabber or Drupal IDs instead of Deplhi IDs (as delphi.module won't be part of the default distro). Drupal and Jabber authentication make a better example. + added missing localization / t() functions in user_validate_authmaps() + applied coding convention: * fixed indentation * removed "EOF"; and <<EOFs from user module * changed some HTML into XHTML: use small letters, quote attributes * quoted some array indices: $edit[foo] --> $edit["foo"] + removed some useless sprintf()'s + removed hard-coded references to drop.org. + I don't think the authentication methods should /know/ there help link. Instead, the user module should now where to find the help (it does by knowing the hook to look for), and it is the user module that should take care of exporting the help to the preferred location: * removed the "link" field from the $info field in drupal_info and jabber_info; it wasn't used anyway? + removed the "maintainer" and "maintaineremail" from the auth modules; we don't keep this info in the other modules either so I don't see a reason to do so here.
Diffstat (limited to 'modules/drupal/drupal.module')
-rw-r--r--modules/drupal/drupal.module47
1 files changed, 47 insertions, 0 deletions
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module
new file mode 100644
index 000000000..d69351083
--- /dev/null
+++ b/modules/drupal/drupal.module
@@ -0,0 +1,47 @@
+<?php
+
+function drupal_info($field = 0) {
+ $info["name"] = "Drupal";
+ $info["protocol"] = "XML-RPC";
+
+ if ($field) {
+ return $info[$field];
+ }
+ else {
+ return $info;
+ }
+}
+
+function drupal_auth($username, $password, $server) {
+
+ $message = new xmlrpcmsg("drupal.login", array(new xmlrpcval($username, "string"), new xmlrpcval($password, "string")));
+
+ $client = new xmlrpc_client("/xmlrpc.php", $server, 80);
+
+ $result = $client->send($message, 5);
+ if ($result && !$result->faultCode()) {
+ $value = $result->value();
+ $login = $value->scalarval();
+ }
+
+ return $login;
+}
+
+function drupal_page() {
+ global $theme;
+ $theme->header();
+ $theme->box("Drupal", drupal_auth_help());
+ $theme->footer();
+}
+
+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.drop.org</i>.</p>";
+
+ return sprintf(t($output), $site, $site);
+}
+
+?> \ No newline at end of file