Index: openacs-4/packages/acs-subsite/www/register/email-password-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/Attic/email-password-2.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/www/register/email-password-2.tcl 17 Apr 2002 20:43:40 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/register/email-password-2.tcl 17 Apr 2002 21:58:15 -0000 1.6 @@ -68,7 +68,7 @@ set subject "Your forgotten password on $system_name" set body "Please follow the following link to reset your password: -[ad_url]/user/password-update?[export_vars {{password_old $password}}] +[ad_url]/user/password-update?[export_vars {user_id {password_old $password}}] " Index: openacs-4/packages/acs-subsite/www/user/password-update-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/Attic/password-update-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/user/password-update-2.tcl 15 Apr 2002 22:40:50 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/user/password-update-2.tcl 17 Apr 2002 21:58:15 -0000 1.4 @@ -6,61 +6,39 @@ @cvs-id $Id$ } -query { - password_1 - password_2 + password_1:notnull + password_2:notnull {password_old ""} - {user_id ""} + {user_id:integer ""} {return_url ""} +} -validate { + old_password_match -requires {user_id:integer password_old} { + if {![empty_string_p $user_id] && ![ad_check_password $user_id $password_old]} { + ad_complain "Your current password does not match what you entered in the form." + } + } + confirm_password -requires {password_2:notnull} { + if {[empty_string_p $password_2]} { + ad_complain "You need to confirm the password that you typed. (Type the same thing again.)" + } + } + new_password_match -requires {password_1:notnull password_2:notnull confirm_password} { + if {![string equal $password_1 $password_2]} { + ad_complain "Your passwords don't match! Presumably, you made a typo while entering one of them." + } + } } -properties { return_url:onevalue site_link:onevalue } -set current_user_id [ad_verify_and_get_user_id] - if {[empty_string_p $user_id]} { - set user_id $current_user_id - set admin_enabled_p 0 - ad_require_permission $user_id "write" + set user_id [ad_verify_and_get_user_id] + permission::require_permission -party_id $user_id -object_id $user_id -privilege "write" } else { - set admin_enabled_p 1 - ad_require_permission $user_id "admin" + permission::require_permission -party_id $user_id -object_id $user_id -privilege "admin" } -set bind_vars [ad_tcl_vars_to_ns_set user_id password_1] - -set exception_text "" -set exception_count 0 - -if {!$admin_enabled_p && ![ad_check_password $user_id $password_old] } { - ns_log "Notice" "password matched" - append exception_text "
Current Password: | @@ -22,7 +21,6 @@
---|
New Password: | Index: openacs-4/packages/acs-subsite/www/user/password-update.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/password-update.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/user/password-update.tcl 15 Apr 2002 22:40:50 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/user/password-update.tcl 17 Apr 2002 21:58:15 -0000 1.4 @@ -15,26 +15,16 @@ site_link:onevalue } -set current_user_id [ad_verify_and_get_user_id] - -if [empty_string_p $user_id] { - set user_id $current_user_id - set admin_enabled_p 0 - ad_require_permission $user_id "write" +if {[empty_string_p $user_id]} { + set user_id [ad_verify_and_get_user_id] + permission::require_permission -party_id $user_id -object_id $user_id -privilege "write" } else { - set admin_enabled_p 1 - ad_require_permission $user_id "admin" + permission::require_permission -party_id $user_id -object_id $user_id -privilege "admin" } -set bind_vars [ad_tcl_vars_to_ns_set user_id] - db_1row user_information {} -if {$admin_enabled_p} { - set export_vars [export_form_vars return_url user_id] -} else { - set export_vars [export_form_vars return_url] -} +set export_vars [export_form_vars return_url user_id] set site_link [ad_site_home_link]