Diff for /loncom/homework/outputtags.pm between versions 1.58 and 1.62

version 1.58, 2016/08/09 23:43:42 version 1.62, 2023/03/25 18:38:25
Line 33  package Apache::outputtags; Line 33  package Apache::outputtags;
 use strict;  use strict;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonnet;  use Apache::lonnet;
   use LONCAPA::LWPReq;
 use POSIX qw(strftime);  use POSIX qw(strftime);
   
 BEGIN {  BEGIN {
Line 308  sub start_displaystudentphoto { Line 309  sub start_displaystudentphoto {
  my $args;   my $args;
  my $width=&Apache::lonxml::get_param('width',$parstack,$safeeval);   my $width=&Apache::lonxml::get_param('width',$parstack,$safeeval);
  if ($width) { $args.=" width=\"$width\" "; }   if ($width) { $args.=" width=\"$width\" "; }
  my $height=&Apache::lonxml::get_param('heigth',$parstack,$safeeval);   my $height=&Apache::lonxml::get_param('height',$parstack,$safeeval);
  if ($height) { $args.=" height=\"$height\" "; }   if ($height) { $args.=" height=\"$height\" "; }
  my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval);   my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval);
  if ($align) { $args.=" align=\"$align\" "; }   if ($align) { $args.=" align=\"$align\" "; }
Line 316  sub start_displaystudentphoto { Line 317  sub start_displaystudentphoto {
     }      }
     if ($target eq 'tex' && $env{'request.role'} =~ /^cc/) {      if ($target eq 'tex' && $env{'request.role'} =~ /^cc/) {
  my $url=&Apache::lonnet::studentphoto($domain,$user,"eps");   my $url=&Apache::lonnet::studentphoto($domain,$user,"eps");
  my $ua=new LWP::UserAgent;          my $uhome=&Apache::lonnet::homeserver($user,$domain);
  my $request=new HTTP::Request('GET',$url);   my $request=new HTTP::Request('GET',$url);
  my $response=$ua->request($request);          my $response=&LONCAPA::LWPReq::makerequest($uhome,$request,'','','',1);
  if ($response->is_success) {   if ($response->is_success) {
     my $file=$user."_".$domain."_studentphoto.eps";      my $file=$user."_".$domain."_studentphoto.eps";
     open(FILE,">".$Apache::lonnet::perlvar{'lonPrtDir'}."/$file");      open(FILE,">",$Apache::lonnet::perlvar{'lonPrtDir'}."/$file");
     print FILE $response->content;      print FILE $response->content;
     close(FILE);      close(FILE);
     my $width_param=&Apache::londefdef::image_size($Apache::lonnet::perlvar{'lonPrtDir'}."/$file",'0.3',$parstack,$safeeval);      my $width_param=&Apache::londefdef::image_size($Apache::lonnet::perlvar{'lonPrtDir'}."/$file",'0.3',$parstack,$safeeval);

Removed from v.1.58  
changed lines
  Added in v.1.62


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