You are here

function hostmaster_task_verify in Hostmaster (Aegir) 5.x

File

./hostmaster.forms.inc, line 240

Code

function hostmaster_task_verify() {
  drupal_set_title(st('Verify your configuration'));
  $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 hostmaster_form($form, $next);
}