Diff for /loncom/interface/lonaboutme.pm between versions 1.152 and 1.163

version 1.152, 2012/12/06 21:43:27 version 1.163, 2022/10/29 14:47:00
Line 78  use Apache::Constants qw(:common); Line 78  use Apache::Constants qw(:common);
 use Apache::loncommon;  use Apache::loncommon;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::lontexconvert;  use Apache::lontexconvert;
 use Apache::lonfeedback;  use Apache::lonhtmlgateway;
 use Apache::lonrss();  use Apache::lonrss();
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonmsgdisplay();  use Apache::lonmsgdisplay();
 use Apache::lontemplate;  use Apache::lontemplate;
   use Apache::longroup;
   use Apache::lonhtmlcommon();
 use HTML::Entities();  use HTML::Entities();
 use Image::Magick;  use Image::Magick;
   
Line 107  sub handler { Line 109  sub handler {
         $is_course = &Apache::lonnet::is_course($cdom,$cnum);          $is_course = &Apache::lonnet::is_course($cdom,$cnum);
     }      }
   
       my $clientip = &Apache::lonnet::get_requestor_ip($r);
     my $candisplay = 1;      my $candisplay = 1;
     if (!$is_course) {      if (!$is_course) {
         if ($action ne 'portfolio') {          if ($action ne 'portfolio') {
Line 139  sub handler { Line 142  sub handler {
   
 # ------------------------------------------------------------ Get Query String  # ------------------------------------------------------------ Get Query String
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                         ['forceedit','forcestudent',                          ['forceedit','forcestudent','todocs',
                          'register','popup','folderpath','title']);                           'register','popup','folderpath','title']);
   
 # ----------------------------------------------- Available Portfolio file display  # ----------------------------------------------- Available Portfolio file display
     if (($target ne 'tex') && ($action eq 'portfolio')) {      if (($target ne 'tex') && ($action eq 'portfolio')) {
         &display_portfolio_header($r,$is_course);          &display_portfolio_header($r,$is_course);
Line 153  sub handler { Line 155  sub handler {
                 '</ul>');                  '</ul>');
         } else {          } else {
             my ($blocked,$blocktext) =              my ($blocked,$blocktext) =
                 &Apache::loncommon::blocking_status('port',$cnum,$cdom);                  &Apache::loncommon::blocking_status('port',$clientip,$cnum,$cdom);
             if (!$blocked) {              if (!$blocked) {
                 &display_portfolio_files($r,$is_course);                  &display_portfolio_files($r,$is_course);
             } else {              } else {
Line 221  sub handler { Line 223  sub handler {
             $args->{'no_nav_bar'} = 1;              $args->{'no_nav_bar'} = 1;
         } elsif (!$env{'form.register'}) { #Don't show breadcrumbs twice, when this page is part of course content and you call it          } elsif (!$env{'form.register'}) { #Don't show breadcrumbs twice, when this page is part of course content and you call it
             if (($env{'request.course.id'}) &&              if (($env{'request.course.id'}) &&
                  ($env{'form.folderpath'} =~ /^supplemental/)) {                  ($env{'form.folderpath'} =~ /^supplemental/)) {
                   &Apache::loncommon::validate_folderpath(1,'',$coursenum,$coursedomain);
                 my $crstype = &Apache::loncommon::course_type();                  my $crstype = &Apache::loncommon::course_type();
                 my $title = $env{'form.title'};                  my $title = $env{'form.title'};
                 if ($title eq '') {                  if ($title eq '') {
                     $title = &mt('Personal Information Page');                      $title = &mt('Personal Information Page');
                 }                  }
                   $title = &HTML::Entities::encode($title,'\'"<>&');
                 my $brcrum =                  my $brcrum =
                     &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);                      &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
                 if (ref($brcrum) eq 'ARRAY') {                  if (ref($brcrum) eq 'ARRAY') {
Line 240  sub handler { Line 244  sub handler {
         my $start_page = &Apache::loncommon::start_page('Personal Information Page',$rss_link,$args);          my $start_page = &Apache::loncommon::start_page('Personal Information Page',$rss_link,$args);
         $r->print($start_page);          $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.   #----------------Print Privacy note (edit mode) or last modified date. 
   
Line 313  sub handler { Line 328  sub handler {
     if (($allowed) && ($env{'form.storesyl'})) {      if (($allowed) && ($env{'form.storesyl'})) {
         foreach my $syl_field (keys(%syllabusfields)) {          foreach my $syl_field (keys(%syllabusfields)) {
             my $field=$env{'form.'.$syl_field};              my $field=$env{'form.'.$syl_field};
             $field=~s/\s+$//s;              chomp($field);
             $field=&Apache::lonfeedback::clear_out_html($field,$env{'user.adv'});              my $gateway = Apache::lonhtmlgateway->new();
               $field = $gateway->process_incoming_html($field,1);
             $syllabus{$syl_field}=$field;              $syllabus{$syl_field}=$field;
         }          }
         $syllabus{'uploaded.lastmodified'}=time;          $syllabus{'uploaded.lastmodified'}=time;
Line 400  sub handler { Line 416  sub handler {
   
         } else {          } else {
             $r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\');              $r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\');
             &Apache::lonmsgdisplay::disfacetoface($r,$cnum,$cdom, 'tex');              &Apache::lonmsgdisplay::disfacetoface($r,$cnum,$cdom,$target);
         }          }
     }      }
     if ($target ne 'tex') {      if ($target ne 'tex') {
         $r->print('</div>');          $r->print('</div>');
         if ($env{'form.popup'}) {          if ($env{'form.popup'}) {
             $r->print('<p><a href="javascript:window.close()">'.&mt('Close window').'</a>');              $r->print('<p><a href="javascript:window.close()">'.&mt('Close window').'</a></p>');
         }          }
         $r->print(&Apache::loncommon::end_page());          $r->print(&Apache::loncommon::end_page());
     } else {      } else {
Line 541  sub display_portfolio_header { Line 557  sub display_portfolio_header {
                           title => &mt('Go to personal information page for [_1]',$name),                            title => &mt('Go to personal information page for [_1]',$name),
                           no_mt => 1},                            no_mt => 1},
                          {href  => "/adm/$cdom/$cnum/aboutme/portfolio".$query_string,                           {href  => "/adm/$cdom/$cnum/aboutme/portfolio".$query_string,
                           text  => 'Viewable files',                            text  => &mt('Viewable files'),
                           title => &mt('Viewable portfolio files for [_1]',$name),                            title => &mt('Viewable portfolio files for [_1]',$name),
                           no_mt => 1}                            no_mt => 1}
                          ];                           ];
Line 630  sub portfolio_files { Line 646  sub portfolio_files {
     my $diroutput;      my $diroutput;
     if ($is_course) {      if ($is_course) {
         my %files_by_group;          my %files_by_group;
           my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum);
         foreach my $filename (sort(keys(%access_controls))) {          foreach my $filename (sort(keys(%access_controls))) {
             my ($group,$path) = split('/',$filename,2);              my ($group,$path) = split('/',$filename,2);
             $files_by_group{$group}{$path} = $access_controls{$filename};              if (exists($curr_groups{$group})) {
                   $files_by_group{$group}{$path} = $access_controls{$filename};
               }
         }          }
         foreach my $group (sort(keys(%files_by_group))) {          foreach my $group (sort(keys(%files_by_group))) {
             my %fileshash;              my %fileshash;
Line 667  sub portfolio_files { Line 686  sub portfolio_files {
 sub build_hierarchy {  sub build_hierarchy {
     my ($r,$cdom,$cnum,$portaccess,$is_course,$filecounts,$mode,$access_info,      my ($r,$cdom,$cnum,$portaccess,$is_course,$filecounts,$mode,$access_info,
         $allfileshash,$group) = @_;          $allfileshash,$group) = @_;
       my $clientip = &Apache::lonnet::get_requestor_ip($r);
     foreach my $filename (sort(keys(%{$access_info}))) {      foreach my $filename (sort(keys(%{$access_info}))) {
         my $access_status =          my $access_status =
            &Apache::lonnet::get_portfolio_access($cdom,$cnum,$filename,$group,$$access_info{$filename});             &Apache::lonnet::get_portfolio_access($cdom,$cnum,$filename,$group,$clientip,
                                                    $access_info->{$filename});
         if ($portaccess eq 'both') {          if ($portaccess eq 'both') {
             if (($access_status ne 'ok') &&              if (($access_status ne 'ok') &&
                 ($access_status !~  /^[^:]+:guest_/)) {                  ($access_status !~  /^[^:]+:guest_/)) {

Removed from v.1.152  
changed lines
  Added in v.1.163


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>