function authorize_filetransfer_form_validate
authorize_filetransfer_form_validate($form, &$form_state)
Form validation handler for authorize_filetransfer_form().
See also
authorize_filetransfer_submit()
File
- includes/authorize.inc, line 199
- Helper functions and form handlers used for the authorize.php script.
Code
function authorize_filetransfer_form_validate($form, &$form_state) { // Only validate the form if we have collected all of the user input and are // ready to proceed with updating or installing. if ($form_state['triggering_element']['#name'] != 'process_updates') { return; } 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) { // The format of this error message is similar to that used on the // database connection form in the installer. form_set_error('connection_settings', t('Failed to connect to the server. The server reports the following message: !message For more help installing or updating code on your server, see the <a href="@handbook_url">handbook</a>.', array( '!message' => '<p class="error">' . $e->getMessage() . '</p>', '@handbook_url' => 'http://drupal.org/documentation/install/modules-themes', ))); } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!authorize.inc/function/authorize_filetransfer_form_validate/7.x