[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
raeburn
raeburn at source.lon-capa.org
Sat Jun 12 17:37:36 EDT 2021
raeburn Sat Jun 12 21:37:36 2021 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- Bug 6907
- &deeplink_check() supports cases where deeplink parameter for item which
provided initial login has range of resources available after initial
access via deep-link set to map or rec.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1458 loncom/lonnet/perl/lonnet.pm:1.1459
--- loncom/lonnet/perl/lonnet.pm:1.1458 Mon Jun 7 12:15:04 2021
+++ loncom/lonnet/perl/lonnet.pm Sat Jun 12 21:37:36 2021
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1458 2021/06/07 12:15:04 raeburn Exp $
+# $Id: lonnet.pm,v 1.1459 2021/06/12 21:37:36 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -9065,10 +9065,19 @@
if ($symb eq $login) {
$allow = 1;
}
- } elsif ($scope eq 'map') {
-#FIXME Compare map for $env{'request.deeplink.login'} with map for $symb
- } elsif ($scope eq 'rec') {
-#FIXME Recurse up for $env{'request.deeplink.login'} with map for $symb
+ } elsif (($scope eq 'map') || ($scope eq 'rec')) {
+ my ($map_from_symb) = &deversion((&decode_symb($symb))[0]);
+ my ($map_from_login) = &deversion((&decode_symb($login))[0]);
+ if (($map_from_symb) && ($map_from_login)) {
+ if ($map_from_symb eq $map_from_login) {
+ $allow = 1;
+ } elsif ($scope eq 'rec') {
+ my @recurseup = &get_map_hierarchy($map_from_symb,$env{'request.course.id'});
+ if (grep(/^\Q$map_from_login\E$/, at recurseup)) {
+ $allow = 1;
+ }
+ }
+ }
}
} else {
my ($acctype,$item) = split(/:/,$access);
More information about the LON-CAPA-cvs
mailing list