Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.185 -r1.186 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 17 May 2004 15:15:02 -0000 1.185 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 29 Jun 2004 10:17:54 -0000 1.186 @@ -392,7 +392,7 @@ ad_proc -private get_default_roles_not_cached { {-community_type:required} } { - if {[string match $community_type dotlrn_club]} { + if {[string match $community_type dotlrn_club] || [string match $community_type dotlrn_pers_community]} { set community_type dotlrn_community } elseif {![string match $community_type dotlrn_community]} { set community_type dotlrn_class_instance @@ -665,13 +665,6 @@ } { Returns list of admin users } { - set bio_attribute_id [db_string bio_attribute_id { - select attribute_id - from acs_attributes - where object_type = 'person' - and attribute_name = 'bio' - }] - return [list_users -rel_type dotlrn_admin_rel $community_id] } @@ -681,8 +674,6 @@ } { Returns the list of users with a membership_id, a user_id, first name, last name, email, and role. - - AKS: uncaching this until we figure out how to cache ns_sets correctly } { return [dotlrn_community::list_users_not_cached \ -rel_type $rel_type \ @@ -696,6 +687,13 @@ } { Memoizing helper } { + set bio_attribute_id [db_string bio_attribute_id { + select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio' + }] + return [db_list_of_ns_sets select_users {}] } @@ -889,6 +887,18 @@ util_memoize_flush_regexp $user_id } + ad_proc -public remove_user_from_all { + {-user_id:required} + } { + Remove a user from all communities + } { + foreach community_ns_set [dotlrn_community::get_all_communities_by_user $user_id] { + set community_id [ns_set get $community_ns_set community_id] + if { [member_p $community_id $user_id] } { + dotlrn_community::remove_user $community_id $user_id + } + } + } ad_proc -public get_all_communities_by_user { user_id @@ -1154,7 +1164,7 @@ {-community_id:required} } { Returns a tcl list of ns_sets with info about each subcomm. The keys - are: community_id, community_key, pretty_name, and url + are: community_id, community_key, pretty_name, archived_p and url. Returns both archived and unarchived subcommunities. } { return [db_list_of_ns_sets select_subcomms_info {}] } @@ -1195,7 +1205,7 @@ set url [get_community_url $sc_id] append chunk "$pretext [get_community_name $sc_id]\n" - append chunk "[_ dotlrn.Drop]\n" + append chunk "([_ dotlrn.Drop])\n" append chunk "