<?php

/**
 * Implements hook_variable_info().
 */
function logintoboggan_variable_variable_info($options) {
  $variables = array(
    'logintoboggan_confirm_email_at_registration' => array(
      'title' => t('Use two e-mail fields on registration form', array(), $options),
      'description' => t('User will have to type the same e-mail address into both fields. This helps to confirm that they\'ve typed the correct address.', array(), $options),
      'default' => 0,
      'type' => 'boolean',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_immediate_login_on_register' => array(
      'title' => t('Immediate login', array(), $options),
      'description' => t('If set, the user will be logged in immediately after registering.', array(), $options),
      'default' => TRUE,
      'type' => 'boolean',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_login_successful_message' => array(
      'title' => t('Display login successful message', array(), $options),
      'description' => t('If enabled, users will receive a \'Log in successful\' message upon login.', array(), $options),
      'default' => 0,
      'type' => 'boolean',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_login_with_email' => array(
      'title' => t('Allow users to login using their e-mail address', array(), $options),
      'description' => t('Users will be able to enter EITHER their username OR their e-mail address to log in.', array(), $options),
      'default' => 0,
      'type' => 'boolean',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_minimum_password_length' => array(
      'title' => t('Minimum password length', array(), $options),
      'description' => t('The minimum number of password characters required on the registration form.', array(), $options),
      'default' => 0,
      'type' => 'number',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_override_destination_parameter' => array(
      'title' => t('Override destination parameter', array(), $options),
      'description' => t('Normally, when a Drupal redirect is performed, priority is given to the \'destination\' parameter from the originating URL. With this setting enabled, LoginToboggan will attempt to override this behavior.', array(), $options),
      'default' => 1,
      'type' => 'boolean',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_pre_auth_role' => array(
      'title' => t('Non-authenticated role', array(), $options),
      'description' => t('The role that is assigned to users that have supplied a password during the registration process but have not yet clicked on the link in their welcome email.', array(), $options),
      'default' => DRUPAL_AUTHENTICATED_RID,
      'type' => 'number',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_purge_unvalidated_user_interval' => array(
      'title' => t('Unvalidated user purge interval', array(), $options),
      'description' => t('The time interval in seconds after which users will be deleted who have registered but not yet clicked on the link in their welcome email.', array(), $options),
      'default' => 0,
      'type' => 'number',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_redirect_on_confirm' => array(
      'title' => t('Redirect path on confirmation', array(), $options),
      'description' => t('The path the user will be redirected to after confiming their account.', array(), $options),
      'default' => '',
      'type' => 'url',
      'group' => 'user_settings',
      'localize' => TRUE,
    ),
    'logintoboggan_redirect_on_register' => array(
      'title' => t('Redirect path on registration', array(), $options),
      'description' => t('The path the user will be redirected to after registering.', array(), $options),
      'default' => '',
      'type' => 'url',
      'group' => 'user_settings',
      'localize' => TRUE,
    ),
    'logintoboggan_unified_login' => array(
      'title' => t('Present a unified login/registration page', array(), $options),
      'description' => t('Use one page for both login and registration instead of Drupal\'s tabbed login/registration/password pages.', array(), $options),
      'default' => '0',
      'type' => 'boolean',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
    'logintoboggan_user_email_verification' => array(
      'title' => t('Supply password when registering', array(), $options),
      'description' => t('Allows users to type in their password in the registration form.', array(), $options),
      'default' => !variable_get('user_email_verification', TRUE) ? 1 : 0,
      'type' => 'boolean',
      'group' => 'user_settings',
      'localize' => FALSE,
    ),
  );
  return $variables;
}

