acs_user::get (public)
acs_user::get [ -user_id user_id ] [ -authority_id authority_id ] \ [ -username username ] [ -element element ] [ -array array ] \ [ -include_bio ]
Defined in packages/acs-tcl/tcl/community-core-procs.tcl
Get all information about a user, together with related person, party and object information. In case only user-specific information was needed, probably a better alternative could be acs_user::get_person_info.
The attributes returned are all those retrieved by person::get and acs_user::get_person_info.
- Switches:
- Options:
- -user_id (optional)
- User id to retrieve. Defaults to currently connected user.
- -authority_id (optional)
- if user_id was not specified, but a username was given, this proc will try to retrieve a user_id from username and authority. If authority_id is left blank, will default to the local authority.
- -username (optional)
- if specified and no user_id was give, will be used to retrieve user_id from the authority. If no user_id and no username were specified, proc will default to currently connected user.
- -element (optional)
- If specified, only this element in the dict will be returned. If an array was specified, This function will contain only this element.
- -array (optional)
- The name of an array into which you want the information put. This parameter is not mandatory, and the actual suggested way to retrieve information from this proc is to just set a variable from the return value and use it as a dict.
- -include_bio (optional, boolean)
- -include_bio
- Whether to include the bio in the user information. This flag is deprecated and bio will be now always returned.
- Returns:
- dict or a single string value if the
-element
parameter was specified.- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- acs_user::get_person_info
- person::get
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- auth_create_user, auth_password_reset, auth_authentication_implementations, sync_actions, sync_snapshot, sync_batch_ims_test, ad_proc_change_state_member
Source code: if { $user_id eq "" } { set user_id [expr {$username ne "" ? [acs_user::get_by_username -authority_id $authority_id -username $username] : [ad_conn user_id]}] } set data [person::get -person_id $user_id] # no person found = no user if {[llength $data] == 0} { return [list] } # query user info only if we don't have what was asked for already if {$element eq "" || ![dict exists $data $element]} { lappend data {*}[acs_user::get_user_info -user_id $user_id] } if {$element ne ""} { set data [expr {[dict exists $data $element] ? [dict get $data $element] : ""}] } if {$include_bio_p} { ns_log warning "acs_user::get: -include_bio flag is deprecated. Bio will be returned in any case." } if {[info exists array]} { upvar $array row if {$element eq ""} { array set row $data } else { set row($element) $data } } return $dataGeneric XQL file: packages/acs-tcl/tcl/community-core-procs.xql
PostgreSQL XQL file: packages/acs-tcl/tcl/community-core-procs-postgresql.xql
Oracle XQL file: packages/acs-tcl/tcl/community-core-procs-oracle.xql