[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Sat Aug 3 21:02:41 EDT 2019


raeburn		Sun Aug  4 01:02:41 2019 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	loncommon.pm 
  Log:
  - For 2.11
    Backport 1.1295, 1.1320
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.135 loncom/interface/loncommon.pm:1.1075.2.136
--- loncom/interface/loncommon.pm:1.1075.2.135	Tue Jul 30 21:13:54 2019
+++ loncom/interface/loncommon.pm	Sun Aug  4 01:02:40 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.135 2019/07/30 21:13:54 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.136 2019/08/04 01:02:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1404,7 +1404,7 @@
         &Apache::loncommon::start_page('Help Menu', undef,
 				       {'frameset'    => 1,
 					'js_ready'    => 1,
-                                        'use_absolute' => $httphost, 
+                                        'use_absolute' => $httphost,
 					'add_entries' => {
 					    'border' => '0',
 					    'rows'   => "110,*",},});
@@ -15519,7 +15519,23 @@
 	    opendir(DIR,$lonids);
 	    while ($filename=readdir(DIR)) {
 		if ($filename=~/^$username\_\d+\_$domain\_$authhost\.id$/) {
-		    unlink($lonids.'/'.$filename);
+                    if (tie(my %oldenv,'GDBM_File',"$lonids/$filename",
+                            &GDBM_READER(),0640)) {
+                        my $linkedfile;
+                        if (exists($oldenv{'user.linkedenv'})) {
+                            $linkedfile = $oldenv{'user.linkedenv'};
+                        }
+                        untie(%oldenv);
+                        if (unlink("$lonids/$filename")) {
+                            if ($linkedfile =~ /^[a-f0-9]+_linked$/) {
+                                if (-l "$lonids/$linkedfile.id") {
+                                    unlink("$lonids/$linkedfile.id");
+                                }
+                            }
+                        }
+                    } else {
+                        unlink($lonids.'/'.$filename);
+                    }
 		}
 	    }
 	    closedir(DIR);




More information about the LON-CAPA-cvs mailing list