auth::password::get_forgotten_url (public)
auth::password::get_forgotten_url [ -authority_id authority_id ] \ [ -username username ] [ -email email ] [ -remote_only ]
Defined in packages/acs-authentication/tcl/password-procs.tcl
Returns the URL to redirect to for forgotten passwords.
- Switches:
- -authority_id (optional)
- The ID of the authority that the user is trying to log into.
- -username (optional)
- The username that the user's trying to log in with.
- -email (optional)
- -remote_only (optional, boolean)
- If provided, only return any remote URL (not on this server).
- Returns:
- A URL that can be linked to when the user has forgotten his/her password, or the empty string if none can be found.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- auth_password_get_forgotten_url
Source code: if { $username ne "" } { set local_url [export_vars -no_empty -base "[subsite::get_element -element url]register/recover-password" { authority_id username }] } else { set local_url [export_vars -no_empty -base "[subsite::get_element -element url]register/recover-password" { email }] } set forgotten_pwd_url {} if { $username ne "" } { if { $authority_id eq "" } { set authority_id [auth::authority::local] } } else { set user_id [party::get_by_email -email $email] if { $user_id ne "" } { set user [acs_user::get_user_info -user_id $user_id] set authority_id [dict get $user authority_id] set username [dict get $user username] } } if { $username ne "" } { # We have the username or email set forgotten_pwd_url [auth::authority::get_element -authority_id $authority_id -element forgotten_pwd_url] if { $forgotten_pwd_url ne "" } { regsub -all "{username}" $forgotten_pwd_url $username forgotten_pwd_url } elseif { !$remote_only_p } { if { [auth::password::can_retrieve_p -authority_id $authority_id] || [auth::password::can_reset_p -authority_id $authority_id] } { set forgotten_pwd_url $local_url } } } else { # We don't have the username if { !$remote_only_p } { set forgotten_pwd_url "[subsite::get_element -element url]register/recover-password" } } return $forgotten_pwd_urlXQL Not present: Generic, PostgreSQL, Oracle