version 1.3, 2005/04/07 06:56:21
|
version 1.8, 2006/09/19 21:36:31
|
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 lib '/home/httpd/lib/perl/'; |
use CGI(); |
use CGI(); |
use CGI::Cookie(); |
use CGI::Cookie(); |
use Fcntl qw(:flock); |
use Fcntl qw(:flock); |
|
use LONCAPA; |
use LONCAPA::Configuration(); |
use LONCAPA::Configuration(); |
require Exporter; |
use GDBM_File; |
|
|
our @ISA = qw (Exporter); |
|
our @EXPORT = qw(%env); |
|
|
|
my $lonidsdir; |
my $lonidsdir; |
|
|
Line 146 Returns: undef
|
Line 144 Returns: undef
|
############################################# |
############################################# |
sub transfer_profile_to_env { |
sub transfer_profile_to_env { |
my ($handle)=@_; |
my ($handle)=@_; |
my @profile; |
if (tie(my %disk_env,'GDBM_File',"$lonidsdir/$handle.id",&GDBM_READER(), |
{ |
0640)) { |
open(IDFILE, "<$lonidsdir/$handle.id"); |
%Apache::lonnet::env = %disk_env; |
flock(IDFILE,LOCK_SH); |
untie(%disk_env); |
@profile=<IDFILE>; |
|
close(IDFILE); |
|
} |
|
foreach my $envrow (@profile) { |
|
chomp($envrow); |
|
my ($envname,$envvalue)=split(/=/,$envrow); |
|
$ENV{$envname} = $envvalue; |
|
$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; |
} |
} |
|
|
############################################# |
############################################# |
############################################# |
############################################# |
|
|
|
|
=pod |
=pod |
|
|
=back |
=back |