You are here

function clients_drupal_clients_connection_edit in Web Service Clients 6

Implementation of hook_clients_connection_edit()

File

backends/clients_drupal/clients_drupal.module, line 41
Drupal Services plugin for Clients module @author Django Beatty - adub

Code

function clients_drupal_clients_connection_edit($formvals) {
  if ($formvals['type'] == variable_get('clients_drupal_type', 'Drupal Services')) {
    $formvals['type'] = variable_get('clients_drupal_type', 'clients_drupal');

    // prepare pass for serialized storage
    if (empty($formvals['configuration']['password'])) {

      // need to load connection and set password to original if blank
      $original = clients_connection_load((int) $formvals['cid']);
      $formvals['configuration']['password'] = $original->configuration['password'];
    }
    $formvals['configuration']['password'] = clients_drupal_encrypt($formvals['configuration']['password']);
    return $formvals;
  }
}