version 1.157, 2001/09/20 16:09:07
|
version 1.162, 2001/10/06 20:57:45
|
Line 118
|
Line 118
|
# 05/01,06/01,09/01 Gerd Kortemeyer |
# 05/01,06/01,09/01 Gerd Kortemeyer |
# 09/01 Guy Albertelli |
# 09/01 Guy Albertelli |
# 09/01,10/01,11/01 Gerd Kortemeyer |
# 09/01,10/01,11/01 Gerd Kortemeyer |
|
# YEAR=2001 |
# 02/27/01 Scott Harrison |
# 02/27/01 Scott Harrison |
# 3/2 Gerd Kortemeyer |
# 3/2 Gerd Kortemeyer |
# 3/15,3/19 Scott Harrison |
# 3/15,3/19 Scott Harrison |
Line 127
|
Line 128
|
# 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,8/20,8/23,9/20 Gerd Kortemeyer |
# 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/5 Scott Harrison |
|
|
package Apache::lonnet; |
package Apache::lonnet; |
|
|
Line 689 sub flushcourselogs {
|
Line 692 sub flushcourselogs {
|
|
|
sub courselog { |
sub courselog { |
my $what=shift; |
my $what=shift; |
|
$what=time.':'.$what; |
unless ($ENV{'request.course.id'}) { return ''; } |
unless ($ENV{'request.course.id'}) { return ''; } |
if (defined $courselogs{$ENV{'request.course.id'}}) { |
if (defined $courselogs{$ENV{'request.course.id'}}) { |
$courselogs{$ENV{'request.course.id'}}.='&'.$what; |
$courselogs{$ENV{'request.course.id'}}.='&'.$what; |
Line 700 sub courselog {
|
Line 704 sub courselog {
|
} |
} |
} |
} |
|
|
|
sub courseacclog { |
|
my $fnsymb=shift; |
|
unless ($ENV{'request.course.id'}) { return ''; } |
|
my $what=$fnsymb.':'.$ENV{'user.name'}.':'.$ENV{'user.domain'}; |
|
if ($what=~/(problem|exam|quiz|assess|survey|form)$/) { |
|
map { |
|
if ($_=~/^form\.(.*)/) { |
|
$what.=':'.$1.'='.$ENV{$_}; |
|
} |
|
} keys %ENV; |
|
} |
|
&courselog($what); |
|
} |
|
|
# ----------------------------------------------------------- Check out an item |
# ----------------------------------------------------------- Check out an item |
|
|
sub checkout { |
sub checkout { |
Line 1172 sub allowed {
|
Line 1190 sub allowed {
|
return 'F'; |
return 'F'; |
} |
} |
|
|
|
# Free bre to public access |
|
|
|
if ($priv eq 'bre') { |
|
if (&metadata($uri,'copyright') eq 'public') { return 'F'; } |
|
} |
|
|
my $thisallowed=''; |
my $thisallowed=''; |
my $statecond=0; |
my $statecond=0; |
my $courseprivid=''; |
my $courseprivid=''; |
Line 1611 sub modifystudent {
|
Line 1635 sub modifystudent {
|
return 'error: no such user'; |
return 'error: no such user'; |
} |
} |
# -------------------------------------------------- Add student to course list |
# -------------------------------------------------- Add student to course list |
my $reply=critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'. |
$reply=critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'. |
$ENV{'course.'.$cid.'.num'}.':classlist:'. |
$ENV{'course.'.$cid.'.num'}.':classlist:'. |
&escape($uname.':'.$udom).'='. |
&escape($uname.':'.$udom).'='. |
&escape($end.':'.$start), |
&escape($end.':'.$start), |
Line 1676 sub createcourse {
|
Line 1700 sub createcourse {
|
my $reply=&reply('encrypt:makeuser:'.$udom.':'.$uname.':none::', |
my $reply=&reply('encrypt:makeuser:'.$udom.':'.$uname.':none::', |
$ENV{'user.home'}); |
$ENV{'user.home'}); |
unless ($reply eq 'ok') { return 'error: '.$reply; } |
unless ($reply eq 'ok') { return 'error: '.$reply; } |
my $uhome=&homeserver($uname,$udom); |
$uhome=&homeserver($uname,$udom); |
if (($uhome eq '') || ($uhome eq 'no_host')) { |
if (($uhome eq '') || ($uhome eq 'no_host')) { |
return 'error: no such course'; |
return 'error: no such course'; |
} |
} |
Line 2302 sub unescape {
|
Line 2326 sub unescape {
|
# ================================================================ Main Program |
# ================================================================ Main Program |
|
|
sub BEGIN { |
sub BEGIN { |
if ($readit ne 'done') { |
unless ($readit) { |
# ------------------------------------------------------------ Read access.conf |
# ------------------------------------------------------------ Read access.conf |
{ |
{ |
my $config=Apache::File->new("/etc/httpd/conf/access.conf"); |
my $config=Apache::File->new("/etc/httpd/conf/access.conf"); |
Line 2347 if ($readit ne 'done') {
|
Line 2371 if ($readit ne 'done') {
|
|
|
while (my $configline=<$config>) { |
while (my $configline=<$config>) { |
chomp($configline); |
chomp($configline); |
|
if ($configline) { |
my ($role,$perm)=split(/ /,$configline); |
my ($role,$perm)=split(/ /,$configline); |
if ($perm ne '') { $pr{$role}=$perm; } |
if ($perm ne '') { $pr{$role}=$perm; } |
|
} |
} |
} |
} |
} |
|
|
Line 2358 if ($readit ne 'done') {
|
Line 2384 if ($readit ne 'done') {
|
|
|
while (my $configline=<$config>) { |
while (my $configline=<$config>) { |
chomp($configline); |
chomp($configline); |
|
if ($configline) { |
my ($short,$plain)=split(/:/,$configline); |
my ($short,$plain)=split(/:/,$configline); |
if ($plain ne '') { $prp{$short}=$plain; } |
if ($plain ne '') { $prp{$short}=$plain; } |
|
} |
} |
} |
} |
} |
|
|