You are here

function hosting_wizard_hosting_verify in Hosting 5

File

./hosting.wizard.inc, line 429

Code

function hosting_wizard_hosting_verify() {
  $form = array();
  $node = hosting_get_most_recent_task(HOSTING_OWN_PLATFORM, 'verify');
  $form['provision'] = array(
    '#type' => 'requirement_help',
    '#requirement' => 'platform',
  );
  if ($node->task_status == HOSTING_TASK_SUCCESS) {
    $form['provision']['#status'] = HOSTING_STATUS_SUCCESS;
    $form['provision']['#message'] = t('Your platform has been succesfully configured. You can now create sites.');
    $form['import']['#value'] = t('On the next page we will import any existing sites on this platform.');
  }
  else {
    $form['provision']['#status'] = HOSTING_STATUS_ERROR;
    $form['provision']['#message'] = t('One of more errors has occurred during platform verification.');
    $form['retry_id'] = array(
      '#type' => 'hidden',
      '#value' => $node->nid,
    );
    $form['log_tip']['#value'] = t('Underneath is the log output and status of your verification task.
      Check your settings on the previous pages of the wizard, and follow the applicable examples from the configuration
      tips.');
    $view = hosting_task_view($node);
    $form['task_status'] = $view->content['status'];
    $form['task_status']['#title'] = t('Errors');
    $form['last_attempt'] = array(
      '#type' => 'item',
      '#title' => t('Last attempt'),
      '#value' => hosting_format_interval($node->changed),
    );
    $form['log'] = $view->content['hosting_log'];
    $next = t('Check again');
  }
  return hosting_wizard_form('hosting/verify', $form, $next);
}