Index: openacs-4/packages/acs-subsite/tcl/callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/callback-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/tcl/callback-procs.tcl 25 Jun 2007 19:37:10 -0000 1.5 +++ openacs-4/packages/acs-subsite/tcl/callback-procs.tcl 26 Jun 2007 00:02:42 -0000 1.6 @@ -18,15 +18,6 @@ @see callback::user::workspace::impl::acs-subsite } - -ad_proc -public -callback group::add_member { - -group_id - -user_id - -rel_type - -member_state -} { - Used to perform actions when a user is added to a group -} - - ad_proc -public -callback user::workspace -impl acs-subsite { -user_id } { Index: openacs-4/packages/acs-subsite/tcl/group-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-procs.tcl,v diff -u -r1.33 -r1.34 --- openacs-4/packages/acs-subsite/tcl/group-procs.tcl 25 Jun 2007 19:37:10 -0000 1.33 +++ openacs-4/packages/acs-subsite/tcl/group-procs.tcl 26 Jun 2007 00:02:42 -0000 1.34 @@ -672,46 +672,13 @@ -create_p $create_p] } - if { $rel_type eq "organization_rel" } { - # They are using the special organization_rel which - # needs to be added differently since organizations - # can be part of a group which violates the membership_rel - # constraint for a group member to be a person see: - # http://openacs.org/forums/message-view?message_id=1059049 - # - # The organization_rel behaves exactly like a basic membership_rel - # and uses the exact same tables, but it allows an organization - # to be a member of a group. If the constraint is dropped/changed - # then this code could be cleaned up to act like the other rel - # types listed below - and potentially all organization_rels can be - # updated and changed into membership_rels - - set existing_rel_id [db_string rel_exists { - select rel_id - from acs_rels - where rel_type = :rel_type - and object_id_one = :group_id - and object_id_two = :user_id - } -default {}] - if { [empty_string_p $existing_rel_id] } { - set peeraddr [ad_conn peeraddr] - set creation_user [ad_conn user_id] - set rel_id [db_string insert_rels { select acs_rel__new (NULL::integer,:rel_type,:group_id,:user_id,NULL,:creation_user,:peeraddr) as org_rel_id }] - db_dml insert_state { insert into membership_rels (rel_id,member_state) values (:rel_id,:member_state) } - } else { - # update member state - db_dml update_state { update membership_rels set member_state = :member_state where rel_id = :existing_rel_id } - } - } else { - if { $rel_type ne "membership_rel" } { - # add them with a membership_rel first - relation_add -member_state $member_state "membership_rel" $group_id $user_id - } - relation_add -member_state $member_state $rel_type $group_id $user_id - } + if { $rel_type ne "membership_rel" } { + # add them with a membership_rel first + relation_add -member_state $member_state "membership_rel" $group_id $user_id + } + relation_add -member_state $member_state $rel_type $group_id $user_id + flush_members_cache -group_id $group_id - - callback group::add_member -group_id $group_id -user_id $user_id -rel_type $rel_type -member_state $member_state }