--- loncom/interface/coursecatalog.pm 2015/06/09 21:22:55 1.88 +++ loncom/interface/coursecatalog.pm 2016/10/23 21:21:56 1.88.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.88 2015/06/09 21:22:55 damieng Exp $ +# $Id: coursecatalog.pm,v 1.88.2.1 2016/10/23 21:21:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -80,7 +80,7 @@ sub handler { my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$codedom); my $knownuser = &user_is_known(); - my $canviewall = &canview_all(); + my $canviewall = &canview_all($knownuser,$codedom); my ($cathash,$cattype); if (ref($domconfig{'coursecategories'}) eq 'HASH') { @@ -742,7 +742,6 @@ sub additional_filters { $showhidden_status = 'checked="checked" '; } my @currstatuses = &Apache::loncommon::get_env_multiple('form.showcounts'); - my $dc_title = &Apache::lonnet::plaintext('dc'); my ($details_text,$hidden_text,$statusdisplay,$cellborder); my $wasactivedisplay = 'none'; if ($env{'form.showdetails'}) { @@ -756,11 +755,11 @@ sub additional_filters { $cellborder = 'border-left: 0px'; } if ($env{'form.currcat_0'} eq 'communities::0') { - $details_text = &mt('Show full details for each community ([_1] only)',$dc_title); - $hidden_text = &mt('Include communities set to be hidden from catalog ([_1] only)',$dc_title); + $details_text = &mt('Show full details for each community (domain staff only)'); + $hidden_text = &mt('Include communities set to be hidden from catalog (domain staff only)'); } else { - $details_text = &mt('Show full details for each course ([_1] only)',$dc_title); - $hidden_text = &mt('Include courses set to be hidden from catalog ([_1] only)',$dc_title); + $details_text = &mt('Show full details for each course (domain staff only)'); + $hidden_text = &mt('Include courses set to be hidden from catalog (domain staff only)'); } if ($is_dc) { $output .= ''. @@ -875,12 +874,17 @@ sub user_is_dc { } sub canview_all { + my ($knownuser,$codedom) = @_; my $canviewall = 0; my $page = 'coursecatalog'; if (&LONCAPA::lonauthcgi::can_view($page)) { $canviewall = 1; } elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page)) { $canviewall= 1; + } elsif (($knownuser) && ($codedom ne '')) { + if (&Apache::lonnet::allowed('dcd',$codedom)) { + $canviewall = 1; + } } return $canviewall; }