--- loncom/interface/lonuserutils.pm 2017/08/11 18:58:16 1.189 +++ loncom/interface/lonuserutils.pm 2017/11/04 16:13:31 1.191 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.189 2017/08/11 18:58:16 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.191 2017/11/04 16:13:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4174,19 +4174,25 @@ sub upfile_drop_add { my $domain; if ($env{'form.defaultdomain'} ne '') { if (($context eq 'course') || ($setting eq 'course')) { - unless ($env{'form.defaultdomain'} eq $crsdom) { + if ($env{'form.defaultdomain'} eq $crsdom) { + $domain = $env{'form.defaultdomain'}; + } else { if (&Apache::lonnet::will_trust('enroll',$crsdom,$env{'form.defaultdomain'})) { $domain = $env{'form.defaultdomain'}; } else { $r->print(''.&mt('Error'). &mt('Enrollment of users not permitted for specified default domain: [_1].', &Apache::lonnet::domain($env{'form.defaultdomain'},'description')).''); - $r->print(&Apache::loncommon::end_page()); + if ($env{'form.fullup'} ne 'yes') { + $r->print(''); + } + return; } - return; } } elsif ($context eq 'author') { - unless ($env{'form.defaultdomain'} eq $defdom) { + if ($env{'form.defaultdomain'} eq $defdom) { + $domain = $env{'form.defaultdomain'}; + } else { if ((&Apache::lonnet::will_trust('othcoau',$defdom,$env{'form.defaultdomain'})) && (&Apache::lonnet::will_trust('coaurem',$env{'form.defaultdomain'},$defdom))) { $domain = $env{'form.defaultdomain'}; @@ -4194,19 +4200,26 @@ sub upfile_drop_add { $r->print(''.&mt('Error'). &mt('Addition of users not permitted for specified default domain: [_1].', &Apache::lonnet::domain($env{'form.defaultdomain'},'description')).''); - $r->print(&Apache::loncommon::end_page()); + if ($env{'form.fullup'} ne 'yes') { + $r->print(''); + } + return; } - return; } } elsif (($context eq 'domain') && ($setting eq 'domain')) { - unless ($env{'form.defaultdomain'} eq $defdom) { + if ($env{'form.defaultdomain'} eq $defdom) { + $domain = $env{'form.defaultdomain'}; + } else { if (&Apache::lonnet::will_trust('domroles',$defdom,$env{'form.defaultdomain'})) { $domain = $env{'form.defaultdomain'}; } else { $r->print(''.&mt('Error'). &mt('Addition of users not permitted for specified default domain: [_1].', &Apache::lonnet::domain($env{'form.defaultdomain'},'description')).''); - $r->print(&Apache::loncommon::end_page()); + if ($env{'form.fullup'} ne 'yes') { + $r->print(''); + } + return; } } } @@ -4221,7 +4234,9 @@ sub upfile_drop_add { if (! exists($home_servers{$desiredhost})) { $r->print(''.&mt('Error'). &mt('Invalid home server specified').''); - $r->print(&Apache::loncommon::end_page()); + if ($env{'form.fullup'} ne 'yes') { + $r->print(''); + } return; } }