You are here

function hosting_task_clone_form_validate in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 clone/hosting_clone.module \hosting_task_clone_form_validate()
  2. 7.3 clone/hosting_clone.module \hosting_task_clone_form_validate()

Implements hook_hosting_task_TASK_TYPE_form_validate().

File

clone/hosting_clone.module, line 36
Allow sites to be cloned.

Code

function hosting_task_clone_form_validate($form, &$form_state) {
  $site = $form['parameters']['#node'];
  $url = hosting_site_get_domain($form_state['values']['parameters']['new_uri']);

  // domain names are case-insensitive
  if ($url == hosting_site_get_domain($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);
  }
}