--- loncom/interface/loncommon.pm 2016/07/18 19:28:58 1.1250 +++ loncom/interface/loncommon.pm 2016/09/05 01:46:07 1.1253 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1250 2016/07/18 19:28:58 raeburn Exp $ +# $Id: loncommon.pm,v 1.1253 2016/09/05 01:46:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5306,7 +5306,7 @@ sub check_ip_acc { return 1; } my $allowed; - my $ip=$env{'request.host'} || $ENV{'REMOTE_ADDR'} || $clientip; + my $ip=$ENV{'REMOTE_ADDR'} || $clientip || $env{'request.host'}; my $name; my %access = ( @@ -9959,6 +9959,22 @@ sub get_secgrprole_info { sub user_picker { my ($dom,$srch,$forcenewuser,$caller,$cancreate,$usertype,$context) = @_; my $currdom = $dom; + my @alldoms = &Apache::lonnet::all_domains(); + if (@alldoms == 1) { + my %domsrch = &Apache::lonnet::get_dom('configuration', + ['directorysrch'],$alldoms[0]); + my $domdesc = &Apache::lonnet::domain($alldoms[0],'description'); + my $showdom = $domdesc; + if ($showdom eq '') { + $showdom = $dom; + } + if (ref($domsrch{'directorysrch'}) eq 'HASH') { + if ((!$domsrch{'directorysrch'}{'available'}) && + ($domsrch{'directorysrch'}{'lcavailable'} eq '0')) { + return (&mt('LON-CAPA directory search is not available in domain: [_1]',$showdom),0); + } + } + } my %curr_selected = ( srchin => 'dom', srchby => 'lastname', @@ -10199,7 +10215,7 @@ END_BLOCK &Apache::lonhtmlcommon::row_closure(1). &Apache::lonhtmlcommon::end_pick_box(). '
'; - return $output; + return ($output,1); } sub user_rule_check { @@ -15501,6 +15517,9 @@ sub construct_course { if ($args->{'setcontent'}) { $cenv{'question.email'}=$args->{'ccuname'}.':'.$args->{'ccdomain'}; } + if ($args->{'setcomment'}) { + $cenv{'comment.email'}=$args->{'ccuname'}.':'.$args->{'ccdomain'}; + } } if ($args->{'reshome'}) { $cenv{'reshome'}=$args->{'reshome'}.'/';