--- loncom/interface/loncommon.pm 2016/09/16 18:27:07 1.1075.2.113 +++ loncom/interface/loncommon.pm 2016/09/18 20:56:04 1.1075.2.114 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1075.2.113 2016/09/16 18:27:07 raeburn Exp $ +# $Id: loncommon.pm,v 1.1075.2.114 2016/09/18 20:56:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -9506,6 +9506,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', @@ -9746,7 +9762,7 @@ END_BLOCK &Apache::lonhtmlcommon::row_closure(1). &Apache::lonhtmlcommon::end_pick_box(). '
'; - return $output; + return ($output,1); } sub user_rule_check {