--- loncom/publisher/lonpubdir.pm 2006/04/18 22:38:08 1.90 +++ loncom/publisher/lonpubdir.pm 2006/05/17 13:41:45 1.91 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construction Space Directory Lister # -# $Id: lonpubdir.pm,v 1.90 2006/04/18 22:38:08 albertel Exp $ +# $Id: lonpubdir.pm,v 1.91 2006/05/17 13:41:45 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::Constants qw(:common :http : use Apache::loncacc; use Apache::loncommon(); use Apache::lonhtmlcommon(); +use Apache::londiff(); use Apache::lonlocal; use Apache::lonmsg; use Apache::lonmenu; @@ -571,12 +572,23 @@ sub putresource { # $uname.'/'.$thisdisfn.'/'.$filename.'">'. # &mt('Delete').''; if (-e $resdir.'/'.$filename) { + my $same=0; my ($rdev,$rino,$rmode,$rnlink, $ruid,$rgid,$rrdev,$rsize, $ratime,$rmtime,$rctime, $rblksize,$rblocks)=stat($resdir.'/'.$filename); + if ($rmtime>=$cmtime) { + $same=1; + } else { + if (&Apache::londiff::are_different_files($resdir.'/'.$filename, + '/home/'.$uname.'/public_html/'.$thisdisfn.'/'.$filename)) { + $same=0; + } else { + $same=1; + } + } $publish_button=&mt('Re-publish'); - if ($rmtime>=$cmtime) { + if ($same) { $pubstatus = 'published'; $status=&mt('Published').'
'. &mt(&getCopyRightString($targetdir.'/'.$filename)).' '.