You are here

function lockr_admin_csr_form in Lockr 7.2

Returns form array for CSR settings.

1 call to lockr_admin_csr_form()
lockr_admin_form in ./lockr.admin.inc
Form constructor for Lockr registration form.

File

include/csr_form.inc, line 14
Form handlers for CSR admin settings.

Code

function lockr_admin_csr_form() {
  $dn = variable_get('lockr_cert_dn', array());
  $form['description'] = array(
    '#prefix' => '<p>',
    '#markup' => 'Thank you for your interest in Lockr! ' . 'Our system is detecting that your website is not currently hosted by a supported provider. ' . 'Use the form below to create a development certificate and start using Lockr.',
    '#suffix' => '</p>',
  );
  $form['country'] = array(
    '#type' => 'textfield',
    '#title' => 'Country',
    '#default' => isset($dn['countryName']) ? $dn['countryName'] : NULL,
    '#maxlength' => 2,
    '#required' => TRUE,
    '#attributes' => array(
      'placeholder' => array(
        'US',
      ),
    ),
  );
  $form['state'] = array(
    '#type' => 'textfield',
    '#title' => 'State or Province',
    '#default' => isset($dn['stateOrProvinceName']) ? $dn['stateOrProvinceName'] : NULL,
    '#required' => TRUE,
    '#attributes' => array(
      'placeholder' => array(
        'Washington',
      ),
    ),
  );
  $form['city'] = array(
    '#type' => 'textfield',
    '#title' => 'Locality',
    '#default' => isset($dn['localityName']) ? $dn['localityName'] : NULL,
    '#required' => TRUE,
    '#attributes' => array(
      'placeholder' => array(
        'Seattle',
      ),
    ),
  );
  $form['organization'] = array(
    '#type' => 'textfield',
    '#title' => 'Organization',
    '#default' => isset($dn['organizationName']) ? $dn['organizationName'] : NULL,
    '#required' => TRUE,
    '#attributes' => array(
      'placeholder' => array(
        'ACME Inc.',
      ),
    ),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Create Certificate',
    '#validate' => array(
      'lockr_admin_csr_validate',
    ),
    '#submit' => array(
      'lockr_admin_csr_submit',
    ),
  );
  return $form;
}