You are here

function user_registrationpassword_install in User registration password 7

Same name and namespace in other branches
  1. 8 user_registrationpassword.install \user_registrationpassword_install()
  2. 6 user_registrationpassword.install \user_registrationpassword_install()

Implements hook_install().

File

./user_registrationpassword.install, line 11
Uninstall function to clean up variables data.

Code

function user_registrationpassword_install() {

  // Set the correct default configuration settings
  // so the module needs no more configuration.
  // Enable account registration without e-mail confirmation.
  variable_set('user_register', USER_REGISTER_VISITORS);

  // Disable e-mail verification.
  variable_set('user_email_verification', FALSE);

  // Prevent standard notification email to administrators and to user.
  variable_set('user_mail_register_pending_approval_notify', FALSE);
  variable_set('user_mail_register_no_approval_required_notify', FALSE);

  // Set the registration variable to 2, register
  // with pass, but require confirmation.
  variable_set('user_registrationpassword_registration', USER_REGISTRATIONPASSWORD_VERIFICATION_PASS);

  // Save the original activation email template to a temporally
  // variable, so we can revive them when we uninstall the module.
  variable_set('user_registrationpassword_user_mail_status_activated_subject_original', variable_get('user_mail_status_activated_subject', ''));
  variable_set('user_registrationpassword_user_mail_status_activated_body_original', variable_get('user_mail_status_activated_body', ''));

  // Set basic e-mail template variable for the
  // account activation e-mail so it makes sense.
  variable_set('user_mail_status_activated_subject', 'Account details for [user:name] at [site:name]');
  variable_set('user_mail_status_activated_body', '[user:name],

Your account at [site:name] has been activated.

You will be able to log in to [site:login-url] in the future using:

username: [user:name]
password: your password.

-- [site:name] team');
}