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 -N -r1.10 -r1.10.2.1
--- openacs-4/packages/acs-authentication/tcl/password-procs.tcl 28 Oct 2003 14:29:12 -0000 1.10
+++ openacs-4/packages/acs-authentication/tcl/password-procs.tcl 12 Dec 2003 16:11:32 -0000 1.10.2.1
@@ -406,15 +406,20 @@
}
ad_proc -public auth::password::reset {
+ {-admin:boolean}
{-authority_id:required}
{-username:required}
} {
Reset the user's password, which means setting it to a new
randomly generated password and inform the user of that new
password.
- @param user_id The ID of the user whose password you want to reset.
+ @param admin Specify this flag if this call represents an admin changing a user's password.
+ @param authority_id The authority of the user
+
+ @param username The username of the user
+
@return An array list with the following entries:
} {
with_catch errmsg {
- array set result [auth::password::ResetPassword \
- -authority_id $authority_id \
- -username $username]
+ array set result [auth::password::ResetPassword \
+ -authority_id $authority_id \
+ -username $username]
# We do this so that if there aren't even a password_status in the array, that gets caught below
set dummy $result(password_status)
@@ -451,7 +456,11 @@
# Check the result code and provide canned responses
switch $result(password_status) {
ok {
- if { [exists_and_not_null result(password)] } {
+ if { [exists_and_not_null result(password)] && \
+ (!$admin_p || [parameter::get \
+ -parameter EmailChangedPasswordP \
+ -package_id [ad_conn subsite_id] \
+ -default 1]) } {
# We have retrieved or reset a forgotten password that we should email to the user
with_catch errmsg {
auth::password::email_password \
@@ -467,7 +476,7 @@
global errorInfo
ns_log Error "We had an error sending out email with new password to username $username, authority $authority_id:\n$errorInfo"
}
- }
+ }
if { ![exists_and_not_null result(password_message)] } {
set result(password_message) [_ acs-subsite.Check_Your_Inbox]
}