1769 |
$target = "$fsDir/$FILENAME"; |
$target = "$fsDir/$FILENAME"; |
1770 |
} |
} |
1771 |
|
|
1772 |
|
if (! check_perm("$relDir/".basename($target), trperm_w)) |
1773 |
|
Error("Access denied","User <tt>$gblLogin</tt> tried to upload <tt>$relDir/".basename($target)."</tt> without valid trustee.",1); |
1774 |
|
|
1775 |
// backup old files first |
// backup old files first |
1776 |
$dir=dirname($target); |
$dir=dirname($target); |
1777 |
if (! file_exists($dir."/.bak")) { |
if (! file_exists($dir."/.bak")) { |
1800 |
case "SAVE" : |
case "SAVE" : |
1801 |
$path = $gblFsRoot . $RELPATH ; |
$path = $gblFsRoot . $RELPATH ; |
1802 |
$path=stripSlashes($path); |
$path=stripSlashes($path); |
1803 |
|
|
1804 |
|
if (! check_perm("$RELPATH", trperm_w)) |
1805 |
|
Error("Access denied","User <tt>$gblLogin</tt> tried to save <tt>$RELPATH</tt> without valid trustee.",1); |
1806 |
|
|
1807 |
$writable = is_writeable($path) ; |
$writable = is_writeable($path) ; |
1808 |
$legaldir = is_writeable(dirname($path)) ; |
$legaldir = is_writeable(dirname($path)) ; |
1809 |
$exists = (file_exists($path)) ? 1 : 0 ; |
$exists = (file_exists($path)) ? 1 : 0 ; |
1810 |
// check for legal extension here as well |
// FIX: more verbose error message |
1811 |
if (!($writable || (!$exists && $legaldir))) |
if (!($writable || (!$exists && $legaldir))) |
1812 |
Error("Write denied",$RELPATH) ; |
Error("Write denied",$RELPATH) ; |
1813 |
$fh = fopen($path, "w") ; |
$fh = fopen($path, "w") ; |
1902 |
if (substr($FN,0,4) != ".del") break ; |
if (substr($FN,0,4) != ".del") break ; |
1903 |
$file=substr($FN,4,strlen($FN)-4); |
$file=substr($FN,4,strlen($FN)-4); |
1904 |
|
|
1905 |
|
if (! check_perm("$relDir/$file", trperm_w)) |
1906 |
|
Error("Access denied","User <tt>$gblLogin</tt> tried to undelete <tt>$relDir/$file</tt> without valid trustee.",1); |
1907 |
|
|
1908 |
LogIt("$fsDir/.del/$file","undeleted",trperm_w); |
LogIt("$fsDir/.del/$file","undeleted",trperm_w); |
1909 |
MoveTo("$fsDir/.del/$file","$fsDir/"); |
MoveTo("$fsDir/.del/$file","$fsDir/"); |
1910 |
MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/"); |
MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/"); |