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.55 -r1.56 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 11 Feb 2002 05:16:58 -0000 1.55 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 11 Feb 2002 20:17:52 -0000 1.56 @@ -310,6 +310,24 @@ return {} } + ad_proc -public get_all_roles {} { + return the list of roles used in dotLRN + } { + return {dotlrn_admin_rel dotlrn_member_rel dotlrn_instructor_rel dotlrn_ta_rel dotlrn_student_rel} + } + + ad_proc -public get_all_roles_as_options {} { + return the list of roles used in dotLRN + } { + set roles [list] + + foreach role [get_all_roles] { + lappend roles [list [get_role_pretty_name_from_rel_type -rel_type $role] $role] + } + + return $roles + } + ad_proc -public get_pretty_rel_type { rel_type } { @@ -447,6 +465,10 @@ } { Assigns a user to a particular role for that class. Roles in DOTLRN can be student, prof, ta, admin } { + if {[member_p $community_id $user_id]} { + return + } + db_transaction { # Set up a portal page for that user and that community set portal_id [portal::create \ Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 8 Feb 2002 20:50:57 -0000 1.23 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 11 Feb 2002 20:17:52 -0000 1.24 @@ -28,11 +28,17 @@ } ad_proc -public get_user_types {} { - return the list of possible user types, first type then group_id of the type + return the list of possible user types } { return [db_list_of_lists select_user_types {}] } + ad_proc -public get_user_types_as_options {} { + return the list of possible user types + } { + return [db_list_of_lists select_user_types_as_options {}] + } + ad_proc -public user_p { {-user_id:required} } { Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql 8 Feb 2002 20:50:57 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql 11 Feb 2002 20:17:52 -0000 1.6 @@ -4,6 +4,14 @@ + select type + from dotlrn_user_types + order by pretty_name + + + + + select pretty_name, type from dotlrn_user_types