--- loncom/lonnet/perl/lonnet.pm 2001/12/18 20:59:38 1.191 +++ loncom/lonnet/perl/lonnet.pm 2001/12/27 17:00:30 1.194 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.191 2001/12/18 20:59:38 harris41 Exp $ +# $Id: lonnet.pm,v 1.194 2001/12/27 17:00:30 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,6 +64,7 @@ # 12/5 Guy Albertelli # 12/6,12/7,12/12 Gerd Kortemeyer # 12/18 Scott Harrison +# 12/21,12/22,12/27 Gerd Kortemeyer # ### @@ -75,7 +76,7 @@ use LWP::UserAgent(); use HTTP::Headers; use vars qw(%perlvar %hostname %homecache %hostip %spareid %hostdom - %libserv %pr %prp %fe %fd %metacache %packagetab + %libserv %pr %prp %metacache %packagetab %courselogs %accesshash $processmarker $dumpcount %coursedombuf %coursehombuf); use IO::Socket; @@ -708,7 +709,7 @@ 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)$/) { + if ($fnsymb=~/(problem|exam|quiz|assess|survey|form)$/) { $what.=':POST'; foreach (keys %ENV) { if ($_=~/^form\.(.*)/) { @@ -1273,11 +1274,16 @@ sub del { # -------------------------------------------------------------- dump interface sub dump { - my ($namespace,$udomain,$uname)=@_; + my ($namespace,$udomain,$uname,$regexp)=@_; if (!$udomain) { $udomain=$ENV{'user.domain'}; } if (!$uname) { $uname=$ENV{'user.name'}; } my $uhome=&homeserver($uname,$udomain); - my $rep=reply("dump:$udomain:$uname:$namespace",$uhome); + if ($regexp) { + $regexp=&escape($regexp); + } else { + $regexp='.'; + } + my $rep=reply("dump:$udomain:$uname:$namespace:$regexp",$uhome); my @pairs=split(/\&/,$rep); my %returnhash=(); foreach (@pairs) { @@ -1548,7 +1554,7 @@ sub allowed { if ($thisallowed=~/C/) { my $rolecode=(split(/\./,$ENV{'request.role'}))[0]; if ($ENV{'course.'.$ENV{'request.course.id'}.'.'.$priv.'.roles.denied'} - =~/\,$rolecode\,/) { + =~/$rolecode/) { &log($ENV{'user.domain'},$ENV{'user.name'},$ENV{'user.host'}, 'Denied by role: '.$priv.' for '.$uri.' as '.$rolecode.' in '. $ENV{'request.course.id'}); @@ -2627,21 +2633,6 @@ BEGIN { } } -# ------------------------------------------------------------- Read file types -{ - my $config=Apache::File->new("$perlvar{'lonTabDir'}/filetypes.tab"); - - while (my $configline=<$config>) { - next if ($configline =~ /^\#/); - chomp($configline); - my ($ending,$emb,@descr)=split(/\s+/,$configline); - if ($descr[0] ne '') { - $fe{$ending}=lc($emb); - $fd{$ending}=join(' ',@descr); - } - } -} - %metacache=(); $processmarker=$$.'_'.time.'_'.$perlvar{'lonHostID'}; @@ -2869,8 +2860,9 @@ namesp ($udomain and $uname are optional =item * -dump($namespace,$udomain,$uname) : dumps the complete namespace into a hash -($udomain and $uname are optional) +dump($namespace,$udomain,$uname,$regexp) : +dumps the complete (or key matching regexp) namespace into a hash +($udomain, $uname and $regexp are optional) =item *