367 |
</FORM> |
</FORM> |
368 |
|
|
369 |
<?php |
<?php |
370 |
|
|
371 |
$name=basename("$fsDir/$fn"); |
$name=basename("$fsDir/$fn"); |
372 |
$logname=dirname("$fsDir/$fn")."/.log/$name"; |
$logname=dirname("$fsDir/$fn")."/.log/$name"; |
373 |
$bakdir=dirname("$fsDir/$fn")."/.bak"; |
$bakdir=dirname("$fsDir/$fn")."/.bak"; |
978 |
|
|
979 |
function LogIt($target,$msg) { |
function LogIt($target,$msg) { |
980 |
|
|
|
$target=stripSlashes($target); |
|
981 |
$dir=dirname($target); |
$dir=dirname($target); |
982 |
if (! file_exists($dir."/.log")) { |
if (! file_exists($dir."/.log")) { |
983 |
mkdir($dir."/.log",0700); |
mkdir($dir."/.log",0700); |
1147 |
$log=fopen("$gblFsRoot/.changelog","r"); |
$log=fopen("$gblFsRoot/.changelog","r"); |
1148 |
$logarr = array(); |
$logarr = array(); |
1149 |
while($line = fgetcsv($log,255,"\t")) { |
while($line = fgetcsv($log,255,"\t")) { |
1150 |
if ($day!=1 || ($day==1 && (time()-$line[0] < 24*60))) { |
if ($day!=1 || ($day==1 && (time()-$line[0] < 24*60*60))) { |
1151 |
array_unshift($logarr,array($line[0],$line[1],$line[2],$line[3])); |
array_unshift($logarr,array($line[0],$line[1],$line[2],$line[3])); |
1152 |
} |
} |
1153 |
} |
} |
1225 |
|
|
1226 |
$fsDir = $gblFsRoot . $relDir ; // current directory |
$fsDir = $gblFsRoot . $relDir ; // current directory |
1227 |
if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ; |
if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ; |
1228 |
|
|
1229 |
|
$FN=stripSlashes($FN); |
1230 |
|
|
1231 |
switch ($POSTACTION) { |
switch ($POSTACTION) { |
1232 |
case "UPLOAD" : |
case "UPLOAD" : |
1233 |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
1268 |
|
|
1269 |
case "SAVE" : |
case "SAVE" : |
1270 |
$path = $gblFsRoot . $RELPATH ; |
$path = $gblFsRoot . $RELPATH ; |
1271 |
|
$path=stripSlashes($path); |
1272 |
$writable = is_writeable($path) ; |
$writable = is_writeable($path) ; |
1273 |
$legaldir = is_writeable(dirname($path)) ; |
$legaldir = is_writeable(dirname($path)) ; |
1274 |
$exists = (file_exists($path)) ? 1 : 0 ; |
$exists = (file_exists($path)) ? 1 : 0 ; |
1276 |
if (!($writable || (!$exists && $legaldir))) |
if (!($writable || (!$exists && $legaldir))) |
1277 |
Error("Write denied",$RELPATH) ; |
Error("Write denied",$RELPATH) ; |
1278 |
$fh = fopen($path, "w") ; |
$fh = fopen($path, "w") ; |
1279 |
|
$FILEDATA=stripSlashes($FILEDATA); |
1280 |
fwrite($fh,$FILEDATA) ; |
fwrite($fh,$FILEDATA) ; |
1281 |
fclose($fh) ; |
fclose($fh) ; |
1282 |
clearstatcache() ; |
clearstatcache() ; |
1411 |
// $A=V : view file (do nothing except log) |
// $A=V : view file (do nothing except log) |
1412 |
// default : display directory $D |
// default : display directory $D |
1413 |
|
|
|
$F=stripSlashes($F); |
|
|
|
|
1414 |
switch ($A) { |
switch ($A) { |
1415 |
case "U" : |
case "U" : |
1416 |
// upload to $relDir |
// upload to $relDir |
1423 |
EndHTML() ; |
EndHTML() ; |
1424 |
exit ; |
exit ; |
1425 |
case "E" : |
case "E" : |
1426 |
|
$F=stripSlashes($F); |
1427 |
// detail of $relDir/$F |
// detail of $relDir/$F |
1428 |
if (is_file("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ; |
if (is_file("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ; |
1429 |
exit ; |
exit ; |
1430 |
case "C" : |
case "C" : |
1431 |
|
$F=stripSlashes($F); |
1432 |
// listing of $relDir/$F |
// listing of $relDir/$F |
1433 |
DisplayCode($gblFsRoot, $relDir, $F) ; |
DisplayCode($gblFsRoot, $relDir, $F) ; |
1434 |
exit ; |
exit ; |
1439 |
Header("Location: ".urlpath("$relDir/$F")); |
Header("Location: ".urlpath("$relDir/$F")); |
1440 |
exit; |
exit; |
1441 |
case "Ci" : |
case "Ci" : |
1442 |
|
$F=stripSlashes($F); |
1443 |
// upload && update to $relDir |
// upload && update to $relDir |
1444 |
if (!is_writeable($gblFsRoot . $relDir)) |
if (!is_writeable($gblFsRoot . $relDir)) |
1445 |
Error("Write access denied",$relDir) ; |
Error("Write access denied",$relDir) ; |