Index: openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl,v diff -u -r1.38 -r1.39 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 19 Sep 2003 15:01:18 -0000 1.38 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 19 Sep 2003 16:13:25 -0000 1.39 @@ -1085,16 +1085,12 @@ set authority_id [auth::authority::local] } - set account_found_p [db_0or1row select_user_info { - select user_id, - email, - member_state, - email_verified_p, - screen_name - from cc_users - where username = :username - and authority_id = :authority_id - }] + with_catch errmsg { + acs_user::get -authority_id $authority_id -username $username -array user + set account_found_p 1 + } { + set account_found_p 0 + } if { !$account_found_p } { # Local user account doesn't exist @@ -1116,14 +1112,15 @@ # Check local account status array set auth_info [auth::check_local_account_status \ - -user_id $user_id \ + -user_id $user(user_id) \ -return_url $return_url \ - -member_state $member_state \ - -email_verified_p $email_verified_p \ - -screen_name $screen_name] + -member_state $user(member_state) \ + -email_verified_p $user(email_verified_p) \ + -screen_name $user(screen_name) \ + -password_age_days $user(password_age_days)] # Return user_id - set auth_info(user_id) $user_id + set auth_info(user_id) $user(user_id) return [array get auth_info] } @@ -1135,6 +1132,7 @@ {-member_state:required} {-email_verified_p:required} {-screen_name:required} + {-password_age_days:required} } { Check the account status of a user with the given parameters. @@ -1151,6 +1149,9 @@ switch $member_state { approved { + set PasswordExpirationDays [parameter::get -parameter PasswordExpirationDays -package_id [ad_acs_kernel_id] -default 0] + + if { $email_verified_p == "f" } { if { !$no_dialogue_p } { set result(account_message) "

[_ acs-subsite.lt_Registration_informat]

[_ acs-subsite.lt_Please_read_and_follo]

" @@ -1163,13 +1164,16 @@ set result(account_message) "We got an error sending out the email for email verification" } } + } elseif { [string equal [acs_user::ScreenName] "require"] && [empty_string_p $screen_name] } { + set update_url [export_vars -no_empty -base "[subsite::get_element -element url]user/basic-info-update" { return_url {edit_p 1} }] + set result(account_message) "

Before we can let you in, you must setup a screen name.

» Update your profile now

" + } elseif { $PasswordExpirationDays > 0 && \ + ([empty_string_p $password_age_days] || $password_age_days > $PasswordExpirationDays) } { + + set password_url [export_vars -base "[subsite::get_element -element url]user/password-update" { return_url { expired_p 1 }}] + set result(account_message) "

Before we can let you in, you must change your password.

» Change your password now

" } else { - if { [string equal [acs_user::ScreenName] "require"] && [empty_string_p $screen_name] } { - set update_url [export_vars -no_empty -base "[subsite::get_element -element url]user/basic-info-update" { return_url {edit_p 1} }] - set result(account_message) "

Before we can let you in, you must setup a screen name.

»Update your profile now

" - } else { - set result(account_status) "ok" - } + set result(account_status) "ok" } } banned { @@ -1205,7 +1209,8 @@ -user_id $user_id \ -member_state $user(member_state) \ -email_verified_p $user(email_verified_p) \ - -screen_name $user(screen_name)] + -screen_name $user(screen_name) \ + -password_age_days $user(password_age_days)] set ok_p [expr [string equal $result(account_status) "ok"]] } Index: openacs-4/packages/acs-kernel/acs-kernel.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/acs-kernel.info,v diff -u -r1.36 -r1.37 --- openacs-4/packages/acs-kernel/acs-kernel.info 19 Sep 2003 13:13:22 -0000 1.36 +++ openacs-4/packages/acs-kernel/acs-kernel.info 19 Sep 2003 16:13:25 -0000 1.37 @@ -7,13 +7,13 @@ t t - + Don Baccus Routines and data models providing the foundation for OpenACS-based Web services. 2003-02-18 OpenACS - + @@ -67,6 +67,8 @@ + + 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.50 -r1.51 --- openacs-4/packages/acs-subsite/acs-subsite.info 12 Sep 2003 14:13:57 -0000 1.50 +++ openacs-4/packages/acs-subsite/acs-subsite.info 19 Sep 2003 16:13:25 -0000 1.51 @@ -7,28 +7,28 @@ t f - + OpenACS Provides the ability to create subsite within the OpenACS Community System. 2003-09-12 OpenACS Aware of parties, groups, users, portraits, ... - + - + + - @@ -43,7 +43,6 @@ - Index: openacs-4/packages/acs-subsite/tcl/approval-expiration-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/approval-expiration-init.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/approval-expiration-init.tcl 28 Aug 2003 09:41:39 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/approval-expiration-init.tcl 19 Sep 2003 16:13:25 -0000 1.3 @@ -8,12 +8,8 @@ } -# Get the main site node -array set main_site [site_node::get -url /] +set ApprovalExpirationDays [parameter::get -parameter ApprovalExpirationDays -package_id [ad_acs_kernel_id] -default 0] -# Get the package ID of the subsite mounted there -set ApprovalExpirationDays [parameter::get -parameter ApprovalExpirationDays -package_id $main_site(package_id) -default 0] - # Only schedule proc if we've set approvals to expire if { $ApprovalExpirationDays > 0 } { # Schedule proc to run once nightly Index: openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 19 Sep 2003 12:58:52 -0000 1.9 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 19 Sep 2003 16:13:25 -0000 1.10 @@ -94,6 +94,54 @@ application_group::delete -group_id [application_group::group_id_from_package_id -package_id $package_id] } +ad_proc -public subsite::before_upgrade { + {-from_version_name:required} + {-to_version_name:required} +} { + Handles upgrade +} { + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 5.0d3 5.0d4 { + array set main_site [site_node::get -url /] + set main_site_id $main_site(package_id) + + # Move parameter values from subsite to kernel + + parameter::set_value \ + -package_id [ad_acs_kernel_id] \ + -parameter ApprovalExpirationDays \ + -value [parameter::get \ + -package_id $main_site_id \ + -parameter ApprovalExpirationDays \ + -default 0] + + parameter::set_value \ + -package_id [ad_acs_kernel_id] \ + -parameter PasswordExpirationDays \ + -value [parameter::get \ + -package_id $main_site_id \ + -parameter PasswordExpirationDays \ + -default 0] + + + apm_parameter_unregister \ + -package_key acs-subsite \ + -parameter ApprovalExpirationDays \ + {} + + apm_parameter_unregister \ + -package_key acs-subsite \ + -parameter PasswordExpirationDays \ + {} + } + } +} + + + ad_proc -private subsite::instance_name_exists_p { node_id instance_name Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -r1.52 -r1.53 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 10 Sep 2003 09:34:14 -0000 1.52 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 19 Sep 2003 16:13:25 -0000 1.53 @@ -758,13 +758,22 @@ } ad_proc -public apm_parameter_unregister { - { - -callback apm_dummy_callback - } + {-callback apm_dummy_callback} + {-package_key ""} + {-parameter ""} parameter_id } { Unregisters a parameter from the system. } { + if { [empty_string_p $parameter_id] } { + set parameter_id [db_string select_parameter_id { + select parameter_id + from apm_parameters + where package_key = :package_key + and parameter_name = :parameter + }] + } + ns_log Debug "APM Unregistering parameter $parameter_id." db_foreach all_parameters_packages { select package_id, parameter_id, parameter_name Index: openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql 12 Sep 2003 12:34:55 -0000 1.9 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql 19 Sep 2003 16:13:25 -0000 1.10 @@ -58,4 +58,69 @@ + + + + select user_id, + username, + authority_id, + first_names, + last_name, + first_names || ' ' || last_name as name, + email, + url, + screen_name, + priv_name, + priv_email, + email_verified_p, + email_bouncing_p, + no_alerts_until, + last_visit, + second_to_last_visit, + n_sessions, + password_question, + password_answer, + password_changed_date, + member_state, + rel_id, + trunc(sysdate - password_changed_date) as password_age_days + from cc_users + where user_id = :user_id + + + + + + + + select user_id, + username, + authority_id, + first_names, + last_name, + first_names || ' ' || last_name as name, + email, + url, + screen_name, + priv_name, + priv_email, + email_verified_p, + email_bouncing_p, + no_alerts_until, + last_visit, + second_to_last_visit, + n_sessions, + password_question, + password_answer, + password_changed_date, + member_state, + rel_id, + trunc(sysdate - password_changed_date) as password_age_days + from cc_users + where authority_id = :authority_id + and username = :username + + + + Index: openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql 12 Sep 2003 12:34:55 -0000 1.12 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql 19 Sep 2003 16:13:25 -0000 1.13 @@ -54,4 +54,69 @@ + + + + select user_id, + username, + authority_id, + first_names, + last_name, + first_names || ' ' || last_name as name, + email, + url, + screen_name, + priv_name, + priv_email, + email_verified_p, + email_bouncing_p, + no_alerts_until, + last_visit, + second_to_last_visit, + n_sessions, + password_question, + password_answer, + password_changed_date, + member_state, + rel_id, + trunc(date_part('epoch', age(password_changed_date))/(60*60*24)) as password_age_days + from cc_users + where user_id = :user_id + + + + + + + + select user_id, + username, + authority_id, + first_names, + last_name, + first_names || ' ' || last_name as name, + email, + url, + screen_name, + priv_name, + priv_email, + email_verified_p, + email_bouncing_p, + no_alerts_until, + last_visit, + second_to_last_visit, + n_sessions, + password_question, + password_answer, + password_changed_date, + member_state, + rel_id, + trunc(date_part('epoch', age(password_changed_date))/(60*60*24)) as password_age_days + from cc_users + where authority_id = :authority_id + and username = :username + + + + Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 8 Sep 2003 16:06:15 -0000 1.8 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 19 Sep 2003 16:13:25 -0000 1.9 @@ -97,69 +97,6 @@ - - - - select user_id, - username, - authority_id, - first_names, - last_name, - first_names || ' ' || last_name as name, - email, - url, - screen_name, - priv_name, - priv_email, - email_verified_p, - email_bouncing_p, - no_alerts_until, - last_visit, - second_to_last_visit, - n_sessions, - password_question, - password_answer, - password_changed_date, - member_state, - rel_id - from cc_users - where user_id = :user_id - - - - - - - - select user_id, - username, - authority_id, - first_names, - last_name, - first_names || ' ' || last_name as name, - email, - url, - screen_name, - priv_name, - priv_email, - email_verified_p, - email_bouncing_p, - no_alerts_until, - last_visit, - second_to_last_visit, - n_sessions, - password_question, - password_answer, - password_changed_date, - member_state, - rel_id - from cc_users - where authority_id = :authority_id - and username = :username - - - -