| |
|
1 |
ad_include_contract { |
| |
|
2 |
|
| |
|
3 |
Password update form |
| |
|
4 |
|
| |
|
5 |
} { |
| |
|
6 |
user_id:naturalnum,notnull |
| |
|
7 |
{return_url:localurl ""} |
| |
|
8 |
} |
| |
|
9 |
|
| |
1 |
10 |
# Redirect to HTTPS if so configured |
| |
2 |
11 |
if { [security::RestrictLoginToSSLP] } { |
| |
3 |
12 |
security::require_secure_conn |
| |
4 |
13 |
} |
| |
5 |
14 |
|
| |
6 |
|
set level [ad_decode [security::RestrictLoginToSSLP] 1 "secure" "ok"] |
| |
|
15 |
set level [expr {[security::RestrictLoginToSSLP] == 1 ? "secure" : "ok"}] |
| |
7 |
16 |
|
| |
8 |
17 |
# If the user is changing passwords for another user, they need to be account ok |
| |
9 |
|
set account_status [ad_decode $user_id [ad_conn untrusted_user_id] "closed" "ok"] |
| |
|
18 |
set account_status [expr {$user_id == [ad_conn untrusted_user_id] ? "closed" : "ok"}] |
| |
10 |
19 |
|
| |
11 |
20 |
auth::require_login \ |
| |
12 |
21 |
-level $level \ |
| |
13 |
22 |
-account_status $account_status |
| |
14 |
23 |
|
| |
15 |
24 |
if { ![auth::password::can_change_p -user_id $user_id] } { |
| |
16 |
25 |
ad_return_error "Not supported" "Changing password is not supported." |
| |
17 |
26 |
ad_script_abort |
| |
18 |
27 |
} |
| |
19 |
28 |
|
| |
20 |
29 |
set page_title [_ acs-subsite.Update_Password] |
| |
21 |
30 |
set context [list [list [ad_pvt_home] [ad_pvt_home_name]] $page_title] |
| |
22 |
31 |
|
| |
23 |
32 |
set system_name [ad_system_name] |
| |
24 |
33 |
set site_link [ad_site_home_link] |
| |
25 |
34 |
|
| |
26 |
35 |
|
| |
27 |
36 |
|
| |
28 |
37 |
acs_user::get -user_id $user_id -array user |
| |
29 |
38 |
|