im_customer_group_id_from_userWhat it does:
Sets group_id and short_name in the calling environment of the first customer_id this proc finds for the logged in userDefined in: /web/philip/tcl/intranet-defs.tcl
Source code:
uplevel { set local_user_id [ad_get_user_id] # set local_db [ns_db gethandle subquery] set selection [ns_db 0or1row $db "select g.group_id, g.short_name from user_groups g, user_group_map ugm where g.group_id=ugm.group_id and g.parent_group_id=[im_customer_group_id $db] and ugm.user_id=$local_user_id and rownum<2"] if { [empty_string_p $selection] } { set group_id "" set short_name "" } else { set_variables_after_query } # ns_db releasehandle $local_db }