--- loncom/interface/lonaboutme.pm 2014/12/01 22:52:48 1.158 +++ loncom/interface/lonaboutme.pm 2024/07/03 23:49:50 1.161.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network # Personal Information Page # -# $Id: lonaboutme.pm,v 1.158 2014/12/01 22:52:48 raeburn Exp $ +# $Id: lonaboutme.pm,v 1.161.2.1 2024/07/03 23:49:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -108,10 +108,15 @@ sub handler { $is_course = &Apache::lonnet::is_course($cdom,$cnum); } + my $clientip = &Apache::lonnet::get_requestor_ip($r); my $candisplay = 1; if (!$is_course) { if ($action ne 'portfolio') { - $candisplay = &Apache::lonnet::usertools_access($cnum,$cdom,'aboutme'); + if (($env{'user.name'} eq $cnum) && ($env{'user.domain'} eq $cdom)) { + $candisplay = &Apache::lonnet::usertools_access($cnum,$cdom,'aboutme'); + } else { + $candisplay = &Apache::loncommon::aboutme_on($cnum,$cdom); + } if ((!$candisplay) && ($env{'request.course.id'})) { $candisplay = &aboutme_access($cnum,$cdom); } @@ -153,7 +158,7 @@ sub handler { ''); } else { my ($blocked,$blocktext) = - &Apache::loncommon::blocking_status('port',$cnum,$cdom); + &Apache::loncommon::blocking_status('port',$clientip,$cnum,$cdom); if (!$blocked) { &display_portfolio_files($r,$is_course); } else { @@ -240,6 +245,17 @@ sub handler { my $start_page = &Apache::loncommon::start_page('Personal Information Page',$rss_link,$args); $r->print($start_page); } + my ($blocked,$blocktext) = + &Apache::loncommon::blocking_status('about',$clientip,$cnum,$cdom); + if ($blocked) { + if ($target eq 'tex') { + $r->print('\noindent{\large\textbf{'.&mt('No user personal information page available').'}}\\\\\\\\'); + } else { + $r->print($blocktext); + } + $r->print(&Apache::loncommon::end_page()); + return OK; + } #----------------Print Privacy note (edit mode) or last modified date. @@ -671,7 +687,7 @@ sub portfolio_files { sub build_hierarchy { my ($r,$cdom,$cnum,$portaccess,$is_course,$filecounts,$mode,$access_info, $allfileshash,$group) = @_; - my $clientip = $r->get_remote_host(); + my $clientip = &Apache::lonnet::get_requestor_ip($r); foreach my $filename (sort(keys(%{$access_info}))) { my $access_status = &Apache::lonnet::get_portfolio_access($cdom,$cnum,$filename,$group,$clientip,