--- loncom/interface/loncommon.pm 2011/01/03 14:58:05 1.948.2.22 +++ loncom/interface/loncommon.pm 2011/01/05 19:57:17 1.948.2.23 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.948.2.22 2011/01/03 14:58:05 raeburn Exp $ +# $Id: loncommon.pm,v 1.948.2.23 2011/01/05 19:57:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7820,7 +7820,7 @@ sub get_secgrprole_info { } sub user_picker { - my ($dom,$srch,$forcenewuser,$caller,$cancreate,$usertype) = @_; + my ($dom,$srch,$forcenewuser,$caller,$cancreate,$usertype,$context) = @_; my $currdom = $dom; my %curr_selected = ( srchin => 'dom', @@ -7911,10 +7911,15 @@ sub user_picker { $srchtypesel .= "\n \n"; my ($newuserscript,$new_user_create); - + my $context_dom = $env{'request.role.domain'}; + if ($context eq 'requestcrs') { + if ($env{'form.coursedom'} ne '') { + $context_dom = $env{'form.coursedom'}; + } + } if ($forcenewuser) { if (ref($srch) eq 'HASH') { - if ($srch->{'srchby'} eq 'uname' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchin'} eq 'dom' && $srch->{'srchdomain'} eq $env{'request.role.domain'}) { + if ($srch->{'srchby'} eq 'uname' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchin'} eq 'dom' && $srch->{'srchdomain'} eq $context_dom) { if ($cancreate) { $new_user_create = '

&"').'" onclick="javascript:setSearch(\'1\','.$caller.');" />

'; } else { @@ -7953,7 +7958,7 @@ function setSearch(createnew,callingForm } } for (var i=0; i