[LON-CAPA-cvs] cvs: loncom /auth lonacc.pm

raeburn raeburn at source.lon-capa.org
Wed Mar 4 12:55:39 EST 2020


raeburn		Wed Mar  4 17:55:39 2020 EDT

  Modified files:              
    /loncom/auth	lonacc.pm 
  Log:
  - Don't set "last_known" symb, if current resource is /adm/navmaps (users
    always have access to "Contents" item in inline menu).
  - Don't store "last_known" symb for resources in a .page (store the symb
    for the enclosing .page instead).
  
  
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.175 loncom/auth/lonacc.pm:1.176
--- loncom/auth/lonacc.pm:1.175	Sun Jan 27 16:02:43 2019
+++ loncom/auth/lonacc.pm	Wed Mar  4 17:55:39 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.175 2019/01/27 16:02:43 raeburn Exp $
+# $Id: lonacc.pm,v 1.176 2020/03/04 17:55:39 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -713,9 +713,16 @@
 		}
 		if ($env{'form.symb'}) {
 		    $symb=&Apache::lonnet::symbclean($env{'form.symb'});
-		    if ($requrl =~ m|^/adm/wrapper/|
+		    if ($requrl eq '/adm/navmaps') {
+                        my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb);
+                        &Apache::lonnet::symblist($map,$murl => [$murl,$mid]);
+		    } elsif ($requrl =~ m|^/adm/wrapper/|
 			|| $requrl =~ m|^/adm/coursedocs/showdoc/|) {
 			my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb);
+                        if ($map =~ /\.page$/) {
+                            my $mapsymb = &Apache::lonnet::symbread($map);
+                            ($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb); 
+                        }
 			&Apache::lonnet::symblist($map,$murl => [$murl,$mid],
 						  'last_known' =>[$murl,$mid]);
 		    } elsif ((&Apache::lonnet::symbverify($symb,$requrl)) ||
@@ -724,6 +731,10 @@
                              (($requrl=~m|(.*/aboutme)/portfolio$|) &&
                               &Apache::lonnet::symbverify($symb,$1))) {
 			my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb);
+                        if (($map =~ /\.page$/) && ($requrl !~ /\.page$/)) {
+                            my $mapsymb = &Apache::lonnet::symbread($map);
+                            ($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb);
+                        }
 			&Apache::lonnet::symblist($map,$murl => [$murl,$mid],
 						  'last_known' =>[$murl,$mid]);
 		    } else {
@@ -749,8 +760,16 @@
 		        if ($symb) {
 			    my ($map,$mid,$murl)=
 			        &Apache::lonnet::decode_symb($symb);
-			    &Apache::lonnet::symblist($map,$murl =>[$murl,$mid],
-						      'last_known' =>[$murl,$mid]);
+                            if ($requrl eq '/adm/navmaps') {
+                                &Apache::lonnet::symblist($map,$murl =>[$murl,$mid]);
+                            } else {
+                                if (($map =~ /\.page$/) && ($requrl !~ /\.page$/)) {
+                                    my $mapsymb = &Apache::lonnet::symbread($map);
+                                    ($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb);
+                                }
+			        &Apache::lonnet::symblist($map,$murl =>[$murl,$mid],
+						          'last_known' =>[$murl,$mid]);
+                            }
 		        }
 		    }
 		}




More information about the LON-CAPA-cvs mailing list