version 1.300, 2002/11/12 22:23:37
|
version 1.301, 2002/11/18 15:16:35
|
Line 78 use LWP::UserAgent();
|
Line 78 use LWP::UserAgent();
|
use HTTP::Headers; |
use HTTP::Headers; |
use vars |
use vars |
qw(%perlvar %hostname %homecache %badServerCache %hostip %iphost %spareid %hostdom |
qw(%perlvar %hostname %homecache %badServerCache %hostip %iphost %spareid %hostdom |
%libserv %pr %prp %metacache %packagetab |
%libserv %pr %prp %metacache %packagetab %titlecache |
%courselogs %accesshash $processmarker $dumpcount |
%courselogs %accesshash $processmarker $dumpcount |
%coursedombuf %coursehombuf %courseresdatacache %domaindescription); |
%coursedombuf %coursehombuf %courseresdatacache %domaindescription); |
use IO::Socket; |
use IO::Socket; |
Line 1802 sub allowed {
|
Line 1802 sub allowed {
|
|
|
if ($priv eq 'bre') { |
if ($priv eq 'bre') { |
my $copyright=&metadata($uri,'copyright'); |
my $copyright=&metadata($uri,'copyright'); |
if ($copyright eq 'public') { return 'F'; } |
if (($copyright eq 'public') && (!$ENV{'request.course.id'})) { |
|
return 'F'; |
|
} |
if ($copyright eq 'priv') { |
if ($copyright eq 'priv') { |
$uri=~/([^\/]+)\/([^\/]+)\//; |
$uri=~/([^\/]+)\/([^\/]+)\//; |
unless (($ENV{'user.name'} eq $2) && ($ENV{'user.domain'} eq $1)) { |
unless (($ENV{'user.name'} eq $2) && ($ENV{'user.domain'} eq $1)) { |
Line 3096 sub metadata_generate_part0 {
|
Line 3098 sub metadata_generate_part0 {
|
} |
} |
} |
} |
|
|
|
# ------------------------------------------------- Get the title of a resource |
|
|
|
sub gettitle { |
|
my $urlsymb=shift; |
|
my $symb=&symbread($urlsymb); |
|
unless ($symb) { |
|
unless ($urlsymb) { $urlsymb=$ENV{'request.filename'}; } |
|
return &metadata($urlsymb,'title'); |
|
} |
|
if ($titlecache{$symb}) { return $titlecache{$symb}; } |
|
my ($map,$resid,$url)=split(/\_\_\_/,$symb); |
|
my $title=''; |
|
my %bighash; |
|
if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
|
&GDBM_READER(),0640)) { |
|
my $mapid=$bighash{'map_pc_'.&clutter($map)}; |
|
$title=$bighash{'title_'.$mapid.'.'.$resid}; |
|
untie %bighash; |
|
} |
|
if ($title) { |
|
$titlecache{$symb}=$title; |
|
return $title; |
|
} else { |
|
return &metadata($urlsymb,'title'); |
|
} |
|
} |
|
|
# ------------------------------------------------- Update symbolic store links |
# ------------------------------------------------- Update symbolic store links |
|
|
sub symblist { |
sub symblist { |