version 1.17, 2000/11/10 10:08:24
|
version 1.18, 2001/01/09 22:10:40
|
Line 7
|
Line 7
|
|
|
package Apache::lonauth; |
package Apache::lonauth; |
|
|
|
use strict; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::File; |
use Apache::File; |
use CGI qw(:standard); |
use CGI qw(:standard); |
Line 14 use CGI::Cookie();
|
Line 15 use CGI::Cookie();
|
use Crypt::DES; |
use Crypt::DES; |
use Apache::lonnet(); |
use Apache::lonnet(); |
use Apache::lonmenu(); |
use Apache::lonmenu(); |
|
use Fcntl qw(:flock); |
# ------------------------------------------------------------ Successful login |
# ------------------------------------------------------------ Successful login |
|
|
sub success { |
sub success { |
Line 88 sub success {
|
Line 89 sub success {
|
|
|
{ |
{ |
my $idf=Apache::File->new(">$lonids/$cookie.id"); |
my $idf=Apache::File->new(">$lonids/$cookie.id"); |
|
unless (flock($idf,LOCK_EX)) { |
|
&Apache::lonnet::logthis("<font color=blue>WARNING: ". |
|
'Could not obtain exclusive lock in lonauth: '.$!); |
|
$idf->close(); |
|
return 'error: '.$!; |
|
} |
if ($userenv ne '') { print $idf "$userenv\n"; } |
if ($userenv ne '') { print $idf "$userenv\n"; } |
print $idf "user.name=$username\n"; |
print $idf "user.name=$username\n"; |
print $idf "user.domain=$domain\n"; |
print $idf "user.domain=$domain\n"; |
Line 102 sub success {
|
Line 109 sub success {
|
print $idf "request.role=cm\n"; |
print $idf "request.role=cm\n"; |
print $idf "request.host=$ENV{'HTTP_HOST'}\n"; |
print $idf "request.host=$ENV{'HTTP_HOST'}\n"; |
if ($userroles ne '') { print $idf "$userroles"; } |
if ($userroles ne '') { print $idf "$userroles"; } |
|
$idf->close(); |
} |
} |
|
|
# -------------------------------------------------------------------- Log this |
# -------------------------------------------------------------------- Log this |