ad_get_login_url (public)
ad_get_login_url [ -authority_id authority_id ] [ -username username ] \ [ -return ] [ -external_registry external_registry ]
Defined in packages/acs-tcl/tcl/security-procs.tcl
Returns a URL to the login page of the closest subsite, or the main site, if there's no current connection.
- Switches:
- Options:
- -authority_id (optional)
- -username (optional)
- -return (optional, boolean)
- -external_registry (optional)
- -return
- If set, will export the current form, so when the registration is complete, the user will be returned to the current location. All variables in ns_getform (both posts and gets) will be maintained.
- Authors:
- Lars Pind <lars@collaboraid.biz>
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- login_logout_urls
Source code: # # Get the login_url 'url' and some more parameters form the # register subsite for this registry. # set subsite_info [security::get_register_subsite] foreach var {url require_qualified_return_url host_node_id} { set $var [dict get $subsite_info $var] } if { [ns_conn isconnected] && $return_p } { # # In a few cases, we do not need to add a fully qualified # return url. The secure cases have to be still tested. # if { !$require_qualified_return_url && ([security::secure_conn_p] || [ad_conn behind_secure_proxy_p] || ![security::RestrictLoginToSSLP] ) } { set return_url [ad_return_url] } else { set return_url [ad_return_url -qualified] } } if {$external_registry ne ""} { ns_log notice "the external registry $external_registry is used" # # We get here in cases of a refresh of a login, since we know # that the current user_id is expired, and the user has # registered via an external registry. Therefore, we use # the same external registry for the refresh. # # In general, we have two options: (a) redirect directly to # the external registry login page, or (b) redirect to an # external registry enhanced classical OpenACS login page. We # are here on the (a) path, since potentially, the external # identity managers allows one to continue without even showing a # login page (when it says, the login is still valid). # # The path (b) might be chosen via a future package parameter. # set url [$external_registry login_url -return_url $return_url] } else { append url "register/" # # Don't add a return_url if you're already under /register, # because that will frequently interfere with the normal login # procedure. # if { [string match "register/*" [ad_conn extra_url]] } { set return_url "" } if {$host_node_id == 0} { unset host_node_id } set url [export_vars -base $url -no_empty { authority_id username return_url host_node_id }] } ::security::log login_url "ad_get_login_url: final login_url <$url>" return $urlGeneric XQL file: packages/acs-tcl/tcl/security-procs.xql
PostgreSQL XQL file: packages/acs-tcl/tcl/security-procs-postgresql.xql
Oracle XQL file: packages/acs-tcl/tcl/security-procs-oracle.xql