You are here

function hosting_wizard_account in Hosting 5

Account form.

The fields were more easily copied from user_edit than trying to import it and get rid of the cruft

File

./hosting.wizard.inc, line 140

Code

function hosting_wizard_account() {
  global $user;
  $form = array();
  $form['introduction']['#value'] = t("<p>As part of the installation, we have already created an administrator account on this system for you. One of hostmaster's project goals is to configure itself to the best of it's abilities, so that you don't have to. Unfortunately there will be some information that we can't guess.</p>\n    <p>To ensure that you are actually able to log back in and use the system, we would appreciate it if you could please change your password to something we didn't generate randomly.</p>");
  $form['account']['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Username'),
    '#default_value' => $user->name,
    '#maxlength' => USERNAME_MAX_LENGTH,
    '#size' => 30,
    '#description' => t('Your preferred username; punctuation is not allowed except for periods, hyphens, and underscores.'),
    '#required' => TRUE,
  );
  $form['account']['#prefix'] = "<div id='hosting-wizard-account-details'>";
  $form['account']['#suffix'] = "</div>";
  $form['account']['mail'] = array(
    '#type' => 'textfield',
    '#title' => t('E-mail address'),
    '#default_value' => $user->mail,
    '#maxlength' => EMAIL_MAX_LENGTH,
    '#size' => 30,
    '#description' => t('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'),
    '#required' => TRUE,
  );
  $form['pass']['#prefix'] = "<div id='hosting-wizard-account-passwd'>";
  $form['pass']['#suffix'] = "</div><br style='clear:both' />";

  //i had to use inline styles. ick
  $form['pass']['pass'] = array(
    '#type' => 'password_confirm',
    '#description' => t('Provide a password for the new account in both fields.'),
    '#required' => hosting_wizard_completed('account') ? FALSE : TRUE,
    '#size' => 30,
  );
  $client_help = hosting_node_help('client');
  return hosting_wizard_form('account', $form);
}