Index: openacs-4/packages/acs-authentication/tcl/local-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/local-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-authentication/tcl/local-procs.tcl 25 Sep 2003 13:49:05 -0000 1.18 +++ openacs-4/packages/acs-authentication/tcl/local-procs.tcl 25 Sep 2003 16:07:41 -0000 1.19 @@ -433,12 +433,14 @@ if { $generated_pwd_p || \ [parameter::get -parameter RegistrationProvidesRandomPasswordP -default 0] || \ [parameter::get -parameter EmailRegistrationConfirmationToUserP -default 0] } { + with_catch errmsg { - ns_sendmail \ - $email \ - [parameter::get -parameter NewRegistrationEmailAddress -default [ad_system_owner]] \ - [_ acs-subsite.lt_Welcome_to_system_nam] \ - [_ acs-subsite.lt_Thank_you_for_visitin] + auth::password::email_password \ + -username $username \ + -authority_id $authority_id \ + -password $password \ + -message_type "Registration" \ + -from [parameter::get -parameter NewRegistrationEmailAddress -default [ad_system_owner]] } { # We don't fail hard here, just log an error global errorInfo Index: openacs-4/packages/acs-authentication/tcl/password-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/password-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-authentication/tcl/password-procs.tcl 25 Sep 2003 13:49:05 -0000 1.5 +++ openacs-4/packages/acs-authentication/tcl/password-procs.tcl 25 Sep 2003 16:07:41 -0000 1.6 @@ -481,19 +481,38 @@ {-username:required} {-authority_id:required} {-password:required} + {-message_type "Forgotten"} + {-subject_msg_key ""} + {-body_msg_key ""} + {-from ""} } { Send an email to ther user with given username and authority with the new password. + @param from The email's from address. Can be in email@foo.com format. + Defaults to ad_system_owner. + + @param message_type Forgotten, Registration, or Admin_creation. Will be expanded into full message keys + such as "acs-subsite.email_subject_Forgotten_password" and + "acs-subsite.email_body_Forgotten_password". + + @param subject_msg_key For even more control over the message going out, you can set this to the message key + you wish to use for the subject. Overrides message_type. + + @param body_msg_key For even more control over the message going out, you can set this to the message key + you wish to use for the body. Overrides message_type. + @return Does not return anything. Any errors caused by ns_sendmail are propagated @author Peter Marklund } { set user_id [acs_user::get_by_username -authority_id $authority_id -username $username] acs_user::get -user_id $user_id -array user + # Set up variables for use in message key set reset_password_url [export_vars -base "[ad_url]/user/password-update" {user_id {old_password $password}}] set system_owner [ad_system_owner] set system_name [ad_system_name] + set system_url [ad_url] if { [auth::UseEmailForLoginP] } { set account_id_label [_ acs-subsite.Email] set account_id $user(email) @@ -510,10 +529,33 @@ } set account_id_label [string range "$account_id_label[string repeat " " $length]" 0 [expr $length-1]] set password_label [string range "$password_label[string repeat " " $length]" 0 [expr $length-1]] - - set subject [_ acs-subsite.lt_Your_forgotten_passwo] - set body [_ acs-subsite.Forgotten_password_body] + + set first_names $user(first_names) + set last_name $user(last_name) + + if { [ad_conn untrusted_user_id] != 0 } { + acs_user::get -user_id [ad_conn untrusted_user_id] -array admin_user + set admin_first_names $admin_user(first_names) + set admin_last_name $admin_user(last_name) + } else { + set admin_first_names {} + set admin_last_name {} + } + if { [empty_string_p $subject_msg_key] } { + set subject_msg_key "acs-subsite.email_subject_${message_type}_password" + } + if { [empty_string_p $body_msg_key] } { + set body_msg_key "acs-subsite.email_body_${message_type}_password" + } + + set subject [_ $subject_msg_key] + set body [_ $body_msg_key] + + if { [empty_string_p $from] } { + set from [ad_system_owner] + } + # Send email ns_sendmail $user(email) $system_owner $subject $body } Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml,v diff -u -r1.25 -r1.26 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml 24 Sep 2003 17:25:18 -0000 1.25 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml 25 Sep 2003 16:07:41 -0000 1.26 @@ -1,17 +1,17 @@ - + About You - again - Answer: - answer: - at <p>Your account is currently closed.</p> <p>If you wish, we can <a href="%restore_url%">reopen your account</a>.</p> Your account at %system_name% has been reopened. Welcome back. Account Reopened + again + Answer: + answer: + at Awaiting Approval Bad Password Basic Information @@ -28,10 +28,51 @@ edit your alerts Email email address: + +%first_names% %last_name%, + +You have been added as a user to %system_name% +at %system_url% + +Here's how you can log in at %system_url%: + +%account_id_label%: %account_id% +%password_label%: %password% + +Please visit the following link to change your password now: + +%reset_password_url% + +Thank you, +%admin_first_names% %admin_last_name% + + Here is your new login information: + +%account_id_label%: %account_id% +%password_label%: %password% + +Please visit the following link to change your password now: + +%reset_password_url% + + Thank you for registering at %system_name%. + +Here's how you can log in at %system_url%: + +%account_id_label%: %account_id% +%password_label%: %password% + +Please visit the following link to change your password now: + +%reset_password_url% + Email Confirmation Email not Requested Email Password "email password" + You have been added as a user to %system_name% + Your forgotten password on %system_name% + Welcome to %system_name% Error sending mail Feature disabled First names