You are here

function hosting_task_TASK_TYPE_form_validate in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 task/hosting_task.api.php \hosting_task_TASK_TYPE_form_validate()
  2. 7.3 task/hosting_task.api.php \hosting_task_TASK_TYPE_form_validate()

Validate the form data defined in hosting_task_TASK_TYPE_form().

See also

hosting_task_confirm_form()

Related topics

File

task/hosting_task.api.php, line 92
Hooks provided by the hosting tasks module.

Code

function hosting_task_TASK_TYPE_form_validate($form, &$form_state) {

  // From hosting_task_clone_form_validate()
  $site = $form['parameters']['#node'];
  $url = strtolower(trim($form_state['values']['parameters']['new_uri']));

  // domain names are case-insensitive
  if ($url == strtolower(trim($site->title))) {
    form_set_error('new_uri', t("To clone a site you need to specify a new Domain name to clone it to."));
  }
  else {
    hosting_task_migrate_form_validate($form, $form_state);
  }
}