Index: openacs-4/packages/acs-subsite/acs-subsite.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/acs-subsite.info,v diff -u -r1.35.2.12 -r1.35.2.13 --- openacs-4/packages/acs-subsite/acs-subsite.info 5 May 2003 09:27:36 -0000 1.35.2.12 +++ openacs-4/packages/acs-subsite/acs-subsite.info 6 Jun 2003 09:12:03 -0000 1.35.2.13 @@ -7,24 +7,21 @@ t f - - - + Michael Bryzek Oumi Mehrotra Rafael Schloming Michael Yoon Provides the ability to create subsite within the OpenACS Community System. - 2002-05-15 + 2003-05-28 OpenACS Aware of parties, groups, users, portraits, ... - + - + - @@ -54,10 +51,15 @@ - + + + + + + Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/approval-expiration-init.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/approval-expiration-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/approval-expiration-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/approval-expiration-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/index.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-subsite/www/index.tcl 16 Dec 2002 19:40:15 -0000 1.5.2.1 +++ openacs-4/packages/acs-subsite/www/index.tcl 6 Jun 2003 09:12:38 -0000 1.5.2.2 @@ -16,6 +16,14 @@ user_id:onevalue } +# We may have to redirect to some application page +set redirect_url [parameter::get -parameter IndexRedirectUrl -default {}] + +if { ![empty_string_p $redirect_url] } { + ad_returnredirect $redirect_url + ad_script_abort +} + set context [list] set package_id [ad_conn package_id] set admin_p [ad_permission_p $package_id admin] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/register/user-login-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/register/user-login-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/register/user-login.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/Attic/user-login.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/acs-subsite/www/register/user-login.tcl 18 Sep 2002 12:16:48 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/register/user-login.tcl 6 Jun 2003 09:13:00 -0000 1.3.2.1 @@ -33,10 +33,7 @@ set email [string tolower $email] -if { ![db_0or1row user_login_user_id_from_email { - select user_id, member_state, email_verified_p - from cc_users - where email = :email}] } { +if { ![db_0or1row user_login_user_id_from_email {}] } { # The user is not in the database. Redirect to user-new.tcl so the user can register. ad_set_client_property -persistent "f" register password $password @@ -54,6 +51,16 @@ ad_script_abort } if { [ad_check_password $user_id $password] } { + + set PasswordExpirationDays [parameter::get -parameter PasswordExpirationDays -default 0] + + # We also allow for empty value of password_age_days, in case the column is null after upgrading + if { $PasswordExpirationDays > 0 && ([empty_string_p $password_age_days] || $password_age_days > $PasswordExpirationDays) } { + # Password is expired, must be changed now + ad_returnredirect "[ad_conn package_url]/user/password-update?[export_vars { user_id return_url { expired_p 1 }}]" + ad_script_abort + } + # The user has provided a correct, non-empty password. Log # him/her in and redirect to return_url. ad_user_login -forever=$persistent_cookie_p $user_id Index: openacs-4/packages/acs-subsite/www/register/user-login.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/Attic/user-login.xql,v diff -u -r1.3 -r1.3.4.1 --- openacs-4/packages/acs-subsite/www/register/user-login.xql 9 Mar 2002 02:00:02 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/register/user-login.xql 6 Jun 2003 09:13:00 -0000 1.3.4.1 @@ -4,7 +4,7 @@ - select user_id, member_state, email_verified_p + select user_id, member_state, email_verified_p, password_changed_date from cc_users where email = lower(:email) 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.9 -r1.9.2.1 --- openacs-4/packages/acs-subsite/www/user/password-update-2.tcl 16 May 2002 21:17:44 -0000 1.9 +++ openacs-4/packages/acs-subsite/www/user/password-update-2.tcl 6 Jun 2003 09:13:49 -0000 1.9.2.1 @@ -27,6 +27,11 @@ ad_complain "Your passwords don't match! Presumably, you made a typo while entering one of them." } } + new_password_old_password_different -requires { new_password_match } { + if { [string equal $password_old $password_1] } { + ad_complain "Your new password is identical to your old password. If you don't want to change your password, use your browser's back button to get out." + } + } } if {[empty_string_p $user_id]} { @@ -43,7 +48,7 @@ ad_return_error "Wasn't able to change your password. Please contact the system administrator." } -if {![ad_conn user_id]} { +if { ![ad_conn user_id] } { ad_user_login $user_id } Index: openacs-4/packages/acs-subsite/www/user/password-update.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/password-update.adp,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/acs-subsite/www/user/password-update.adp 6 Sep 2002 21:50:12 -0000 1.8 +++ openacs-4/packages/acs-subsite/www/user/password-update.adp 6 Jun 2003 09:13:49 -0000 1.8.2.1 @@ -1,11 +1,21 @@ Update Password for @first_names@ @last_name@ in @site_link@ +@focus@ -
- - + +

+ Welcome to @system_name@. +

+

+ Your login was successful, but your password has expired, and must + be updated now, before you can proceed to use @system_name@. +

+
+ + @export_vars@ + 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.9 -r1.9.2.1 --- openacs-4/packages/acs-subsite/www/user/password-update.tcl 10 Sep 2002 22:22:14 -0000 1.9 +++ openacs-4/packages/acs-subsite/www/user/password-update.tcl 6 Jun 2003 09:13:49 -0000 1.9.2.1 @@ -7,6 +7,7 @@ {user_id ""} {return_url ""} {password_old ""} + {expired_p:boolean "0"} } -properties { first_names:onevalue last_name:onevalue @@ -19,6 +20,13 @@ set user_id [ad_verify_and_get_user_id] } +# We have a special provision here for expired passwords +# The user will not be logged in, but we're supposed to log them in after we're done +# We use template::util::is_true in order to be liberal in the input we accept +set expired_p [template::util::is_true $expired_p] + +set system_name [ad_system_name] + set admin_p [permission::permission_p -object_id $user_id -privilege admin] if {!$admin_p} { @@ -29,4 +37,12 @@ set site_link [ad_site_home_link] +set export_vars [export_vars -form { user_id return_url }] + +if { !$admin_p && [empty_string_p $password_old] } { + set focus "pwd.password_old" +} else { + set focus "pwd.password_1" +} + ad_return_template