--- loncom/lonnet/perl/lonnet.pm 2015/04/15 04:11:17 1.1282 +++ loncom/lonnet/perl/lonnet.pm 2015/05/13 20:38:31 1.1285 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1282 2015/04/15 04:11:17 raeburn Exp $ +# $Id: lonnet.pm,v 1.1285 2015/05/13 20:38:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7332,7 +7332,7 @@ sub get_commblock_resources { if ($timesup > $now) { my $activeblock; foreach my $res (@to_test) { - if ($res->completable()) { + if ($res->answerable()) { $activeblock = 1; last; } @@ -12726,10 +12726,11 @@ BEGIN { my $item = $token->[1]; my $name = $token->[2]{'name'}; my $value = $token->[2]{'value'}; - if ($item ne '' && $name ne '' && $value ne '') { + my $valuematch = $token->[2]{'valuematch'}; + if ($item ne '' && $name ne '' && ($value ne '' || $valuematch ne '')) { my $release = $parser->get_text(); $release =~ s/(^\s*|\s*$ )//gx; - $needsrelease{$item.':'.$name.':'.$value} = $release; + $needsrelease{$item.':'.$name.':'.$value.':'.$valuematch} = $release; } } } @@ -13052,13 +13053,29 @@ escaped strings of the action recorded i =item * -allowed($priv,$uri,$symb,$role) : check for a user privilege; returns codes for allowed actions +allowed($priv,$uri,$symb,$role,$clientip,$noblockcheck) : check for a user privilege; +returns codes for allowed actions. + +The first argument is required, all others are optional. + +$priv is the privilege being checked. +$uri contains additional information about what is being checked for access (e.g., +URL, course ID etc.). +$symb is the unique resource instance identifier in a course; if needed, +but not provided, it will be retrieved via a call to &symbread(). +$role is the role for which a priv is being checked (only used if priv is evb). +$clientip is the user's IP address (only used when checking for access to portfolio +files). +$noblockcheck, if true, skips calls to &has_comm_blocking() for the bre priv. This +prevents recursive calls to &allowed. + F: full access U,I,K: authentication modes (cxx only) '': forbidden 1: user needs to choose course 2: browse allowed A: passphrase authentication needed + B: access temporarily blocked because of a blocking event in a course. =item *