--- docman.php 2001/02/23 11:51:39 1.34 +++ docman.php 2001/06/04 08:20:55 1.41 @@ -236,14 +236,16 @@ $fsize = filesize($fsPath) ; $fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ; $faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ; - $userinfo = posix_getpwuid(fileowner($fsPath)); - $grpinfo = posix_getgrgid(filegroup($fsPath)); + $fuid=fileowner($fsPath); + $fgid=filegroup($fsPath); + $userinfo = posix_getpwuid($fuid); + $grpinfo = posix_getgrgid($fgid); echo "
"; - if (!is_dir($fsPath)) echo "file size: " . $fsize . " Bytes" ; @@ -692,12 +694,20 @@ 1) { + $out.="s"; + } + return $out; +} + // output subdirs if (sizeof($dirList) > 0) { sort($dirList) ; ?> -
" ; + if (!is_dir($fsPath)) echo " file size: " . $fsize . " Bytes
" ; echo "last modified: " . $fmodified . "
" ; echo "last accessed: " . $faccessed . "
" ; - echo " owner: " . $userinfo["name"] . "
" ; - echo " group: " . $grpinfo["name"] . "
" ; + echo " owner: " . $userinfo["name"] . " [$fuid]
" ; + echo " group: " . $grpinfo["name"] . " [$fgid]
" ; echo " permissions: " ; echo printf( "%o", fileperms($fsPath) ) . "" ; echo "
$fromdir / $fromfile -> $todir / $tofile\n\n"; +# print "$fromdir / $fromfile -> $todir / $tofile\n\n"; try_rename("$fromdir/$fromfile","$todir/$tofile"); try_dir("$todir/.log"); @@ -1166,7 +1177,7 @@ $htusers_file=dirname($SCRIPT_FILENAME)."/.htusers"; if (! file_exists($htusers_file)) { - if (is_writable(dirname($SCRIPT_FILENAME))) { + if (is_writeable(dirname($SCRIPT_FILENAME))) { $htusers=fopen($htusers_file,"a+"); fputs($htusers,"# Change owner of $htusers_file to root !!\n"); fputs($htusers,"demo:full name:[md5_hash|auth_*]:e-mail\n"); @@ -1212,6 +1223,8 @@ $relDir = urldecode($D) ; // then use GET } + $relDir=stripSlashes($relDir); + if ($relDir == "/") $relDir = "" ; // default : website root = "" @@ -1246,6 +1259,10 @@ $FN=stripSlashes($FN); + if (file_exists("$fsScriptDir/.docman.conf")) { + include("$fsScriptDir/.docman.conf"); + } + switch ($POSTACTION) { case "UPLOAD" : if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; @@ -1321,7 +1338,7 @@ // this functionality is doubled in DetailView(). // better keep it here altogether // chmod perms to $gblFilePerms - if ( file_exists($path) && !is_writable($path) ) + if ( file_exists($path) && !is_writeable($path) ) Error("File not writable", $relPath) ; $fh = fopen($path, "w+") ; if ($fh) {