236 |
$fsize = filesize($fsPath) ; |
$fsize = filesize($fsPath) ; |
237 |
$fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ; |
$fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ; |
238 |
$faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ; |
$faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ; |
239 |
$userinfo = posix_getpwuid(fileowner($fsPath)); |
$fuid=fileowner($fsPath); |
240 |
$grpinfo = posix_getgrgid(filegroup($fsPath)); |
$fgid=filegroup($fsPath); |
241 |
|
$userinfo = posix_getpwuid($fuid); |
242 |
|
$grpinfo = posix_getgrgid($fgid); |
243 |
echo "<PRE>"; |
echo "<PRE>"; |
244 |
if (!is_dir($fsPath)) echo "file size: " . $fsize . " Bytes<BR>" ; |
if (!is_dir($fsPath)) echo " file size: " . $fsize . " Bytes<BR>" ; |
245 |
echo "last modified: <B>" . $fmodified . "</B><BR>" ; |
echo "last modified: <B>" . $fmodified . "</B><BR>" ; |
246 |
echo "last accessed: <B>" . $faccessed . "</B><BR>" ; |
echo "last accessed: <B>" . $faccessed . "</B><BR>" ; |
247 |
echo " owner: <B>" . $userinfo["name"] . "</B><BR>" ; |
echo " owner: <B>" . $userinfo["name"] . " [$fuid]</B><BR>" ; |
248 |
echo " group: <B>" . $grpinfo["name"] . "</B><BR>" ; |
echo " group: <B>" . $grpinfo["name"] . " [$fgid]</B><BR>" ; |
249 |
echo " permissions: <B>" ; |
echo " permissions: <B>" ; |
250 |
echo printf( "%o", fileperms($fsPath) ) . "</B>" ; |
echo printf( "%o", fileperms($fsPath) ) . "</B>" ; |
251 |
echo "</PRE>" ; |
echo "</PRE>" ; |
1059 |
|
|
1060 |
function safe_rename($fromdir,$fromfile,$tofile) { |
function safe_rename($fromdir,$fromfile,$tofile) { |
1061 |
function try_rename($from,$to) { |
function try_rename($from,$to) { |
1062 |
print "$from -> $to\n"; |
# print "$from -> $to\n"; |
1063 |
if (file_exists($from) && is_writeable(dirname($to))) { |
if (file_exists($from) && is_writeable(dirname($to))) { |
1064 |
rename($from,$to); |
rename($from,$to); |
1065 |
} |
} |
1075 |
$todir=dirname($to); |
$todir=dirname($to); |
1076 |
$tofile=basename($to); |
$tofile=basename($to); |
1077 |
|
|
1078 |
print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n"; |
# print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n"; |
1079 |
|
|
1080 |
try_rename("$fromdir/$fromfile","$todir/$tofile"); |
try_rename("$fromdir/$fromfile","$todir/$tofile"); |
1081 |
try_dir("$todir/.log"); |
try_dir("$todir/.log"); |
1214 |
$relDir = urldecode($D) ; // then use GET |
$relDir = urldecode($D) ; // then use GET |
1215 |
} |
} |
1216 |
|
|
1217 |
|
$relDir=stripSlashes($relDir); |
1218 |
|
|
1219 |
if ($relDir == "/") $relDir = "" ; |
if ($relDir == "/") $relDir = "" ; |
1220 |
// default : website root = "" |
// default : website root = "" |
1221 |
|
|
1250 |
|
|
1251 |
$FN=stripSlashes($FN); |
$FN=stripSlashes($FN); |
1252 |
|
|
1253 |
|
if (file_exists("$fsScriptDir/.docman.conf")) { |
1254 |
|
include("$fsScriptDir/.docman.conf"); |
1255 |
|
} |
1256 |
|
|
1257 |
switch ($POSTACTION) { |
switch ($POSTACTION) { |
1258 |
case "UPLOAD" : |
case "UPLOAD" : |
1259 |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |