--- docman.php 2000/10/10 14:32:07 1.24 +++ docman.php 2000/12/21 08:46:18 1.27 @@ -364,7 +364,7 @@ $bakdir=dirname("$fsDir/$fn")."/.bak"; if (file_exists($logname)) { $log=fopen($logname,"r"); - $cl1=" class=lst"; $cl2=""; + $cl1=" class=LST"; $cl2=""; $logarr = array(); while($line = fgetcsv($log,255,"\t")) { $cl=$cl1; $cl1=$cl2; $cl2=$cl; @@ -641,9 +641,9 @@ $self = $GLOBALS["PHP_SELF"] ; if (isset($GLOBALS["HTTPS"]) && $GLOBALS["HTTPS"] == "on") { - $webRoot = "https://" . $GLOBALS["SERVER_NAME"] ; + $webRoot = "https://" . $GLOBALS["HTTP_HOST"] ; } else { - $webRoot = "http://" . $GLOBALS["SERVER_NAME"] ; + $webRoot = "http://" . $GLOBALS["HTTP_HOST"] ; } $fsDir = $fsRoot . $relDir . "/" ; // current directory @@ -820,7 +820,13 @@ + + No files in this directory + + @@ -840,15 +846,14 @@
- "; include(".info.inc"); + print " +
"; } ?> - - -
CREATE NEW @@ -870,7 +875,7 @@ ////////////////////////////////////////////////////////////////// -function UploadPage($fsRoot, $relDir, $filename) { +function UploadPage($fsRoot, $relDir, $filename="") { $self = $GLOBALS["PHP_SELF"] ; if ($relDir == "") $relDir = "/" ; @@ -880,7 +885,7 @@ DESTINATION DIRECTORY: - +
DESTINATION FILE: @@ -1143,7 +1148,7 @@ } } fclose($log); - $cl1=" class=lst"; $cl2=""; + $cl1=" class=LST"; $cl2=""; print "\n"; while ($e = array_shift($logarr)) { $cl=$cl1; $cl1=$cl2; $cl2=$cl; @@ -1182,7 +1187,7 @@ // authentication if $gblAuth == true if ( $gblAuth && $gblHash($PHP_AUTH_USER.$PHP_AUTH_PW) != $gblPw || isset($relogin) && $gblPw == $relogin ) { - header("WWW-authenticate: basic realm=\"$SERVER_NAME\"") ; + header("WWW-authenticate: basic realm=\"$HTTP_HOST\"") ; header("HTTP/1.0 401 Unauthorized") ; NoEntry() ; exit ; @@ -1229,6 +1234,9 @@ // TODO : should rather check for escapeshellcmds // but maybe RFC 18xx asserts safe filenames .... $source = $FN ; + if (! file_exists($source)) { + Error("You must select file with browse to upload it!"); + } if (! isset($FILENAME)) { // from update file $target = "$fsDir/$FN_name" ; } else { @@ -1410,7 +1418,7 @@ if (!is_writeable($gblFsRoot . $relDir)) Error("Write access denied",$relDir) ; $text = "Use this page to upload a single " ; - $text .= "file to $SERVER_NAME." ; + $text .= "file to $HTTP_HOST." ; StartHTML("(Upload Page)", $text) ; UploadPage($gblFsRoot, $relDir) ; EndHTML() ; @@ -1437,7 +1445,7 @@ if (!is_writeable($gblFsRoot . $relDir)) Error("Write access denied",$relDir) ; $text = "Use this page to update a single " ; - $text .= "file to $SERVER_NAME." ; + $text .= "file to $HTTP_HOST." ; StartHTML("(Update file Page)", $text) ; UploadPage($gblFsRoot, $relDir, $F) ; EndHTML() ;