Index: openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql,v diff -u -r1.23 -r1.23.6.1 --- openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql 30 Sep 2003 13:11:39 -0000 1.23 +++ openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql 17 Jun 2004 01:58:07 -0000 1.23.6.1 @@ -6,7 +6,7 @@ select community_id - from dotlrn_communities + from dotlrn_communities_all where package_id = :package_id Index: openacs-4/packages/dotlrn/tcl/community-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs-postgresql.xql,v diff -u -r1.3 -r1.3.10.1 --- openacs-4/packages/dotlrn/tcl/community-procs-postgresql.xql 14 Aug 2002 19:22:24 -0000 1.3 +++ openacs-4/packages/dotlrn/tcl/community-procs-postgresql.xql 17 Jun 2004 01:58:07 -0000 1.3.10.1 @@ -6,7 +6,7 @@ select community_id - from dotlrn_communities + from dotlrn_communities_all where package_id = :package_id 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.183.2.3.4.2 -r1.183.2.3.4.3 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 20 May 2004 08:30:26 -0000 1.183.2.3.4.2 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 17 Jun 2004 01:58:07 -0000 1.183.2.3.4.3 @@ -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 @@ -887,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 @@ -1152,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 {}] } @@ -1779,27 +1791,27 @@ 1. the community is marked as archived 2. the RemovePortlet callback is called for all users of the - community (both members and GAs) and all the applets. This - removes the comm's data from their workspaces + community (both members and GAs) and all the applets. - 3. all users of the community have their "read" privs revoked on the - comm's portal so that only SWA's can view the archived community + 3. Do this recursively for all subcommunities. } { db_transaction { # do RemoveUserFromCommunity callback, which # calls the RemovePortlet proc with the right params + + foreach subcomm_id [get_subcomm_list -community_id $community_id] { + archive -community_id $subcomm_id + } + foreach user [list_users $community_id] { set user_id [ns_set get $user user_id] applets_dispatch \ - -community_id $community_id \ - -op RemoveUserFromCommunity \ - -list_args [list $community_id $user_id] + -community_id $community_id \ + -op RemoveUserFromCommunity \ + -list_args [list $community_id $user_id] } - # revoke privs - rel_segments_revoke_permission -community_id $community_id - # mark the community as archived db_dml update_archive_p {} } Index: openacs-4/packages/dotlrn/tcl/community-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v diff -u -r1.81.2.1.4.3 -r1.81.2.1.4.4 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 20 May 2004 05:08:36 -0000 1.81.2.1.4.3 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 17 Jun 2004 01:58:07 -0000 1.81.2.1.4.4 @@ -264,7 +264,7 @@ select community_type - from dotlrn_communities + from dotlrn_communities_all where community_id = :community_id @@ -292,9 +292,11 @@ select community_id, community_key, pretty_name, - url - from dotlrn_communities_full + archived_p, + dotlrn_community.url(community_id) as url + from dotlrn_communities_all where parent_community_id = :community_id + and archived_p = 'f' order by pretty_name @@ -345,7 +347,7 @@ select pretty_name - from dotlrn_communities + from dotlrn_communities_all where community_id = :community_id @@ -451,15 +453,15 @@ select portal_id - from dotlrn_communities + from dotlrn_communities_all where community_id = :community_id select non_member_portal_id - from dotlrn_communities + from dotlrn_communities_all where community_id = :community_id