authorize_filetransfer_form_validate
- Versions
- 7
authorize_filetransfer_form_validate($form, &$form_state)
Validate callback for the filetransfer authorization form.
See also
Code
includes/authorize.inc, line 128
<?php
function authorize_filetransfer_form_validate($form, &$form_state) {
if (isset($form_state['values']['connection_settings'])) {
$backend = $form_state['values']['connection_settings']['authorize_filetransfer_default'];
$filetransfer = authorize_get_filetransfer($backend, $form_state['values']['connection_settings'][$backend]);
try {
if (!$filetransfer) {
throw new Exception(t('Error, this type of connection protocol (%backend) does not exist.', array('%backend' => $backend)));
}
$filetransfer->connect();
}
catch (Exception $e) {
form_set_error('connection_settings', $e->getMessage());
}
}
}
?>Login or register to post comments 