230 |
} |
} |
231 |
if ( !$file_lock && $ext!="" && strstr(join(' ',$gblImages),$ext) ) { |
if ( !$file_lock && $ext!="" && strstr(join(' ',$gblImages),$ext) ) { |
232 |
$info = getimagesize($fsPath) ; |
$info = getimagesize($fsPath) ; |
233 |
$tstr = "<IMG SRC=\"$webRoot".urlpath($relPath)."\" BORDER=0 " ; |
$tstr = "<IMG SRC=\"$self?A=V&D=".urlpath(dirname($relPath))."&F=".urlpath(basename($relPath))."\" BORDER=0 " ; |
234 |
$tstr .= $info[3] . " ALT=\"" . $fn . " - " ; |
$tstr .= $info[3] . " ALT=\"" . $fn . " - " ; |
235 |
$tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ; |
$tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ; |
236 |
// echo htmlentities($tstr) . "<BR><BR>" . $tstr ; |
// echo htmlentities($tstr) . "<BR><BR>" . $tstr ; |
481 |
|
|
482 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
483 |
|
|
484 |
function GifIcon($txt) { |
function GifIcon($txt = "") { |
485 |
global $gblIconLocation ; |
global $gblIconLocation, $gblImages ; |
486 |
|
|
487 |
switch (strtolower($txt)) { |
switch (strtolower($txt)) { |
|
case ".bmp" : |
|
|
case ".gif" : |
|
|
case ".jpg" : |
|
|
case ".jpeg": |
|
|
case ".tif" : |
|
|
case ".tiff": |
|
|
$d = "image2.gif" ; |
|
|
break ; |
|
488 |
case ".doc" : |
case ".doc" : |
489 |
$d = "layout.gif" ; |
$d = "layout.gif" ; |
490 |
break ; |
break ; |
562 |
$d = "quill.gif"; |
$d = "quill.gif"; |
563 |
break; |
break; |
564 |
default : |
default : |
565 |
$d = "generic.gif" ; |
if (in_array(strtolower($txt),$gblImages)) { |
566 |
|
$d = "image2.gif" ; |
567 |
|
} else { |
568 |
|
$d = "generic.gif" ; |
569 |
|
} |
570 |
} |
} |
571 |
|
|
572 |
|
|
573 |
return "<IMG SRC=\"$gblIconLocation" . $d . "\" BORDER=0>" ; |
return "<IMG SRC=\"$gblIconLocation" . $d . "\" BORDER=0>" ; |
574 |
} // end function GifIcon |
} // end function GifIcon |
575 |
|
|
1766 |
$target = "$fsDir/$FILENAME"; |
$target = "$fsDir/$FILENAME"; |
1767 |
} |
} |
1768 |
|
|
1769 |
|
if (! check_perm("$relDir/".basename($target), trperm_w)) |
1770 |
|
Error("Access denied","User <tt>$gblLogin</tt> tried to upload <tt>$relDir/".basename($target)."</tt> without valid trustee.",1); |
1771 |
|
|
1772 |
// backup old files first |
// backup old files first |
1773 |
$dir=dirname($target); |
$dir=dirname($target); |
1774 |
if (! file_exists($dir."/.bak")) { |
if (! file_exists($dir."/.bak")) { |
1797 |
case "SAVE" : |
case "SAVE" : |
1798 |
$path = $gblFsRoot . $RELPATH ; |
$path = $gblFsRoot . $RELPATH ; |
1799 |
$path=stripSlashes($path); |
$path=stripSlashes($path); |
1800 |
|
|
1801 |
|
if (! check_perm("$RELPATH", trperm_w)) |
1802 |
|
Error("Access denied","User <tt>$gblLogin</tt> tried to save <tt>$RELPATH</tt> without valid trustee.",1); |
1803 |
|
|
1804 |
$writable = is_writeable($path) ; |
$writable = is_writeable($path) ; |
1805 |
$legaldir = is_writeable(dirname($path)) ; |
$legaldir = is_writeable(dirname($path)) ; |
1806 |
$exists = (file_exists($path)) ? 1 : 0 ; |
$exists = (file_exists($path)) ? 1 : 0 ; |
1807 |
// check for legal extension here as well |
// FIX: more verbose error message |
1808 |
if (!($writable || (!$exists && $legaldir))) |
if (!($writable || (!$exists && $legaldir))) |
1809 |
Error("Write denied",$RELPATH) ; |
Error("Write denied",$RELPATH) ; |
1810 |
$fh = fopen($path, "w") ; |
$fh = fopen($path, "w") ; |
1899 |
if (substr($FN,0,4) != ".del") break ; |
if (substr($FN,0,4) != ".del") break ; |
1900 |
$file=substr($FN,4,strlen($FN)-4); |
$file=substr($FN,4,strlen($FN)-4); |
1901 |
|
|
1902 |
|
if (! check_perm("$relDir/$file", trperm_w)) |
1903 |
|
Error("Access denied","User <tt>$gblLogin</tt> tried to undelete <tt>$relDir/$file</tt> without valid trustee.",1); |
1904 |
|
|
1905 |
LogIt("$fsDir/.del/$file","undeleted",trperm_w); |
LogIt("$fsDir/.del/$file","undeleted",trperm_w); |
1906 |
MoveTo("$fsDir/.del/$file","$fsDir/"); |
MoveTo("$fsDir/.del/$file","$fsDir/"); |
1907 |
MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/"); |
MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/"); |