--- loncom/interface/lonuserutils.pm 2017/08/11 18:58:16 1.189 +++ loncom/interface/lonuserutils.pm 2017/08/11 20:14:44 1.190 @@ -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.190 2017/08/11 20:14:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4174,7 +4174,9 @@ 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 { @@ -4182,11 +4184,13 @@ sub upfile_drop_add { &mt('Enrollment of users not permitted for specified default domain: [_1].', &Apache::lonnet::domain($env{'form.defaultdomain'},'description')).''); $r->print(&Apache::loncommon::end_page()); + 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'}; @@ -4195,11 +4199,13 @@ sub upfile_drop_add { &mt('Addition of users not permitted for specified default domain: [_1].', &Apache::lonnet::domain($env{'form.defaultdomain'},'description')).''); $r->print(&Apache::loncommon::end_page()); + 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 { @@ -4207,6 +4213,7 @@ sub upfile_drop_add { &mt('Addition of users not permitted for specified default domain: [_1].', &Apache::lonnet::domain($env{'form.defaultdomain'},'description')).''); $r->print(&Apache::loncommon::end_page()); + return; } } }