Index: openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl 16 Sep 2005 15:48:55 -0000 1.12 +++ openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl 25 Sep 2005 12:35:53 -0000 1.13 @@ -55,6 +55,16 @@ organization and then do something with them accordingly. } - +ad_proc -public -callback contact::organization_new_rel { + {-party_id:required} + {-object_id_two:required} + {-rel_type:required} +} { + This is a callback that is executed when you add a new organization in a relationship. + This will enable other packages to check if the organization is added into a special relationship + and then do something with them accordingly. +} - + ad_proc -public -callback contact::history { {-party_id:required} {-multirow:required} @@ -174,8 +184,11 @@ set employee_list [contact::util::get_employees -organization_id $organization_id] foreach employee_id $employee_list { - # Just to be on the save side, we actually check if the user is already in .LRN - dotlrn::user_add -user_id $employee_id - dotlrn_club::add_user -community_id $club_id -user_id $employee_id + # Only add the user if the user is already in the system as a user, not a person. + if {[contact::user_p $employee_id]} { + # Just to be on the save side, we actually check if the user is already in .LRN + dotlrn::user_add -user_id $employee_id + dotlrn_club::add_user -community_id $club_id -user_id $employee_id + } } } \ No newline at end of file