one of the documented procedures in this installation of the ACS
ec_user_class_display   db   user_id   { link_p "f" }
What it does:
Displays a comma seperated list of the users user classes with a comment on its approval status if approval is required. If link_p is true, then a link is displayed to the admin/ecommerce/user-classes/ page for changing the approval status.
Defined in: /web/philip/tcl/ecommerce-defs.tcl

Source code:

    set to_return [list]

    set selection [ns_db select $db "select c.user_class_name, m.user_class_approved_p, c.user_class_id
    from ec_user_classes c, ec_user_class_user_map m
    where m.user_class_id = c.user_class_id
    and m.user_id=$user_id
    order by c.user_class_id"]
    while { [ns_db getrow $db $selection] } {

	if { [string compare $link_p "f"] != 0 } {
	    set to_append "<a href=\"/admin/ecommerce/user-classes/members?user_class_id=$user_class_id\">$user_class_name</a>"
	} else {
	    set to_append "$user_class_name"

	if { [ad_parameter UserClassApproveP ecommerce] } {
	    append to_append " <font size=-1>([ec_decode $user_class_approved_p "t" "approved" "unapproved"])</font>"
	lappend to_return $to_append

    return [join $to_return ", "]