Index: logintoboggan.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/logintoboggan/logintoboggan.module,v
retrieving revision 1.83.2.39
diff -u -p -r1.83.2.39 logintoboggan.module
--- logintoboggan.module 9 Jun 2008 19:17:00 -0000 1.83.2.39
+++ logintoboggan.module 23 Dec 2008 23:16:18 -0000
@@ -288,13 +288,13 @@ function logintoboggan_user_register_sub
// Compose the appropriate user message--admin approvals don't require a validation e-mail.
if($reg_pass_set && variable_get('user_register', 1) == 1) {
if ($pre_auth) {
- $message = t('A validation e-mail has been sent to your e-mail address. In order to gain full access to the site, you will need to follow the instructions in that message.');
+ $message = variable_get('toboggan_preauth_welcome_msg', _logintoboggan_messages('preauth_welcome_msg'));
}
else {
$message = '';
}
} else {
- $message = t('Your password and further instructions have been sent to your e-mail address.');
+ $message = variable_get('toboggan_welcome_msg', _logintoboggan_messages('welcome_msg'));
}
if (variable_get('user_register', 1) == 1) {
@@ -621,6 +621,33 @@ function logintoboggan_main_settings() {
'#description' => t('Normally, after a user confirms their new account, they will be taken to their user page. Leave this setting blank if you wish to keep the default behavior. If you wish the user to go to a page of your choosing, then enter the path for it here. For instance, you may redirect them to a static page such as node/35, or to the <front> page. You may also use %uid as a variable, and the user\'s user ID will be substituted in the path.'),
);
+ $form['messages'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Messages'),
+ '#tree' => FALSE,
+ );
+
+ $form['messages']['toboggan_preauth_welcome_msg'] = array(
+ '#type' => 'textarea',
+ '#title' => t('Preauthentication welcome message'),
+ '#default_value' => variable_get('toboggan_preauth_welcome_msg', _logintoboggan_messages('preauth_welcome_msg')),
+ '#description' => t('Message to display users who need to authenticate their e-mail address.'),
+ );
+
+ $form['messages']['toboggan_welcome_msg'] = array(
+ '#type' => 'textarea',
+ '#title' => ('Welcome message'),
+ '#default_value' => variable_get('toboggan_welcome_msg', _logintoboggan_messages('welcome_msg')),
+ '#description' => t('Message to display users without validation needs.'),
+ );
+
+ $form['messages']['toboggan_validate_success_msg'] = array(
+ '#type' => 'textarea',
+ '#title' => t('Validate success message'),
+ '#default_value' => variable_get('toboggan_validate_success_msg', _logintoboggan_messages('validate_success_msg')),
+ '#description' => t('Message to display users after validating their email address.'),
+ );
+
$form['other'] = array('#type' => 'fieldset',
'#title' => t('Other'),
'#tree' => FALSE,
@@ -796,7 +823,7 @@ function logintoboggan_validate_email($u
case 'login':
// Only show the validated message if there's a valid pre-auth role.
if ($pre_auth) {
- drupal_set_message(t('You have successfully validated your e-mail address.'));
+ drupal_set_message(variable_get('toboggan_validate_success_msg', _logintoboggan_messages('validate_success_msg')));
}
if (!$account->status) {
drupal_set_message(t('Your account is currently blocked -- login cancelled.'), 'error');
@@ -993,6 +1020,17 @@ function logintoboggan_flip_user_email_v
variable_set('user_email_verification', $value);
}
+function _logintoboggan_messages($msgid) {
+ switch ($msgid) {
+ case 'preauth_welcome_msg':
+ return t('A validation e-mail has been sent to your e-mail address. In order to gain full access to the site, you will need to follow the instructions in that message.');
+ case 'welcome_msg':
+ return t('Your password and further instructions have been sent to your e-mail address.');
+ case 'validate_success_msg':
+ return t('You have successfully validated your e-mail address.');
+ }
+}
+
/**
*
* THEME FUNCTIONS!