auth::get_user_id (public)
auth::get_user_id [ -level level ] [ -account_status account_status ]
Defined in packages/acs-authentication/tcl/authentication-procs.tcl
Get the current user_id with at least the level of security specified. If no user is logged in, or the user is not logged in at a sufficiently high security level, return 0.
- Switches:
- -level (optional, defaults to
"ok"
)- -account_status (optional, defaults to
"ok"
)- Returns:
- user_id of user, if the user is logged in, 0 otherwise.
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- auth__get_user_id
Source code: set untrusted_user_id [ad_conn untrusted_user_id] # Do we have any user_id at all? if { $untrusted_user_id == 0 } { return 0 } # Check account status if { $account_status eq "ok" && [ad_conn account_status] ne "ok" } { return 0 } array set levelv { none 0 expired 1 ok 2 secure 3 } # If HTTPS isn't available, we can't require secure authentication if { ![security::https_available_p] } { set levelv(secure) 2 } # Check if auth_level is sufficiently high if { $levelv([ad_conn auth_level]) < $levelv($level) } { return 0 } return $untrusted_user_idGeneric XQL file: packages/acs-authentication/tcl/authentication-procs.xql
PostgreSQL XQL file: packages/acs-authentication/tcl/authentication-procs-postgresql.xql
Oracle XQL file: packages/acs-authentication/tcl/authentication-procs-oracle.xql