You are here

function saml_sp_drupal_login__request_access in SAML Service Provider 7.3

Same name and namespace in other branches
  1. 7.8 modules/saml_sp_drupal_login/saml_sp_drupal_login.pages.inc \saml_sp_drupal_login__request_access()
  2. 7.2 modules/saml_sp_drupal_login/saml_sp_drupal_login.pages.inc \saml_sp_drupal_login__request_access()

allows a user to request access to the site

1 string reference to 'saml_sp_drupal_login__request_access'
saml_sp_drupal_login_menu in modules/saml_sp_drupal_login/saml_sp_drupal_login.module
Implements hook_menu().

File

modules/saml_sp_drupal_login/saml_sp_drupal_login.pages.inc, line 6

Code

function saml_sp_drupal_login__request_access() {
  if (variable_get('saml_sp_drupal_login__request_account', 0) === 0) {

    // the setting is disabled
    drupal_not_found();
    return;
  }
  $form = array();
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#description' => t('The name a site administrator would know you by.'),
  );
  $form['email'] = array(
    '#type' => 'textfield',
    '#title' => t('Email'),
    '#description' => t('The email address you would like associated with your account'),
    '#default_value' => isset($_GET['email']) && !empty($_GET['email']) && valid_email_address($_GET['email']) ? $_GET['email'] : '',
  );
  $form['explanation'] = array(
    '#type' => 'textarea',
    '#title' => t('Explanation'),
    '#description' => t('Why do you need an account for access to @site_name?', array(
      '@site_name' => variable_get('site_name', t('Drupal')),
    )),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}