version 1.292, 2002/10/07 13:50:36
|
version 1.296, 2002/10/10 14:34:05
|
Line 86 use GDBM_File;
|
Line 86 use GDBM_File;
|
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use HTML::LCParser; |
use HTML::LCParser; |
use Fcntl qw(:flock); |
use Fcntl qw(:flock); |
|
use Apache::loncoursedata; |
|
|
my $readit; |
my $readit; |
|
|
# --------------------------------------------------------------------- Logging |
# --------------------------------------------------------------------- Logging |
Line 838 sub finishuserfileupload {
|
Line 840 sub finishuserfileupload {
|
} |
} |
# Notify homeserver to grep it |
# Notify homeserver to grep it |
# |
# |
if |
|
(&reply('fetchuserfile:'.$docudom.'/'.$docuname.'/'.$fname,$docuhome) eq 'ok') |
my $fetchresult= |
{ |
&reply('fetchuserfile:'.$docudom.'/'.$docuname.'/'.$fname,$docuhome); |
|
if ($fetchresult eq 'ok') { |
# |
# |
# Return the URL to it |
# Return the URL to it |
return '/uploaded/'.$path.$fname; |
return '/uploaded/'.$path.$fname; |
} else { |
} else { |
|
&logthis('Failed to transfer '.$docudom.'/'.$docuname.'/'.$fname. |
|
' to host '.$docuhome.': '.$fetchresult); |
return '/adm/notfound.html'; |
return '/adm/notfound.html'; |
} |
} |
} |
} |
Line 2320 sub modifystudent {
|
Line 2325 sub modifystudent {
|
return 'error: no such user'; |
return 'error: no such user'; |
} |
} |
# -------------------------------------------------- Add student to course list |
# -------------------------------------------------- Add student to course list |
|
if ($first eq '' || $last eq '' || $uid eq '') { |
|
# They did not supply us with enough data to enroll the student, so |
|
# we need to pick up more information. |
|
my %tmp = &dump('environment',$udom,$uname, |
|
['firstname','middlename','lastname', 'generation','id'] |
|
); |
|
$first = $tmp{'firstname'} if (!defined($first) || $first eq ''); |
|
$middle = $tmp{'middlename'} if (!defined($middle) || $middle eq ''); |
|
$last = $tmp{'lastname'} if (!defined($last) || $last eq ''); |
|
$gene = $tmp{'genename'} if (!defined($gene) || $gene eq ''); |
|
$uid = $tmp{'id'} if (!defined($uid) || $uid eq ''); |
|
} |
|
my $fullname = &Apache::loncoursedata::ProcessFullName($last,$gene, |
|
$first,$middle); |
$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(join(':',$end,$start,$uid,$usec,$fullname)), |
$ENV{'course.'.$cid.'.home'}); |
$ENV{'course.'.$cid.'.home'}); |
unless (($reply eq 'ok') || ($reply eq 'delayed')) { |
unless (($reply eq 'ok') || ($reply eq 'delayed')) { |
return 'error: '.$reply; |
return 'error: '.$reply; |
Line 2838 sub metadata {
|
Line 2857 sub metadata {
|
|
|
$uri=&declutter($uri); |
$uri=&declutter($uri); |
# if it is a non metadata possible uri return quickly |
# if it is a non metadata possible uri return quickly |
if (($uri eq '') || ($uri =~ m|^/*adm/|) || ($uri =~ m|/$|) || |
if (($uri eq '') || (($uri =~ m|^/*adm/|) && ($uri !~ m|^adm/includes|)) || |
($uri =~ m|/.meta$|)) { |
($uri =~ m|/$|) || ($uri =~ m|/.meta$|)) { |
return ''; |
return ''; |
} |
} |
my $filename=$uri; |
my $filename=$uri; |