version 1.152, 2001/08/18 14:17:50
|
version 1.154, 2001/08/20 19:41:54
|
Line 122
|
Line 122
|
# 5/30 H. K. Ng |
# 5/30 H. K. Ng |
# 6/1 Gerd Kortemeyer |
# 6/1 Gerd Kortemeyer |
# July Guy Albertelli |
# July Guy Albertelli |
# 8/4,8/7,8/8,8/9,8/11,8/16,8/17,8/18 Gerd Kortemeyer |
# 8/4,8/7,8/8,8/9,8/11,8/16,8/17,8/18,8/20 Gerd Kortemeyer |
|
|
package Apache::lonnet; |
package Apache::lonnet; |
|
|
Line 683 sub checkout {
|
Line 683 sub checkout {
|
$token=~s/^(\d+)\_.*\_(\d+)$/$1\*$2\*$lonhost/; |
$token=~s/^(\d+)\_.*\_(\d+)$/$1\*$2\*$lonhost/; |
$token=~tr/a-z/A-Z/; |
$token=~tr/a-z/A-Z/; |
|
|
my %infohash=('outtoken' => $token, |
my %infohash=('resource.0.outtoken' => $token, |
'checkouttime' => $now, |
'resource.0.checkouttime' => $now, |
'outremote' => $ENV{'REMOTE_ADDR'}); |
'resource.0.outremote' => $ENV{'REMOTE_ADDR'}); |
|
|
unless (&cstore(\%infohash,$symb,$tcrsid,$tudom,$tuname) eq 'ok') { |
unless (&cstore(\%infohash,$symb,$tcrsid,$tudom,$tuname) eq 'ok') { |
return ''; |
return ''; |
Line 719 sub checkin {
|
Line 719 sub checkin {
|
my ($tuname,$tudom,$tcrsid,$symb,$chtim,$rmaddr)= |
my ($tuname,$tudom,$tcrsid,$symb,$chtim,$rmaddr)= |
split(/\&/,&unescape(&reply('tmpget:'.$dtoken,$lonhost))); |
split(/\&/,&unescape(&reply('tmpget:'.$dtoken,$lonhost))); |
|
|
my %infohash=('intoken' => $token, |
unless (($tuname) && ($tudom)) { |
'checkintime' => $now, |
&logthis('Check in '.$token.' ('.$dtoken.') failed'); |
'inremote' => $ENV{'REMOTE_ADDR'}); |
return ''; |
|
} |
|
|
|
unless (&allowed('mgr',$tcrsid)) { |
|
&logthis('Check in '.$token.' ('.$dtoken.') unauthorized: '. |
|
$ENV{'user.name'}.' - '.$ENV{'user.domain'}); |
|
return ''; |
|
} |
|
|
|
my %infohash=('resource.0.intoken' => $token, |
|
'resource.0.checkintime' => $now, |
|
'resource.0.inremote' => $ENV{'REMOTE_ADDR'}); |
|
|
unless (&cstore(\%infohash,$symb,$tcrsid,$tudom,$tuname) eq 'ok') { |
unless (&cstore(\%infohash,$symb,$tcrsid,$tudom,$tuname) eq 'ok') { |
return ''; |
return ''; |
Line 2264 if ($readit ne 'done') {
|
Line 2275 if ($readit ne 'done') {
|
my $config=Apache::File->new("$perlvar{'lonTabDir'}/hosts.tab"); |
my $config=Apache::File->new("$perlvar{'lonTabDir'}/hosts.tab"); |
|
|
while (my $configline=<$config>) { |
while (my $configline=<$config>) { |
|
chomp($configline); |
my ($id,$domain,$role,$name,$ip)=split(/:/,$configline); |
my ($id,$domain,$role,$name,$ip)=split(/:/,$configline); |
$hostname{$id}=$name; |
$hostname{$id}=$name; |
$hostdom{$id}=$domain; |
$hostdom{$id}=$domain; |