--- loncom/interface/lonuserutils.pm 2010/01/20 20:28:40 1.97.2.6 +++ loncom/interface/lonuserutils.pm 2010/01/20 20:31:19 1.97.2.7 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.97.2.6 2010/01/20 20:28:40 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.97.2.7 2010/01/20 20:31:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1177,7 +1177,7 @@ sub default_role_selector { my %customroles; my ($options,$coursepick,$cb_jscript); if ($context ne 'author') { - %customroles = &my_custom_roles(); + %customroles = &my_custom_roles($crstype); } my %lt=&Apache::lonlocal::texthash( @@ -1351,10 +1351,14 @@ sub curr_role_permissions { # ======================================================= Existing Custom Roles sub my_custom_roles { + my ($crstype) = @_; my %returnhash=(); my %rolehash=&Apache::lonnet::dump('roles'); - foreach my $key (keys %rolehash) { + foreach my $key (keys(%rolehash)) { if ($key=~/^rolesdef\_(\w+)$/) { + if ($crstype eq 'Community') { + next if ($rolehash{$key} =~ /bre\&S/); + } $returnhash{$1}=$1; } } @@ -3903,7 +3907,7 @@ sub upfile_drop_add { } } my (%curr_rules,%got_rules,%alerts); - my %customroles = &my_custom_roles(); + my %customroles = &my_custom_roles($crstype); my @permitted_roles = &roles_on_upload($context,$setting,$crstype,%customroles); # Get new users list