Diff for /loncom/cgi/loncgi.pm between versions 1.3 and 1.6

version 1.3, 2005/04/07 06:56:21 version 1.6, 2006/04/10 17:46:04
Line 52  package LONCAPA::loncgi; Line 52  package LONCAPA::loncgi;
 use strict;  use strict;
 use warnings FATAL=>'all';  use warnings FATAL=>'all';
 no warnings 'uninitialized';  no warnings 'uninitialized';
 use vars qw(%env);  
   
 use CGI();  use CGI();
 use CGI::Cookie();  use CGI::Cookie();
 use Fcntl qw(:flock);  use Fcntl qw(:flock);
 use LONCAPA::Configuration();  use LONCAPA::Configuration();
 require Exporter;  
   
 our @ISA = qw (Exporter);  
 our @EXPORT = qw(%env);  
   
 my $lonidsdir;  my $lonidsdir;
   
Line 155  sub transfer_profile_to_env { Line 150  sub transfer_profile_to_env {
     }      }
     foreach my $envrow (@profile) {      foreach my $envrow (@profile) {
         chomp($envrow);          chomp($envrow);
         my ($envname,$envvalue)=split(/=/,$envrow);          my ($envname,$envvalue)=split(/=/,$envrow,2);
         $ENV{$envname} = $envvalue;   $envname  = &unescape($envname);
         $env{$envname} = $envvalue;   $envvalue = &unescape($envvalue);
           $Apache::lonnet::env{$envname} = $envvalue;
     }      }
     $ENV{'user.environment'} = "$lonidsdir/$handle.id";      $Apache::lonnet::env{'user.environment'} = "$lonidsdir/$handle.id";
     $env{'user.environment'} = "$lonidsdir/$handle.id";  
     return undef;      return undef;
 }  }
   
 #############################################  #############################################
 #############################################  #############################################
   
   sub escape {
       my $str=shift;
       $str =~ s/(\W)/"%".unpack('H2',$1)/eg;
       return $str;
   }
   
   # ----------------------------------------------------- Un-Escape Special Chars
   
   sub unescape {
       my $str=shift;
       $str =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
       return $str;
   }
   
   
 =pod  =pod
   
 =back  =back

Removed from v.1.3  
changed lines
  Added in v.1.6


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