You are here

function clients_connection_drupal_services_6_2::testConnectionLogin in Web Service Clients 7

Connection test button handler: user login.

File

backends/clients_drupal/clients_drupal.inc, line 566
Defines methods and calls to Drupal services

Class

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

Code

function testConnectionLogin(&$button_form_values) {

  // Call the login method.
  $login = $this
    ->callMethod('user.login');

  // Eep. we need user details!!!
  if (is_array($login) && isset($login['user'])) {
    drupal_set_message(t('Sucessfully logged in to the remote site; got back details for user %user (uid @uid).', array(
      '%user' => $login['user']['name'],
      '@uid' => $login['user']['uid'],
    )));
  }
  else {
    drupal_set_message(t('Could not log in to the remote site.'), 'warning');
  }
  return $login;
}