--- loncom/interface/loncommon.pm 2017/08/03 16:22:09 1.1286 +++ loncom/interface/loncommon.pm 2017/08/07 20:22:13 1.1287 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1286 2017/08/03 16:22:09 raeburn Exp $ +# $Id: loncommon.pm,v 1.1287 2017/08/07 20:22:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -10137,7 +10137,16 @@ sub user_picker { $allow_blank = 0; $domform = &select_dom_form($currdom,'srchdomain',$allow_blank,1,undef,[$currdom]); } else { - $domform = &select_dom_form($currdom,'srchdomain',$allow_blank,1); + my $defdom = $env{'request.role.domain'}; + my ($trustedref,$untrustedref); + if (($context eq 'requestcrs') || ($context eq 'course')) { + ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('enroll',$defdom); + } elsif ($context eq 'author') { + ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('othcoau',$defdom); + } elsif ($context eq 'domain') { + ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('domroles',$defdom); + } + $domform = &select_dom_form($currdom,'srchdomain',$allow_blank,1,undef,$trustedref,$untrustedref); } my $srchinsel = '