[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth switchserver.pm /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Wed Oct 9 11:33:08 EDT 2024


raeburn		Wed Oct  9 15:33:08 2024 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/auth	switchserver.pm 
  Log:
  - For 2.11 Backport 1.67.
    Reverse 1.23 and 1.24 (part) so Remote Control window (if in use) is closed
    when switching server.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.147 loncom/lonnet/perl/lonnet.pm:1.1172.2.147.2.1
--- loncom/lonnet/perl/lonnet.pm:1.1172.2.147	Sun Feb 27 02:19:13 2022
+++ loncom/lonnet/perl/lonnet.pm	Fri Mar 25 22:53:51 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172.2.147 2022/02/27 02:19:13 raeburn Exp $
+# $Id: lonnet.pm,v 1.1172.2.147.2.1 2022/03/25 22:53:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5536,9 +5536,10 @@
 my $cachedtime='';
 
 sub load_all_first_access {
-    my ($uname,$udom)=@_;
+    my ($uname,$udom,$ignorecache)=@_;
     if (($cachedkey eq $uname.':'.$udom) &&
-        (abs($cachedtime-time)<5) && (!$env{'form.markaccess'})) {
+        (abs($cachedtime-time)<5) && (!$env{'form.markaccess'}) &&
+        (!$ignorecache)) {
         return;
     }
     $cachedtime=time;
@@ -5547,7 +5548,7 @@
 }
 
 sub get_first_access {
-    my ($type,$argsymb,$argmap)=@_;
+    my ($type,$argsymb,$argmap,$ignorecache)=@_;
     my ($symb,$courseid,$udom,$uname)=&whichuser();
     if ($argsymb) { $symb=$argsymb; }
     my ($map,$id,$res)=&decode_symb($symb);
@@ -5559,7 +5560,7 @@
     } else {
 	$res=$symb;
     }
-    &load_all_first_access($uname,$udom);
+    &load_all_first_access($uname,$udom,$ignorecache);
     return $cachedtimes{"$courseid\0$res"};
 }
 
@@ -8633,7 +8634,8 @@
                             }
                         }
                     }
-                    if ($interval[0] =~ /^\d+$/) {
+                    if ($interval[0] =~ /^(\d+)/) {
+                        my $timelimit = $1;
                         my $first_access;
                         if ($type eq 'resource') {
                             $first_access=&get_first_access($interval[1],$item);
@@ -8643,7 +8645,7 @@
                             $first_access=&get_first_access($interval[1]);
                         }
                         if ($first_access) {
-                            my $timesup = $first_access+$interval[0];
+                            my $timesup = $first_access+$timelimit;
                             if ($timesup > $now) {
                                 my $activeblock;
                                 if ($type eq 'resource') {
Index: loncom/auth/switchserver.pm
diff -u loncom/auth/switchserver.pm:1.35.2.8 loncom/auth/switchserver.pm:1.35.2.9
--- loncom/auth/switchserver.pm:1.35.2.8	Tue Oct  8 02:46:19 2024
+++ loncom/auth/switchserver.pm	Wed Oct  9 15:33:08 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Switch Servers Handler
 #
-# $Id: switchserver.pm,v 1.35.2.8 2024/10/08 02:46:19 raeburn Exp $
+# $Id: switchserver.pm,v 1.35.2.9 2024/10/09 15:33:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -31,6 +31,8 @@
 use strict;
 use Apache::Constants qw(:common :remotehost);
 use Apache::lonnet;
+use Apache::loncommon;
+use Apache::lonmenu;
 use Digest::MD5 qw(md5_hex);
 use CGI::Cookie();
 use Apache::lonlocal;
@@ -270,6 +272,8 @@
     }
 # -------------------------------------------------------- Menu script and info
 
+    my $windowinfo = &Apache::lonmenu::close();
+
 # ---------------------------------------------------------------- Get handover
 
     my ($is_balancer,$setcookie,$newcookieid,$otherbalcookie);
@@ -336,7 +340,7 @@
 	'&username='.$env{'user.name'}.
 	'&token='.$token;
 # --------------------------------------------------------------- Screen Output
-    return &do_redirect($r, $url, $only_body, $ssologoutscript);
+    return &do_redirect($r, $url, $only_body, $windowinfo.$ssologoutscript);
 }
 
 1;




More information about the LON-CAPA-cvs mailing list