version 1.161, 2001/10/05 17:54:36
|
version 1.166, 2001/10/16 21:16:01
|
Line 130
|
Line 130
|
# July Guy Albertelli |
# July Guy Albertelli |
# 8/4,8/7,8/8,8/9,8/11,8/16,8/17,8/18,8/20,8/23,9/20,9/21,9/26, |
# 8/4,8/7,8/8,8/9,8/11,8/16,8/17,8/18,8/20,8/23,9/20,9/21,9/26, |
# 10/2 Gerd Kortemeyer |
# 10/2 Gerd Kortemeyer |
# 10/5 Scott Harrison |
# 10/5,10/10 Scott Harrison |
|
|
package Apache::lonnet; |
package Apache::lonnet; |
|
|
Line 148 use Fcntl qw(:flock);
|
Line 148 use Fcntl qw(:flock);
|
|
|
# --------------------------------------------------------------------- Logging |
# --------------------------------------------------------------------- Logging |
|
|
|
sub logtouch { |
|
my $execdir=$perlvar{'lonDaemons'}; |
|
unless (-e "$execdir/logs/lonnet.log") { |
|
my $fh=Apache::File->new(">>$execdir/logs/lonnet.log"); |
|
close $fh; |
|
} |
|
my ($wwwuid,$wwwgid)=(getpwnam('www'))[2,3]; |
|
chown($wwwuid,$wwwgid,$execdir.'/logs/lonnet.log'); |
|
} |
|
|
sub logthis { |
sub logthis { |
my $message=shift; |
my $message=shift; |
my $execdir=$perlvar{'lonDaemons'}; |
my $execdir=$perlvar{'lonDaemons'}; |
my $now=time; |
my $now=time; |
my $local=localtime($now); |
my $local=localtime($now); |
my $fh; |
my $fh=Apache::File->new(">>$execdir/logs/lonnet.log"); |
$fh=Apache::File->new(">>$execdir/logs/lonnet.log") and |
print $fh "$local ($$): $message\n"; |
print $fh "$local ($$): $message\n"; |
|
return 1; |
return 1; |
} |
} |
|
|
Line 164 sub logperm {
|
Line 173 sub logperm {
|
my $execdir=$perlvar{'lonDaemons'}; |
my $execdir=$perlvar{'lonDaemons'}; |
my $now=time; |
my $now=time; |
my $local=localtime($now); |
my $local=localtime($now); |
my $fh; |
my $fh=Apache::File->new(">>$execdir/logs/lonnet.perm.log"); |
$fh=Apache::File->new(">>$execdir/logs/lonnet.perm.log") and |
print $fh "$now:$message:$local\n"; |
print $fh "$now:$message:$local\n"; |
|
return 1; |
return 1; |
} |
} |
|
|
Line 1233 sub allowed {
|
Line 1241 sub allowed {
|
|
|
# If this is generating or modifying users, exit with special codes |
# If this is generating or modifying users, exit with special codes |
|
|
if (':csu:cdc:ccc:cin:cta:cep:ccr:cst:cad:cli:cau:cdg:'=~/\:$priv\:/) { |
if (':csu:cdc:ccc:cin:cta:cep:ccr:cst:cad:cli:cau:cdg:cca:'=~/\:$priv\:/) { |
return $thisallowed; |
return $thisallowed; |
} |
} |
# |
# |
Line 2425 unless ($readit) {
|
Line 2433 unless ($readit) {
|
%metacache=(); |
%metacache=(); |
|
|
$readit='done'; |
$readit='done'; |
|
&logtouch(); |
&logthis('<font color=yellow>INFO: Read configuration</font>'); |
&logthis('<font color=yellow>INFO: Read configuration</font>'); |
} |
} |
} |
} |