version 1.6, 2020/09/22 12:19:15
|
version 1.8.2.1, 2024/07/04 17:30:17
|
Line 136 sub course_search {
|
Line 136 sub course_search {
|
foreach (sort(keys(%hash))) { |
foreach (sort(keys(%hash))) { |
if ($c->aborted()) { last; } |
if ($c->aborted()) { last; } |
if (($_=~/^src\_(.+)$/)) { |
if (($_=~/^src\_(.+)$/)) { |
if ($hash{'randomout_'.$1} & !$env{'request.role.adv'}) { |
my $rid = $1; |
|
if ($hash{'randomout_'.$rid} & !$env{'request.role.adv'}) { |
next; |
next; |
} |
} |
my $symb=&make_symb($1); |
my $symb=&make_symb($rid); |
&checkonthis($r,$1,$hash{$_},0,&Apache::lonnet::gettitle($symb), |
&checkonthis($r,$rid,$hash{$_},0,&Apache::lonnet::gettitle($symb), |
$fulltext,$symb,@allwords); |
$fulltext,$symb,@allwords); |
} |
} |
} |
} |
Line 261 sub checkonthis {
|
Line 262 sub checkonthis {
|
} |
} |
my $href=$url; |
my $href=$url; |
if ($hash{'encrypted_'.$id} && !$env{'request.role.adv'}) { |
if ($hash{'encrypted_'.$id} && !$env{'request.role.adv'}) { |
$href=&Apache::lonenc::encrypted($href) |
$href=&Apache::lonenc::encrypted($href); |
.'?symb='.&Apache::lonenc::encrypted($symb); |
if ($href =~ /\.sequence$/) { |
|
$href .= '?navmap=1'; |
|
} else { |
|
$href .= '?symb='.&Apache::lonenc::encrypted($symb); |
|
} |
} else { |
} else { |
$href.='?symb='.&escape($symb); |
if ($href =~ /\.sequence$/) { |
|
$href .= '?navmap=1'; |
|
} else { |
|
$href .= '?symb='.&escape($symb); |
|
} |
} |
} |
$r->print('<a href="'.$href.'" target="cat">'.($title?$title:$url). |
$r->print('<a href="'.$href.'" target="cat">'.($title?$title:$url). |
'</a><br />'); |
'</a><br />'); |
Line 331 sub handler {
|
Line 340 sub handler {
|
&Apache::lonnavdisplay::startContentScreen($r,'coursesearch'); |
&Apache::lonnavdisplay::startContentScreen($r,'coursesearch'); |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('search',$cnum,$cdom); |
&Apache::loncommon::blocking_status('search',$clientip,$cnum,$cdom); |
if ($blocked) { |
if ($blocked) { |
my $checkrole = "cm./$cdom/$cnum"; |
my $checkrole = "cm./$cdom/$cnum"; |
if ($env{'request.course.sec'} ne '') { |
if ($env{'request.course.sec'} ne '') { |