function user_registrationpassword_install in User registration password 6
Same name and namespace in other branches
- 8 user_registrationpassword.install \user_registrationpassword_install()
- 7 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() {
$t = get_t();
// Set the correct default configuration settings
// so the module needs no more configuration.
// Enable account registration without e-mail confirmation.
variable_set('user_register', 1);
// Disable e-mail verification.
variable_set('user_email_verification', 0);
// Prevent standard notification email to administrators and to user.
variable_set('user_mail_register_pending_approval_notify', 0);
variable_set('user_mail_register_no_approval_required_notify', 0);
// Save the original activation email template to a temporally
// variable, so we can re-install it when we disable the module.
variable_set('user_mail_status_activated_subject_original', variable_get('user_mail_status_activated_subject', ''));
variable_set('user_mail_status_activated_body_original', variable_get('user_mail_status_activated_body', ''));
// Set basic e-mail template variable for the verification
// e-mail so it makes sense to new users.
variable_set('user_mail_status_activated_subject', $t('Account details for !username at !site', $variables, $langcode));
variable_set('user_mail_status_activated_body', $t("!username,\n\nYour account at !site has been activated.\n\nYou will be able to log in to !login_uri in the future using:\n\nusername: !username\npassword: your password.\n\n-- !site team\n"));
}