function ldaphelp_wizard_form_validate in LDAP integration 6
File
- ldaphelp/
ldaphelp_wizard.inc, line 327 - wizard file for ldaphelp module
Code
function ldaphelp_wizard_form_validate($form, &$form_state) {
$values = $form_state['values'];
switch ($form_state['storage']['step']) {
case 1:
if ($values['port'] && !is_numeric($values['port'])) {
form_set_error('port', t('The TCP/IP port must be an integer.'));
}
case 2:
return;
if (!trim($form_state['values']['import_data_serialized'])) {
$haserror = TRUE;
}
else {
$import_data = unserialize(trim($form_state['values']['import_data_serialized']));
if (!is_array($import_data)) {
$haserror = TRUE;
}
elseif (!($import_data['ldaps'] || $import_data['admin_settings'])) {
$haserror = TRUE;
}
}
if ($haserror) {
drupal_set_message(t("Input not valid. Input should be a ' .\n 'serialized array from the export function. It should look ' .\n 'something like: ") . '<code>a:1:{s:5:"ldaps";a:1:{i:1;a:1</code>...', 'error');
$form_state['storage']['step'] = $form_state['storage']['step'] - 1;
return FALSE;
}
break;
}
}