[prev in list] [next in list] [prev in thread] [next in thread]
List: lon-capa-cvs
Subject: [LON-CAPA-cvs] cvs: loncom / lond
From: raeburn <raeburn () source ! lon-capa ! org>
Date: 2016-05-08 19:05:10
Message-ID: cvsraeburn1462734310 () cvsserver
[Download RAW message or body]
raeburn Sun May 8 19:05:10 2016 EDT
Modified files:
/loncom lond
Log:
- &remove_user_file_handler() should remove .bak file (if one exists)
when removing uploaded html file from a course.
Index: loncom/lond
diff -u loncom/lond:1.519 loncom/lond:1.520
--- loncom/lond:1.519 Sat Apr 2 04:30:29 2016
+++ loncom/lond Sun May 8 19:05:10 2016
@@ -2,7 +2,7 @@
# The LearningOnline Network
# lond "LON Daemon" Server (port "LOND" 5663)
#
-# $Id: lond,v 1.519 2016/04/02 04:30:29 raeburn Exp $
+# $Id: lond,v 1.520 2016/05/08 19:05:10 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -64,7 +64,7 @@
my $status='';
my $lastlog='';
-my $VERSION='$Revision: 1.519 $'; #' stupid emacs
+my $VERSION='$Revision: 1.520 $'; #' stupid emacs
my $remoteVERSION;
my $currenthostid="default";
my $currentdomainid;
@@ -2496,11 +2496,20 @@
if (-e $file) {
#
# If the file is a regular file unlink is fine...
- # However it's possible the client wants a dir.
- # removed, in which case rmdir is more approprate:
+ # However it's possible the client wants a dir
+ # removed, in which case rmdir is more appropriate.
+ # Note: rmdir will only remove an empty directory.
#
if (-f $file){
unlink($file);
+ # for html files remove the associated .bak file
+ # which may have been created by the editor.
+ if ($ufile =~ \
m{^((docs|supplemental)/(?:\d+|default)/\d+(?:|/.+)/)[^/]+\.x?html?$}i) { + \
my $path = $1; + if (-e $file.'.bak') {
+ unlink($file.'.bak');
+ }
+ }
} elsif(-d $file) {
rmdir($file);
}
_______________________________________________
LON-CAPA-cvs mailing list
LON-CAPA-cvs@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic