You are here

function clients_drupal_encrypt in Web Service Clients 7.3

Same name and namespace in other branches
  1. 6.2 connections/clients_drupal/clients_drupal.module \clients_drupal_encrypt()
  2. 6 backends/clients_drupal/clients_drupal.module \clients_drupal_encrypt()
  3. 7 backends/clients_drupal/clients_drupal.module \clients_drupal_encrypt()
  4. 7.2 connections/clients_drupal/clients_drupal.module \clients_drupal_encrypt()

Encrypt a value with the chosen encryption method.

File

connections/clients_drupal/clients_drupal.module, line 113
Provides connection types for Clients module that connect to remote Drupal sites running Services module with the XMLRPC server.

Code

function clients_drupal_encrypt($val) {
  $encryption_method = variable_get('clients_drupal_encryption_method', 'no_encryption');
  if ($encryption_method == 'no_encryption') {
    return $val;
  }
  else {

    // This is brittle: it depends on the thing declared in
    // hook_clients_drupal_encryption_methods() having the same key
    // as the providing module.
    return module_invoke($encryption_method, 'clients_drupal_encrypt', $val);
  }
}