version 1.9, 2008/11/28 20:39:43
|
version 1.10, 2008/11/30 14:47:18
|
Line 81 BEGIN {
|
Line 81 BEGIN {
|
|
|
=item check_cookie_and_load_env() |
=item check_cookie_and_load_env() |
|
|
Inputs: none |
Inputs: 1 ( optional). When called from a handler in mod_perl, |
|
pass in the request object. |
|
|
Returns: 1 if the user has a LON-CAPA cookie 0 if not. |
Returns: 1 if the user has a LON-CAPA cookie 0 if not. |
Loads the users environment into the %env hash if the cookie is correct. |
Loads the users environment into the %env hash if the cookie is correct. |
Line 91 Loads the users environment into the %en
|
Line 92 Loads the users environment into the %en
|
############################################# |
############################################# |
############################################# |
############################################# |
sub check_cookie_and_load_env { |
sub check_cookie_and_load_env { |
my %cookies=fetch CGI::Cookie; |
my ($r) = @_; |
|
my %cookies; |
|
if (ref($r)) { |
|
%cookies = CGI::Cookie->fetch($r); |
|
} else { |
|
%cookies = CGI::Cookie->fetch(); |
|
} |
if (exists($cookies{'lonID'}) && |
if (exists($cookies{'lonID'}) && |
-e "$lonidsdir/".$cookies{'lonID'}->value.".id") { |
-e "$lonidsdir/".$cookies{'lonID'}->value.".id") { |
# cookie found |
# cookie found |