update_manager_install_form_validate

7 update.manager.inc update_manager_install_form_validate($form, &$form_state)
8 update.manager.inc update_manager_install_form_validate($form, &$form_state)

Validate the form for installing a new project via the update manager.

Related topics

File

modules/update/update.manager.inc, line 591
Administrative screens and processing functions for the update manager. This allows site administrators with the 'administer software updates' permission to either upgrade existing projects, or download and install new ones, so long as the…

Code

function update_manager_install_form_validate($form, &$form_state) {
  if (!($form_state['values']['project_url'] XOR !empty($_FILES['files']['name']['project_upload']))) {
    form_set_error('project_url', t('You must either provide a URL or upload an archive file to install.'));
  }

  if ($form_state['values']['project_url']) {
    if (!valid_url($form_state['values']['project_url'], TRUE)) {
      form_set_error('project_url', t('The provided URL is invalid.'));
    }
  }
}
Login or register to post comments