--- docman.php 2001/02/15 22:14:21 1.33 +++ docman.php 2001/10/31 08:23:35 1.47 @@ -78,6 +78,11 @@ // from where to include auth_*.php modules? $gblIncDir = "/home/httpd/docman"; + // do we want to force download? (default is 0 for backward + // compatibility, but it's defined as 1 in docman.conf for all + // future applications! + $gblForceDownload = 0; + // username/password should not be system // usernames/passwords !! @@ -120,8 +125,16 @@ $gblImages = array( ".jpg",".jpeg",".gif",".png",".ico", ".bmp",".xbm") ; + // which files to hide (separated by ,) + $gblHide = ""; + + // Where are users? (by default in .htusers file) + $gblUsers = "htusers_file"; + ////////////////////////////////////////////////////////////////// + $gblVersion = "1.8-dev"; + function StartHTML($title,$text="") { $title = "Document Manager " . $title ; @@ -132,7 +145,7 @@
-= date($GLOBALS[gblDateFmt]) ?> -
-= date($GLOBALS[gblTimeFmt]) ?> -
-= $GLOBALS[gblUserName] ?>
- [?relogin== $GLOBALS[gblPw] ?>">logout]
+= date($gblDateFmt) ?> -
+= date($gblTimeFmt) ?> -
+= $gblUserName ?>
+ [logout]
-
ANYPORTAL(php) Site Manager
-
+
+Document Manager = $gblVersion ?>, based on ANYPORTAL(php) Site Manager
+
© 1999 by ANYPORTAL,
© 2000 by d@nger.org,
© 2000 by DbP
@@ -236,14 +253,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
" ;
@@ -628,7 +647,7 @@
function Navigate($fsRoot,$relDir) {
- global $gblEditable, $gblIcon, $gblModDays, $webRoot ;
+ global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide ;
$self = $GLOBALS["PHP_SELF"] ;
@@ -636,11 +655,13 @@
if (!is_dir($fsDir)) Error("Dir not found",$relDir) ;
+ $hide_items=",$gblHide,";
+
// read directory contents
if ( !($dir = @opendir($fsDir)) )
Error("Read Access denied",$relDir) ;
while ($item = readdir($dir)) {
- if ( $item == ".." || $item == "." || substr($item,0,1) == "." ) continue ;
+ if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") ) continue ;
if ( is_dir($fsDir . $item) ) {
$dirList[] = $item ;
} else if ( is_file($fsDir . $item) ) {
@@ -659,7 +680,7 @@
// scan deleted files
if ( $GLOBALS[show_deleted] == 1 && ($dir = @opendir("$fsDir/.del")) ) {
while ($item = readdir($dir)) {
- if ( substr($item,0,1) == "." ) continue ;
+ if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") ) continue ;
$fileList[] = ".del/$item" ;
}
closedir($dir) ;
@@ -692,12 +713,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 "
+DIRECTORY NAME DIRECTORY NOTE DIRECTORY NAME (= plural("dir",sizeof($dirList)) ?>) DIRECTORY NOTE
-
= $webRoot . $relDir ?>
DOCUMENT NAME
+
@@ -820,7 +849,7 @@
}
- if ($emptyDir) {
+ if ($emptyDir && $relDir != "") {
?>
DOCUMENT NAME (= plural("file",sizeof($fileList)) ?>)
= $gblIcon("blank").$gblIcon("blank") ?>
NOTE
LAST UPDATE FILE SIZE