diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-11-09 21:46:54 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-11-09 21:46:54 +0000 |
commit | 51f4b91e5123e3e50e139821a0ce1e0f0ea5b31d (patch) | |
tree | c0d5ac83c5ee3b7a4868dc3965731c4a3bd06cf2 /modules/drupal/drupal.module | |
parent | 6ba38a7eebf0182072a2c1b9c40dedcaf1405db6 (diff) | |
download | brdo-51f4b91e5123e3e50e139821a0ce1e0f0ea5b31d.tar.gz brdo-51f4b91e5123e3e50e139821a0ce1e0f0ea5b31d.tar.bz2 |
* User patch by Natrak:
- Moved the Drupal login XML-RPC API to drupal.module.
- DA logins are now assigned the proper role.
Diffstat (limited to 'modules/drupal/drupal.module')
-rw-r--r-- | modules/drupal/drupal.module | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index c945a06ab..01d47a1cc 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -95,7 +95,7 @@ function drupal_directory_page() { } function drupal_xmlrpc() { - return array("drupal.site.ping" => array("function" => "drupal_directory_ping")); + return array("drupal.site.ping" => array("function" => "drupal_directory_ping"), "drupal.login" => array("function" => "drupal_login")); } function drupal_notify($server) { @@ -149,6 +149,21 @@ function drupal_page() { $theme->footer(); } +function drupal_login($arguments) { + // an XML-RPC method called by external clients (usually other Drupal instances) + $argument = $arguments->getparam(0); + $username = $argument->scalarval(); + $argument = $arguments->getparam(1); + $password = $argument->scalarval(); + + if ($user = user_load(array(name => "$username", "pass" => $password, "status" => 1))) { + return new xmlrpcresp(new xmlrpcval($user->uid, "int")); + } + else { + return new xmlrpcresp(new xmlrpcval(0, "int")); + } +} + function drupal_auth_help() { $site = variable_get("site_name", "this web site"); |