Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-communities-create.sql,v diff -u -r1.32 -r1.33 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 20 Mar 2002 22:41:27 -0000 1.32 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 22 Mar 2002 22:23:54 -0000 1.33 @@ -421,7 +421,6 @@ / show errors - create or replace view dotlrn_communities_full as select dotlrn_communities.*, Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-users-create.sql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql 13 Mar 2002 18:00:38 -0000 1.10 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql 22 Mar 2002 22:23:54 -0000 1.11 @@ -45,7 +45,9 @@ registered_users.first_names, registered_users.last_name, registered_users.email, - dotlrn_user_types.type + dotlrn_user_types.type, + dotlrn_user_types.pretty_name as pretty_type, + dotlrn_user_types.group_id from dotlrn_user_profile_rels, acs_rels, registered_users, 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.86 -r1.87 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 22 Mar 2002 13:47:46 -0000 1.86 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 22 Mar 2002 22:23:54 -0000 1.87 @@ -455,7 +455,7 @@ } { Returns the list of users with a membership_id, a user_id, first name, last name, email, and role } { - return [db_list_of_lists select_users {}] + return [db_list_of_ns_sets select_users {}] } ad_proc -public list_possible_subcomm_users { @@ -465,7 +465,7 @@ are not already in the subcomm with a membership_id, a user_id, first name, last name, email, and role } { - return [db_list_of_lists select_possible_users {}] + return [db_list_of_ns_sets select_possible_users {}] } ad_proc -public list_users_in_role { @@ -1047,9 +1047,6 @@ } { Adds an applet to the community } { - - ns_log notice "aks debug add_applet_to_comm called with $applet_key" - db_transaction { # Callback set package_id [applet_call $applet_key AddAppletToCommunity [list $community_id]] @@ -1063,7 +1060,7 @@ # Go through current users and make sure they are added! foreach user [list_users $community_id] { - set user_id [lindex $user 2] + set user_id [ns_set get $user user_id] # do the callbacks applet_call $applet_key AddUserToCommunity [list $community_id $user_id] @@ -1084,7 +1081,7 @@ db_transaction { # Take care of all existing users foreach user [list_users $community_id] { - set user_id [lindex $user 2] + set user_id [ns_set get $user user_id] # do the callbacks applet_call $applet_key RemoveUserFromCommunity [list $community_id $user_id] @@ -1106,7 +1103,7 @@ db_transaction { # Remove all users foreach user [list_users $community_id] { - remove_user $community_id [lindex $user 2] + remove_user $community_id [ns_set get $user user_id] } # Remove all applets 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.40 -r1.41 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 20 Mar 2002 20:04:01 -0000 1.40 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 22 Mar 2002 22:23:54 -0000 1.41 @@ -108,56 +108,61 @@ - - - select rel_id, - rel_type, - users.user_id, - first_names, - last_name, - email - from registered_users users, - dotlrn_member_rels_approved - where community_id = :community_id - and users.user_id = dotlrn_member_rels_approved.user_id - order by rel_type - - + + + select dotlrn_member_rels_approved.rel_id, + dotlrn_member_rels_approved.rel_type, + dotlrn_member_rels_approved.role, + dotlrn_member_rels_approved.user_id, + registered_users.first_names, + registered_users.last_name, + registered_users.email + from registered_users, + dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = :community_id + and dotlrn_member_rels_approved.user_id = registered_users.user_id + order by dotlrn_member_rels_approved.rel_type + + - - - select parent.rel_id, - parent.rel_type, - users.user_id, - first_names, - last_name, - email - from registered_users users, - dotlrn_member_rels_approved parent, - dotlrn_communities dc - where dc.community_id = :subcomm_id - and dc.parent_community_id = parent.community_id - and users.user_id = parent.user_id - and users.user_id not in (select user_id from dotlrn_member_rels_approved where community_id = :subcomm_id) - order by parent.rel_type - - + + + select dotlrn_member_rels_approved.rel_id, + dotlrn_member_rels_approved.rel_type, + dotlrn_member_rels_approved.role, + dotlrn_member_rels_approved.user_id, + registered_users.first_names, + registered_users.last_name, + registered_users.email + from registered_users, + dotlrn_member_rels_approved, + dotlrn_communities + where dotlrn_communities.community_id = :subcomm_id + and dotlrn_communities.parent_community_id = dotlrn_member_rels_approved.community_id + and registered_users.user_id = dotlrn_member_rels_approved.user_id + and registered_users.user_id not in (select dm.user_id + from dotlrn_member_rels_approved dm + where dm.community_id = :subcomm_id) + order by dotlrn_member_rels_approved.rel_type + + - - - select rel_id, - rel_type, - users.user_id, - first_names, - last_name, - email - from registered_users users, - dotlrn_member_rels_approved - where community_id = :community_id - and users.user_id = dotlrn_member_rels_approved.user_id - and rel_type = :rel_type - - + + + select dotlrn_member_rels_approved.rel_id, + dotlrn_member_rels_approved.rel_type, + dotlrn_member_rels_approved.role, + dotlrn_member_rels_approved.user_id, + registered_users.first_names, + registered_users.last_name, + registered_users.email + from registered_users, + dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = :community_id + and dotlrn_member_rels_approved.user_id = registered_users.user_id + and dotlrn_member_rels_approved.rel_type = :rel_type + + Index: openacs-4/packages/dotlrn/www/members-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/members-chunk.adp 21 Mar 2002 16:46:49 -0000 1.8 +++ openacs-4/packages/dotlrn/www/members-chunk.adp 22 Mar 2002 22:23:54 -0000 1.9 @@ -9,7 +9,7 @@ (@users.email@)   - @users.rel_type@ + @users.role@   [] @@ -52,41 +52,25 @@   @pending_users.role@   - [ -  |  - + [ +  |  + ] - + -

Members of +

+ Members of <%= [dotlrn_community::get_parent_name -community_id $community_id] %> That Are Not Members of <%= [dotlrn_community::get_community_name $community_id] %>

NOT DONE YET! - + -
    - - -
  • - <%= [acs_community_member_link -user_id $parent_users(user_id) -label "$parent_users(first_names) $parent_users(last_name)"] %> - (@parent_users.email@) -   - -
  • -
    - -
- -
-
- -
Index: openacs-4/packages/dotlrn/www/members-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/members-chunk.tcl 19 Mar 2002 21:56:54 -0000 1.7 +++ openacs-4/packages/dotlrn/www/members-chunk.tcl 22 Mar 2002 22:23:54 -0000 1.8 @@ -32,20 +32,15 @@ } # Get all users for this community, including role -set list_of_users [dotlrn_community::list_users $community_id] +set community_members [dotlrn_community::list_users $community_id] -template::multirow create users rel_id rel_type user_id first_names last_name email +template::util::list_of_ns_sets_to_multirow \ + -rows $community_members \ + -var_name "users" set user_list [list] -foreach user $list_of_users { - lappend user_list [lindex $user 2] - template::multirow append users \ - [lindex $user 0] \ - [dotlrn_community::get_role_pretty_name_from_rel_type -rel_type [lindex $user 1]] \ - [lindex $user 2] \ - [lindex $user 3] \ - [lindex $user 4] \ - [lindex $user 5] +foreach user $community_members { + lappend user_list [ns_set get $community_members user_id] } db_multirow pending_users select_pending_users { @@ -60,32 +55,17 @@ and dotlrn_member_rels_full.member_state = 'needs approval' } - -# If we are in a subcomm. get the list of the users of the parent +# If we are in a subcomm. get the list of the users of the parent # comm that are not in the subcomm yet, and output them with radios # for roles, etc. - set subcomm_p [dotlrn_community::subcommunity_p -community_id $community_id] if {$subcomm_p} { - # Get all users for this community, including role - set list_of_parent_users [dotlrn_community::list_possible_subcomm_users \ - -subcomm_id $community_id] - - template::multirow create parent_users rel_id rel_type user_id first_names last_name email - - set parent_user_list [list] - foreach parent_user $list_of_parent_users { - lappend parent_user_list [lindex $parent_user 2] - template::multirow append parent_users \ - [lindex $parent_user 0] \ - [dotlrn_community::get_role_pretty_name_from_rel_type -rel_type [lindex $parent_user 1]] \ - [lindex $parent_user 2] \ - [lindex $parent_user 3] \ - [lindex $parent_user 4] \ - [lindex $parent_user 5] - } + template::util::list_of_ns_sets_to_multirow \ + -rows [dotlrn_community::list_possible_subcomm_users -subcomm_id $community_id] \ + -var_name "parent_users" + + form create parent_users_form } -ad_return_template - +ad_return_template Index: openacs-4/packages/dotlrn/www/admin/user-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/admin/user-oracle.xql 19 Mar 2002 01:23:15 -0000 1.3 +++ openacs-4/packages/dotlrn/www/admin/user-oracle.xql 22 Mar 2002 22:23:54 -0000 1.4 @@ -5,17 +5,13 @@ - select dotlrn_users.id, - dotlrn_users.type, - dotlrn_user_types.pretty_name as pretty_type, + select dotlrn_users.*, case when dotlrn_full_user_profile_rels.rel_id is null then 'Limited' else 'Full' end as access_level, acs_permission.permission_p(:dotlrn_package_id, :user_id, 'read_private_data') as read_private_data_p from dotlrn_users, - dotlrn_full_user_profile_rels, - dotlrn_user_types + dotlrn_full_user_profile_rels where dotlrn_users.user_id = :user_id and dotlrn_users.rel_id = dotlrn_full_user_profile_rels.rel_id(+) - and dotlrn_users.type = dotlrn_user_types.type Index: openacs-4/packages/dotlrn/www/admin/users-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/Attic/users-oracle.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/admin/users-oracle.xql 6 Mar 2002 00:08:02 -0000 1.5 +++ openacs-4/packages/dotlrn/www/admin/users-oracle.xql 22 Mar 2002 22:23:54 -0000 1.6 @@ -14,19 +14,20 @@ select count(*) - from cc_users - where not exists (select 1 - from dotlrn_users - where dotlrn_users.user_id = cc_users.user_id) - and member_state = 'approved' + from acs_rels + where acs_rels.object_id_one = acs.magic_object_id('registered_users') + and not exists (select 1 + from acs_rels a, dotlrn_user_types + where a.object_id_one = dotlrn_user_types.group_id + and a.object_id_two = acs_rels.object_id_two) select count(*) from cc_users - where member_state = 'banned' + where cc_users.member_state = 'banned'