--- siteman.php 2000/09/06 10:49:15 1.13
+++ siteman.php 2000/09/13 09:59:16 1.22
@@ -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
@@ -295,7 +299,7 @@
undelete";
}
$text .= " or revise files on this web site." ;
+ $text .= "
Examine list of files changed in last day or all changes.";
StartHTML("(Navigate)",$text) ;
echo "
$date | $time | $dir/$file | $e[2] | $e[3] |
".GifIcon(up)." Back to front page.
"; +} + +////////////////////////////////////////////////////////////////// + // MAIN PROGRAM // ============ // query parameters: capital letters @@ -1157,7 +1225,9 @@ $fsDir = $gblFsRoot . $relDir ; // current directory if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ; - + + $FN=stripSlashes($FN); + switch ($POSTACTION) { case "UPLOAD" : if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; @@ -1193,10 +1263,12 @@ if (isset($FILENAME)) { Unlock($target); } + ChangeLog($target,"updated"); break ; case "SAVE" : - $path = $gblFsRoot . escapeshellcmd($RELPATH) ; + $path = $gblFsRoot . $RELPATH ; + $path=stripSlashes($path); $writable = is_writeable($path) ; $legaldir = is_writeable(dirname($path)) ; $exists = (file_exists($path)) ? 1 : 0 ; @@ -1204,10 +1276,12 @@ if (!($writable || (!$exists && $legaldir))) Error("Write denied",$RELPATH) ; $fh = fopen($path, "w") ; + $FILEDATA=stripSlashes($FILEDATA); fwrite($fh,$FILEDATA) ; fclose($fh) ; clearstatcache() ; Logit($path,"saved changes"); + ChangeLog($path,"saved changes"); break ; case "CREATE" : @@ -1238,6 +1312,7 @@ } $tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ; header("Location: " . $tstr) ; + ChangeLog($target,"created"); exit ; } break ; @@ -1270,7 +1345,7 @@ } } else { // delete directory - if ( ! @rmdir($fsDir) ) { + if ( ! @rrmdir($fsDir) ) { Error("Rmdir failed", $tstr . $fsDir) ; } else { @@ -1335,7 +1410,7 @@ // $A=Ci : checkin file $D/$F // $A=V : view file (do nothing except log) // default : display directory $D - + switch ($A) { case "U" : // upload to $relDir @@ -1348,10 +1423,12 @@ EndHTML() ; exit ; case "E" : + $F=stripSlashes($F); // detail of $relDir/$F if (is_file("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ; exit ; case "C" : + $F=stripSlashes($F); // listing of $relDir/$F DisplayCode($gblFsRoot, $relDir, $F) ; exit ; @@ -1362,6 +1439,7 @@ Header("Location: ".urlpath("$relDir/$F")); exit; case "Ci" : + $F=stripSlashes($F); // upload && update to $relDir if (!is_writeable($gblFsRoot . $relDir)) Error("Write access denied",$relDir) ; @@ -1377,6 +1455,16 @@ header("Content-Disposition: attachment; filename=$F" ); Header("Location: ".urlpath("$relDir/$F")); exit; + case "Ch" : + StartHTML("(File changes)","All changes chronologicaly..."); + DisplayChangeLog(0); // all + EndHTML() ; + exit; + case "Ch1" : + StartHTML("(File changes)","Changes to files in last day..."); + DisplayChangeLog(1); + EndHTML() ; + exit; } // default: display directory $relDir