one of the documented procedures in this installation of the ACS
im_user_is_customer   conn   args   why
What it does:
Returns filter_of if user is customer
Defined in: /web/philip/tcl/intranet-defs.tcl

Source code:

    set user_id [ad_get_user_id]
    if { $user_id == 0 } {
	# Not logged in
	ad_returnredirect "/register/index?return_url=[ns_urlencode [ns_conn url]?[ns_conn query]]"
	return filter_return
    set db [ns_db gethandle]
    set is_customer_p [im_user_is_customer_p $db $user_id]
    ns_db releasehandle $db 
    if { $is_customer_p > 0 } {
	return filter_ok
    } else {
	ad_return_error "Access denied" "You must be a customer of [ad_parameter SystemName] to see this page"
	return filter_return