You are here

function clients_connection_drupal_services_6_2::call_user_login in Web Service Clients 7.3

Same name and namespace in other branches
  1. 6.2 connections/clients_drupal/clients_drupal.inc \clients_connection_drupal_services_6_2::call_user_login()
  2. 7.2 connections/clients_drupal/clients_drupal.inc \clients_connection_drupal_services_6_2::call_user_login()

Log in as the configured user.

Helper for callMethodArray(), because logging in doesn't change between versions of Services.

Parameters

$session_id: A session ID obtained from calling system.connect.

Return value

The full data returned from the remote call.

2 calls to clients_connection_drupal_services_6_2::call_user_login()
clients_connection_drupal_services_5::callMethodArray in connections/clients_drupal/clients_drupal.inc
Call a remote method with an array of parameters.
clients_connection_drupal_services_6_2::callMethodArray in connections/clients_drupal/clients_drupal.inc
Call a remote method with an array of parameters.

File

connections/clients_drupal/clients_drupal.inc, line 348
Contains classes for Client connections handlers.

Class

clients_connection_drupal_services_6_2
Drupal client for services on a Drupal 6 site for Services 6.x-2.x.

Code

function call_user_login($session_id) {

  // Get the API key-related arguments.
  $key_args = $this
    ->xmlrpc_key_args('user.login');

  //dsm($key_args);

  // Build the array of connection arguments we need to log in.
  $this
    ->credentialsLoad();
  $username = $this->credentials['username'];
  $password = $this->credentials['password'];

  // Call the xmlrpc method with our array of arguments. This accounts for
  // whether we use a key or not, and the extra parameters to pass to the method.
  $login_args = $key_args;
  $login_args[] = $session_id;
  $login_args[] = $username;
  $login_args[] = $password;
  $login = xmlrpc($this->endpoint, array(
    'user.login' => $login_args,
  ));
  return $login;
}