--- loncom/interface/lonaboutme.pm 2009/10/29 14:58:33 1.141 +++ loncom/interface/lonaboutme.pm 2022/10/29 14:47:00 1.163 @@ -1,7 +1,7 @@ # The LearningOnline Network # Personal Information Page # -# $Id: lonaboutme.pm,v 1.141 2009/10/29 14:58:33 raeburn Exp $ +# $Id: lonaboutme.pm,v 1.163 2022/10/29 14:47:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,8 +50,6 @@ described at http://www.lon-capa.org. =item handler() -=item in_course() - =item aboutme_info() =item print_portfiles_link() @@ -80,11 +78,13 @@ use Apache::Constants qw(:common); use Apache::loncommon; use Apache::lonnet; use Apache::lontexconvert; -use Apache::lonfeedback; +use Apache::lonhtmlgateway; use Apache::lonrss(); use Apache::lonlocal; use Apache::lonmsgdisplay(); use Apache::lontemplate; +use Apache::longroup; +use Apache::lonhtmlcommon(); use HTML::Entities(); use Image::Magick; @@ -109,6 +109,7 @@ 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') { @@ -121,7 +122,7 @@ sub handler { $r->print('\noindent{\large\textbf{'.&mt('No user personal information page available').'}}\\\\\\\\'); } else { $r->print(&Apache::loncommon::start_page("Personal Information Page")); - $r->print('
'.&mt('No user personal information page available') .'
'. &mt('This is a result of one of the following:').''.&mt('Close window').''); + $r->print('
'); } $r->print(&Apache::loncommon::end_page()); } else { @@ -450,33 +434,6 @@ sub handler { return OK; } -sub in_course { - my ($udom,$uname,$cdom,$cnum,$type) = @_; - $type ||= 'any'; - if (!defined($cdom) || !defined($cnum)) { - my $cid = $env{'request.course.id'}; - $cdom = $env{'course.'.$cid.'.domain'}; - $cnum = $env{'course.'.$cid.'.num'}; - } - my %roles = &Apache::lonnet::dump('roles',$udom,$uname); - my @course_roles = grep(m{^/\Q$cdom\E/\Q$cnum\E[/_]}, keys(%roles)); - return 0 if (!@course_roles); - return 1 if ($type eq 'any'); - my $now = time(); - foreach my $role (@course_roles) { - my (undef,$role_end,$role_start)=split(/\_/,$roles{$role}); - my $status = 'active'; - if ($role_start > 0 && $now < $role_start) { - $status = 'future'; - } - if ($role_end > 0 && $now > $role_end) { - $status = 'previous'; - } - return 1 if ($status eq $type); - } - return 0; -} - sub aboutme_info { my ($r,$is_course) = @_; my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri); @@ -528,6 +485,8 @@ sub print_portfiles_link { } $output .= ''; $output .= '