--- loncom/interface/loncreateuser.pm 2009/08/06 05:48:56 1.304
+++ loncom/interface/loncreateuser.pm 2009/08/06 20:40:59 1.305
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.304 2009/08/06 05:48:56 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.305 2009/08/06 20:40:59 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5631,17 +5631,27 @@ sub build_search_response {
$response .= '
'.&mt('You may want to broaden your search to the selected LON-CAPA domain.');
}
}
- if (!($srch->{'srchby'} eq 'uname' && $srch->{'srchin'} eq 'dom' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchdomain'} eq $env{'request.role.domain'})) {
+ my $createdom = $env{'request.role.domain'};
+ if ($context eq 'requestcrs') {
+ if ($env{'form.coursedom'} ne '') {
+ $createdom = $env{'form.coursedom'};
+ }
+ }
+ if (!($srch->{'srchby'} eq 'uname' && $srch->{'srchin'} eq 'dom' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchdomain'} eq $createdom)) {
my $cancreate =
- &Apache::lonuserutils::can_create_user($env{'request.role.domain'},$context);
+ &Apache::lonuserutils::can_create_user($createdom,$context);
+ my $targetdom = ''.$createdom.'';
if ($cancreate) {
- my $showdom = &display_domain_info($env{'request.role.domain'});
+ my $showdom = &display_domain_info($createdom);
$response .= '
'
.''.&mt('To add a new user:').''
- .'
'
- .&mt("(You can only create new users in your current role's domain - [_1])"
- ,''.$env{'request.role.domain'}.'')
- .'