From 2934a3d9bd001fc746456696a818f36f40ed75c7 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 20 May 2007 12:34:48 +0000 Subject: - Patch #144859 by dww: added optional e-mail notifications when user are approved, blocked, or deleted. --- modules/system/system.install | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'modules/system') diff --git a/modules/system/system.install b/modules/system/system.install index 52809fa92..7bc70779f 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -4032,6 +4032,36 @@ function system_update_6016() { return $ret; } +/** + * Rename settings related to user.module email notifications. + */ +function system_update_6017() { + $ret = array(); + // Maps old names to new ones. + $var_names = array( + 'admin' => 'register_admin_created', + 'approval' => 'register_pending_approval', + 'welcome' => 'register_no_approval_required', + 'pass' => 'password_reset', + ); + foreach ($var_names as $old => $new) { + foreach (array('_subject', '_body') as $suffix) { + $old_name = 'user_mail_'. $old . $suffix; + $new_name = 'user_mail_'. $new . $suffix; + if ($old_val = variable_get($old_name, FALSE)) { + variable_set($new_name, $old_val); + variable_del($old_name); + $ret[] = array('success' => TRUE, 'query' => "variable_set($new_name)"); + $ret[] = array('success' => TRUE, 'query' => "variable_del($old_name)"); + if ($old_name == 'user_mail_approval_body') { + drupal_set_message(t('Saving an old value of the welcome message body for users that are pending administrator approval. However, you should consider modifying this text, since Drupal can now be configured to automatically notify users and send them their login infomation when their accounts are approved. See the !admin_user_settings page for details.', array('!admin_user_settings' => l(t('User settings'), 'admin/user/settings')))); + } + } + } + } + return $ret; +} + /** * @} End of "defgroup updates-5.x-to-6.x" * The next series of updates should start at 7000. -- cgit v1.2.3