static function clients_connection_drupal_services_6_2::connectionSettingsForm_submit in Web Service Clients 7.2
Same name and namespace in other branches
- 6.2 connections/clients_drupal/clients_drupal.inc \clients_connection_drupal_services_6_2::connectionSettingsForm_submit()
Submit handler for saving/updating connections of this class.
Overrides clients_connection_base::connectionSettingsForm_submit
See also
clients_connection_form_submit()
File
- connections/
clients_drupal/ clients_drupal.inc, line 457 - 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
static function connectionSettingsForm_submit($form, &$form_state) {
$old_connection = $form_state['values']['old_connection'];
// Check whether we're editing or adding a new connection.
if ($old_connection->new) {
$form_state['values']['configuration']['password'] = clients_drupal_encrypt($form_state['values']['configuration']['password']);
}
else {
// Prepare password for serialized storage
if (empty($form_state['values']['configuration']['password'])) {
// Set password to original if blank.
$form_state['values']['configuration']['password'] = $old_connection->configuration['password'];
}
$form_state['values']['configuration']['password'] = clients_drupal_encrypt($form_state['values']['configuration']['password']);
}
}