Index: openacs-4/packages/acs-tcl/tcl/membership-rel-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/membership-rel-procs.tcl,v diff -u -r1.8.12.2 -r1.8.12.3 --- openacs-4/packages/acs-tcl/tcl/membership-rel-procs.tcl 26 Apr 2017 14:06:25 -0000 1.8.12.2 +++ openacs-4/packages/acs-tcl/tcl/membership-rel-procs.tcl 26 Apr 2017 14:22:05 -0000 1.8.12.3 @@ -103,22 +103,37 @@ change_state -rel_id $rel_id -state "needs approval" } - ad_proc -public get_user_id { + ad_proc -public get { {-rel_id:required} } { Return the user_id of a rel_id } { - set user_id [db_string select_rel_user_id { - select u.user_id + db_1row select_rel_id { + select u.user_id, r.object_id_one as group_id from acs_rels r, users u where r.rel_id = :rel_id and u.user_id = r.object_id_two - } -default {}] - - return $user_id + } + return [list user_id $user_id group_id $group_id] } + ad_proc -public get_user_id { + {-rel_id:required} + } { + Return the user_id of a rel_id + } { + return [dict get [get -rel_id $rel_id user_id]] + } + + ad_proc -public get_group_id { + {-rel_id:required} + } { + Return the group_id of a rel_id + } { + return [dict get [get -rel_id $rel_id group_id]] + } + } # Local variables: