address_book_name dbWhat it does:
assumes scope is set in the callers environment. if scope=group it assumes group_id is set in the callers environment, if scope=user it assumes that user_id is set in callers environment. For scope=group, returns the name of the group if the user is authorized. For scope=user, returns the person's name. For scope=public, returns the site name. For scope=table it returns an empty string.Defined in: /web/philip/tcl/address-book-defs.tcl
Source code:
upvar scope scope
switch $scope {
"public" {
return [ad_system_name]
}
"group" {
upvar group_id group_id
return [database_to_tcl_string_or_null $db "select group_name from user_groups where group_id = $group_id"]
}
"user" {
upvar user_id user_id
return [database_to_tcl_string_or_null $db "select first_names || ' ' || last_name from users where user_id = [ad_get_user_id]"]
}
"table" {
return ""
}
}