--- docman.php 2000/08/04 10:20:22 1.8 +++ docman.php 2000/09/06 11:04:32 1.15 @@ -65,9 +65,9 @@ TODO: mixed file/directory output (add type to each entry, real support for links) - add more content-management (like cms.sourceforge.net): - check-out/check-in/reserve - comments to files + retrieve old versions of files (overwritten) + show last lock date + */ ////////////////////////////////////////////////////////////////// @@ -108,6 +108,7 @@ if ($user[0] == $GLOBALS["PHP_AUTH_USER"]) { $gblUserName=$user[1]; $gblPw=$user[2]; + $gblEmail=$user[3]; continue ; } } @@ -120,8 +121,11 @@ $gblDateFmt="Y-m-d"; $gblTimeFmt="H:i:s"; -// Number of backup files to keep - $gblNumBackups=5; + // Number of backup files to keep + $gblNumBackups=3; + + // show red star if newer than ... days + $gblModDays=1; // choose GifIcon below unless you have the M$ // WingDings font installed on your system @@ -194,7 +198,7 @@


- +

" ; - echo htmlentities($tstr) . "

" . $tstr ; +// echo htmlentities($tstr) . "

" . $tstr ; + echo $tstr ; } ?> @@ -362,17 +368,29 @@
CHANGES TO THIS FILE
\n"; $log=fopen($logname,"r"); $cl1=" class=lst"; $cl2=""; + $logarr = array(); while($line = fgetcsv($log,255,"\t")) { $cl=$cl1; $cl1=$cl2; $cl2=$cl; - print "$line[0]$line[1]$line[2]$line[3]\n"; + array_unshift($logarr,array($cl,$line[0],$line[1],$line[2],$line[3])); } fclose($log); + print "

CHANGES TO THIS FILE
\n"; + $bakcount = 0; // start from 0, skip fist backup (it's current) + while ($e = array_shift($logarr)) { + if (strstr($e[4],"upload")) { + if (file_exists("$bakdir/$bakcount/$name")) { + $e[4]="$e[4]"; + } + $bakcount++; + } + print "$e[1]$e[2]$e[3]$e[4]\n"; + } print "
"; } @@ -628,7 +646,7 @@ function Navigate($fsRoot,$relDir) { - global $gblEditable, $gblIcon ; + global $gblEditable, $gblIcon, $gblModDays ; $self = $GLOBALS["PHP_SELF"] ; if (isset($GLOBALS["HTTPS"]) && $GLOBALS["HTTPS"] == "on") { @@ -743,9 +761,9 @@ $info_url=$self."?A=E&F=".urlencode($file)."&D=".urlencode($relDir); - if ( ($mod + 30*86400) > time() ) { + if ( ($mod + $gblModDays*86400) > time() ) { $a = " * " ; + $a .= " than $gblModDays days\"> * " ; } $file_lock=CheckLock($path); @@ -831,11 +849,11 @@
-To just view file without editing, select it's filename (don't edit files which are opened this way!)
-To edit file select to check-out -and edit it locally. After editing is over, select filename or to check-in (update copy of file on server).
-If you select icon left from filename, you will get detailed information -about file, as well as delete, rename and annotation options. +
@@ -848,8 +866,7 @@ - OR UPLOAD A FILE + OR UPLOAD A FILE @@ -1070,11 +1087,11 @@ ////////////////////////////////////////////////////////////////// -function redir_to_url($url) { +function urlpath($url) { $url=urlencode(StripSlashes("$url")); $url=str_replace("%2F","/",$url); $url=str_replace("+","%20",$url); - Header("Location: $url"); + return($url); } ////////////////////////////////////////////////////////////////// @@ -1288,6 +1305,9 @@ safe_rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME"); safe_rename("$fsDir/.note/$FN","$fsDir/.note/$NEWNAME"); safe_rename("$fsDir/.lock/$FN","$fsDir/.lock/$NEWNAME"); + for($i=0;$i<=$GLOBALS[gblNumBackups];$i++) { + safe_rename("$fsDir/.bak/$i/$FN","$fsDir/.bak/$i/$NEWNAME"); + } break ; @@ -1342,7 +1362,8 @@ case "Co" : // checkout Lock("$gblFsRoot/$relDir/$F"); - redir_to_url("$relDir/$F"); + header("Content-Disposition: attachment; filename=$F" ); + Header("Location: ".urlpath("$relDir/$F")); exit; case "Ci" : // upload && update to $relDir @@ -1356,8 +1377,9 @@ exit ; case "V" : // view - Log("viewed"); - redir_to_url("$relDir/$F"); + LogIt("$gblFsRoot/$relDir/$F","viewed"); + header("Content-Disposition: attachment; filename=$F" ); + Header("Location: ".urlpath("$relDir/$F")); exit; }