version 1.707, 2006/02/07 16:21:05
|
version 1.710, 2006/02/10 22:33:48
|
Line 948 sub studentphoto {
|
Line 948 sub studentphoto {
|
my ($udom,$unam,$ext) = @_; |
my ($udom,$unam,$ext) = @_; |
my $home=&Apache::lonnet::homeserver($unam,$udom); |
my $home=&Apache::lonnet::homeserver($unam,$udom); |
if (defined($env{'request.course.id'})) { |
if (defined($env{'request.course.id'})) { |
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphotos'}) { |
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) { |
if ($udom eq $env{'course.'.$env{'request.course.id'}.'.domain'}) { |
if ($udom eq $env{'course.'.$env{'request.course.id'}.'.domain'}) { |
return(&retrievestudentphoto($udom,$unam,$ext)); |
return(&retrievestudentphoto($udom,$unam,$ext)); |
} else { |
} else { |
Line 3450 sub allowed {
|
Line 3450 sub allowed {
|
return 'F'; |
return 'F'; |
} |
} |
|
|
|
sub split_uri_for_cond { |
|
my $uri=&deversion(&declutter(shift)); |
|
my @uriparts=split(/\//,$uri); |
|
my $filename=pop(@uriparts); |
|
my $pathname=join('/',@uriparts); |
|
return ($pathname,$filename); |
|
} |
# --------------------------------------------------- Is a resource on the map? |
# --------------------------------------------------- Is a resource on the map? |
|
|
sub is_on_map { |
sub is_on_map { |
my $uri=&deversion(&declutter(shift)); |
my ($pathname,$filename) = &split_uri_for_cond(shift); |
my @uriparts=split(/\//,$uri); |
|
my $filename=$uriparts[$#uriparts]; |
|
my $pathname=$uri; |
|
$pathname=~s|/\Q$filename\E$||; |
|
$pathname=~s/^adm\/wrapper\///; |
|
$pathname=~s/^adm\/coursedocs\/showdoc\///; |
|
#Trying to find the conditional for the file |
#Trying to find the conditional for the file |
my $match=($env{'acc.res.'.$env{'request.course.id'}.'.'.$pathname}=~ |
my $match=($env{'acc.res.'.$env{'request.course.id'}.'.'.$pathname}=~ |
/\&\Q$filename\E\:([\d\|]+)\&/); |
/\&\Q$filename\E\:([\d\|]+)\&/); |
Line 3737 sub auto_photo_permission {
|
Line 3738 sub auto_photo_permission {
|
my $homeserver = &homeserver($cnum,$cdom); |
my $homeserver = &homeserver($cnum,$cdom); |
my ($outcome,$perm_reqd,$conditions) = |
my ($outcome,$perm_reqd,$conditions) = |
split(/:/,&unescape(&reply('autophotopermission:'.$cdom,$homeserver)),3); |
split(/:/,&unescape(&reply('autophotopermission:'.$cdom,$homeserver)),3); |
|
if ($outcome =~ /^(con_lost|unknown_cmd|no_such_host)$/) { |
|
return (undef,undef); |
|
} |
return ($outcome,$perm_reqd,$conditions); |
return ($outcome,$perm_reqd,$conditions); |
} |
} |
|
|
Line 3747 sub auto_checkphotos {
|
Line 3751 sub auto_checkphotos {
|
my $outcome = &unescape(&reply('autophotocheck:'.&escape($udom).':'. |
my $outcome = &unescape(&reply('autophotocheck:'.&escape($udom).':'. |
&escape($uname).':'.&escape($pid), |
&escape($uname).':'.&escape($pid), |
$homeserver)); |
$homeserver)); |
|
if ($outcome =~ /^(con_lost|unknown_cmd|no_such_host)$/) { |
|
return (undef,undef); |
|
} |
if ($outcome) { |
if ($outcome) { |
($result,$resulttype) = split(/:/,$outcome); |
($result,$resulttype) = split(/:/,$outcome); |
} |
} |
Line 3759 sub auto_photochoice {
|
Line 3766 sub auto_photochoice {
|
my ($update,$comment) = split(/:/,&unescape(&reply('autophotochoice:'. |
my ($update,$comment) = split(/:/,&unescape(&reply('autophotochoice:'. |
&escape($cdom), |
&escape($cdom), |
$homeserver))); |
$homeserver))); |
|
if ($update =~ /^(con_lost|unknown_cmd|no_such_host)$/) { |
|
return (undef,undef); |
|
} |
return ($update,$comment); |
return ($update,$comment); |
} |
} |
|
|