/[docman]/docman.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /docman.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dpavlin, Wed Jul 26 11:46:19 2000 UTC revision 1.46 by dpavlin, Mon Oct 29 16:20:28 2001 UTC
# Line 35  Line 35 
35  /*             existent address after file modifications.       */  /*             existent address after file modifications.       */
36    
37  /*  /*
         2000-07-25 Dobrica Pavlinusic <dpavlin@rot13.org>  
38    
39          nuked exec calls (unsecure)          This project is now called Directory Manager.
         nuked writeable function (replaced by php is_writeable)  
         added support for https (tested with apache+mod_ssl)  
         added users file  
         date format user-selectable  
         cycle backup files in bak directory  
         support links as directoryes (for now)  
         support of file history logging  
         undelete capabilities (delete moves to .del directory)  
40    
41          2000-07-26 DbP          For more info, please see web pages at
42            http://www.rot13.org/~dpavlin/docman.html
43    
44          added more checking on entered filename (when creating file/dir)          It's relased under GPL by
45          added rename option          Dobrica Pavlinusic <dpavlin@rot13.org>
46    
47    
48  IMPORTANT INSTALLATION NOTE:  IMPORTANT INSTALLATION NOTE:
# Line 59  IMPORTANT INSTALLATION NOTE: Line 51  IMPORTANT INSTALLATION NOTE:
51          deleted files!          deleted files!
52    
53          .htusers is in form:          .htusers is in form:
54          login:Real Name:md5(loginpassword)          login:Real Name:[md5(loginpassword)|auth_*]:email@host.dom
55    
56    
57  TODO:  TODO:
58          mixed file/directory output (add type to each entry,          mixed file/directory output (add type to each entry,
59                  real support for links)                  real support for links)
60          add more content-management (like cms.sourceforge.net):          access controll
61                  check-out/check-in/reserve  
                 comments to files  
62  */  */
63    
64  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
# Line 80  TODO: Line 71  TODO:
71    
72  // GLOBAL PARAMETERS  // GLOBAL PARAMETERS
73  // =================  // =================
74  // Make modifications here to suit siteman to your needs  // Make modifications here to suit docman to your needs
75    
76  //      error_reporting(4) ;            // how verbose ?  //      error_reporting(4) ;            // how verbose ?
77    
78          // username/password should not be system          // from where to include auth_*.php modules?
79          // usernames/passwords !!          $gblIncDir = "/home/httpd/docman";
80    
81  //      $gblPw    = "hash_of_your_username_and_password" ;          // do we want to force download? (default is 0 for backward
82            // compatibility, but it's defined as 1 in docman.conf for all
83            // future applications!
84            $gblForceDownload = 0;
85    
86  //      $gblAuth  = false ;             // use builtin authentication          // username/password should not be system
87          $gblAuth  = true ;             // use builtin authentication          // usernames/passwords !!
         $gblHash  = "md5" ;             // hash function to use  
88    
89          $gblPw    = "";          $gblPw    = "";
90    
91          if ($gblAuth) {          // date format
                 $htusers=fopen(dirname($SCRIPT_FILENAME)."/.htusers","r");  
                 while($user = fgetcsv($htusers,255,":")) {  
                         if ($user[0] == $GLOBALS["PHP_AUTH_USER"]) {  
                                 $gblUserName=$user[1];  
                                 $gblPw=$user[2];  
                                 continue ;  
                         }  
                 }  
                 fclose($htusers);  
         }  
   
92  //      $gblDateFmt="D, F d, Y";  //      $gblDateFmt="D, F d, Y";
 //      $gblTimeFmt="g:i:sA";  
   
93          $gblDateFmt="Y-m-d";          $gblDateFmt="Y-m-d";
94    
95            // time format
96    //      $gblTimeFmt="g:i:sA";
97          $gblTimeFmt="H:i:s";          $gblTimeFmt="H:i:s";
98    
99  // Number of backup files to keep          // Number of backup files to keep
100          $gblNumBackups=5;          $gblNumBackups=3;
101    
102            // show red star if newer than ... days
103            $gblModDays=1;
104    
105          // choose GifIcon below unless you have the M$          // choose GifIcon below unless you have the M$
106          // WingDings font installed on your system          // WingDings font installed on your system
107    
108          $gblIcon = "GifIcon" ;          // MockIcon or GifIcon          $gblIcon="GifIcon";             // MockIcon or GifIcon
109    
110          // the directory below should be /icons/ or /icons/small/          // the directory below should be /icons/ or /icons/small/
111          // on Apache; a set of icons is included in the distribution          // on Apache; a set of icons is included in the distribution
112    
113          $gblIconLocation = "icons/" ;          $gblIconLocation="/icons/";
114    
115          // files you want to be able to edit in text mode          // files you want to be able to edit in text mode
116          // and view with (primitive) syntax highlighting          // and view with (primitive) syntax highlighting
# Line 139  TODO: Line 125  TODO:
125          $gblImages   = array( ".jpg",".jpeg",".gif",".png",".ico",          $gblImages   = array( ".jpg",".jpeg",".gif",".png",".ico",
126                                ".bmp",".xbm") ;                                ".bmp",".xbm") ;
127    
128            // which files to hide (separated by ,)
129            $gblHide = "";
130    
131            // Where are users? (by default in .htusers file)
132            $gblUsers = "htusers_file";
133    
134  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
135    
136            $gblVersion = "1.8-dev";
137    
138  function StartHTML($title,$text="") {  function StartHTML($title,$text="") {
139    
140          $title = "Site Manager " . $title ;          $title = "Document Manager " . $title ;
141          $host  = $GLOBALS["HTTP_HOST"] ;          $host  = $GLOBALS["HTTP_HOST"] ;
142          $self  = $GLOBALS["PHP_SELF"] ;          $self  = $GLOBALS["PHP_SELF"] ;
143  ?>  ?>
144    
145  <HTML>  <HTML>
146  <HEAD>  <HEAD>
147   <TITLE><?php echo $host . " " . $title ?></TITLE>   <TITLE><?= $host . " " . $title ?></TITLE>
148   <META NAME="description" CONTENT="PHP port of AnyPortal Site Manager">   <META NAME="description" CONTENT="Document Manager">
149   <META NAME="keywords" CONTENT="site manager, web site maintenance">   <META NAME="keywords" CONTENT="site manager, web site maintenance">
150   <META NAME="robots" CONTENT="noindex">   <META NAME="robots" CONTENT="noindex">
151   <META HTTP-EQUIV="expires" CONTENT="0">   <META HTTP-EQUIV="expires" CONTENT="0">
152   <LINK REL="stylesheet" TYPE="text/css"   <LINK REL="stylesheet" TYPE="text/css"
153          HREF="<?php echo $self ?>?STYLE=get">          HREF="<?= $self ?>?STYLE=get">
154  </HEAD>  </HEAD>
155  <BODY BGCOLOR="#FFFFFF">  <BODY BGCOLOR="#FFFFFF">
156   <H3 ALIGN="RIGHT"><?php echo $host ?></H3>   <H3 ALIGN="RIGHT"><?= $host ?></H3>
157  <TABLE BORDER=0 WIDTH="100%"><TR>  <TABLE BORDER=0 WIDTH="100%"><TR>
158   <TD CLASS=INV><?php echo $title ?></TD></TR></TABLE>   <TD CLASS=INV><?= $title ?></TD></TR></TABLE>
159   <P><?php echo $text ?></P>   <P><?= $text ?></P>
160    
161  <?php  <?php
162  } // end function StartHTML  } // end function StartHTML
# Line 170  function StartHTML($title,$text="") { Line 164  function StartHTML($title,$text="") {
164  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
165    
166  function EndHTML() {  function EndHTML() {
167    
168    global $gblDateFmt, $gblTimeFmt, $gblUserName, $PHP_SELF, $gblPw, $gblVersion;
169    
170  ?>  ?>
171    
172  <HR>  <HR>
173  <P CLASS=FTR>  <P CLASS=FTR>
174  <B><?= date($GLOBALS[gblDateFmt]) ?> -  <B><?= date($gblDateFmt) ?> -
175  <?= date($GLOBALS[gblTimeFmt]) ?> -  <?= date($gblTimeFmt) ?> -
176  <?= $GLOBALS[gblUserName] ?>  <?= $gblUserName ?>
177  <small> [<a href="<?= $PHP_SELF ?>?relogin=<?= $GLOBALS[gblPw] ?>">logout</a>]</small>  <small> [<a href="<?= $PHP_SELF ?>?relogin=<?= $gblPw ?>">logout</a>]</small>
178  </B>  </B>
179  <BR>ANYPORTAL(php) Site Manager  <BR><small>
180  <br><small>  Document Manager <?= $gblVersion ?>, based on ANYPORTAL(php) Site Manager
181    <br>
182  &copy; 1999 by <A HREF="http://www.anyportal.com">ANYPORTAL</A>,  &copy; 1999 by <A HREF="http://www.anyportal.com">ANYPORTAL</A>,
183  &copy; 2000 by <A HREF="http://da.nger.org">d@nger.org</A>,  &copy; 2000 by <A HREF="http://da.nger.org">d@nger.org</A>,
184  &copy; 2000 by <A HREF="http://www.rot13.org/~dpavlin/">DbP</A>  &copy; 2000 by <A HREF="http://www.rot13.org/~dpavlin/">DbP</A>
185  </small>  </small>
186  </P>  </P>
187  <BR>  <BR>
188  <? //include("../debug.inc") ?>  <? //include(".debug.inc") ?>
189  <BR><BR></BODY></HTML>  <BR><BR></BODY></HTML>
190    
191  <?php  <?php
# Line 222  A:HOVER { color:red; } Line 220  A:HOVER { color:red; }
220    
221  function DetailPage($fsRoot,$relDir,$fn) {  function DetailPage($fsRoot,$relDir,$fn) {
222                    
223          global $gblEditable, $gblImages ;          global $gblEditable, $gblImages, $webRoot ;
224          $self = $GLOBALS["PHP_SELF"] ;          $self = $GLOBALS["PHP_SELF"] ;
225    
226          $relPath  = $relDir . "/" . $fn ;          $relPath  = $relDir . "/" . $fn ;
# Line 233  function DetailPage($fsRoot,$relDir,$fn) Line 231  function DetailPage($fsRoot,$relDir,$fn)
231          $ext      = strtolower(strrchr($relPath,".")) ;          $ext      = strtolower(strrchr($relPath,".")) ;
232          $editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ;          $editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ;
233          $writable = is_writeable($fsPath) ;          $writable = is_writeable($fsPath) ;
234            $file_lock = CheckLock($fsPath);
235    
236          if (!$editable && !$exists)          if (!$editable && !$exists)
237                  Error("Creation unsupported for type",$relPath) ;                  Error("Creation unsupported for type",$relPath) ;
# Line 240  function DetailPage($fsRoot,$relDir,$fn) Line 239  function DetailPage($fsRoot,$relDir,$fn)
239                  Error("Creation denied",$relDir) ;                  Error("Creation denied",$relDir) ;
240    
241          $text  = "Use this page to view, modify or " ;          $text  = "Use this page to view, modify or " ;
242          $text .= "delete a single document on this " ;          if (is_dir($fsPath)) {
243                    $text .="delete a directory on this " ;
244            } else {
245                    $text .= "delete a single document on this " ;
246            };
247          $text .= "web site." ;            $text .= "web site." ;  
248          $title = "(Detail Page)" ;          $title = "(Detail Page)" ;
249          StartHTML($title, $text) ;          StartHTML($title, $text) ;
250    
251          echo "<H3>" . $relDir . "/" . $fn . "</H3>" ;          echo "<H3>" . $relDir . "/" . $fn . "</H3>" ;
252          if ($exists) {  // get file info          if ($exists) {  // get file info
253            $fsize = filesize($fsPath) ;                  $fsize = filesize($fsPath) ;
254            $fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ;                  $fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ;
255            $faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ;                  $faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ;
256            echo "<PRE>    file size: " . $fsize . " Bytes<BR>" ;                  $fuid=fileowner($fsPath);
257            echo "last modified: <B>" . $fmodified . "</B><BR>" ;                  $fgid=filegroup($fsPath);
258            echo "last accessed: <B>" . $faccessed . "</B><BR>" ;                  $userinfo = posix_getpwuid($fuid);
259            echo "        owner: <B>" . fileowner($fsPath) . "</B><BR>" ;                  $grpinfo = posix_getgrgid($fgid);
260            echo "        group: <B>" . filegroup($fsPath) . "</B><BR>" ;                  echo "<PRE>";
261            echo "  permissions: <B>" ;                  if (!is_dir($fsPath)) echo "    file size: " . $fsize . " Bytes<BR>" ;
262            echo printf( "%o", fileperms($fsPath) ) . "</B>" ;                  echo "last modified: <B>" . $fmodified . "</B><BR>" ;
263            echo "</PRE>" ;                  echo "last accessed: <B>" . $faccessed . "</B><BR>" ;
264                    echo "        owner: <B>" . $userinfo["name"] . " [$fuid]</B><BR>" ;
265                    echo "        group: <B>" . $grpinfo["name"] . " [$fgid]</B><BR>" ;
266                    echo "  permissions: <B>" ;
267                    echo printf( "%o", fileperms($fsPath) ) . "</B>" ;
268                    echo "</PRE>" ;
269    
270          }          }
271    
272          if ( $editable && ($writable || !$exists) ) {          if ( !is_dir($fsPath) && $editable && ($writable || !$exists) && !$file_lock ) {
273                  $fh = fopen($fsPath,"a+") ;                  $fh = fopen($fsPath,"a+") ;
274                  rewind($fh) ;                  rewind($fh) ;
275                  $fstr = fread($fh,filesize($fsPath)) ;                  $fstr = fread($fh,filesize($fsPath)) ;
# Line 269  function DetailPage($fsRoot,$relDir,$fn) Line 277  function DetailPage($fsRoot,$relDir,$fn)
277                  $fstr = htmlentities( $fstr ) ;                  $fstr = htmlentities( $fstr ) ;
278  ?>  ?>
279    
280  <FORM ACTION="<?php echo $self ; ?>" METHOD="POST">  <FORM ACTION="<?= $self ; ?>" METHOD="POST">
281  <SPAN TITLE="Click [SAVE] to store updated contents.">  <SPAN TITLE="Click [SAVE] to store updated contents.">
282          <B>DOCUMENT CONTENTS</B>          <B>DOCUMENT CONTENTS</B>
283  </SPAN><BR>  </SPAN><BR>
284  <TEXTAREA NAME="FILEDATA" ROWS=18 COLS=70 WRAP="OFF"><?php  <TEXTAREA NAME="FILEDATA" ROWS=18 COLS=70 WRAP="OFF"><?php
285  echo($fstr) ; ?></TEXTAREA>  echo($fstr) ; ?></TEXTAREA>
286  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>">  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ; ?>">
287  <INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>">  <INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?= $fn ; ?>">
288  <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="SAVE">  <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="SAVE">
289  <INPUT TYPE="HIDDEN" SIZE=48 MAXLENGTH=255 NAME="RELPATH"  <INPUT TYPE="HIDDEN" SIZE=48 MAXLENGTH=255 NAME="RELPATH"
290          VALUE="<?php echo $relPath ; ?>">          VALUE="<?= $relPath ; ?>">
291  <br>  <br>
292  <INPUT TYPE="RESET" VALUE="UNDO ALL CHANGES">  <INPUT TYPE="RESET" VALUE="UNDO ALL CHANGES">
293  <INPUT TYPE="SUBMIT" VALUE="SAVE">  <INPUT TYPE="SUBMIT" VALUE="SAVE">
# Line 287  echo($fstr) ; ?></TEXTAREA> Line 295  echo($fstr) ; ?></TEXTAREA>
295    
296  <?php  <?php
297          }          }
298          else if ( strstr( join(" ",$gblImages), $ext ) ) {            if ( !$file_lock && $ext!="" && strstr(join(' ',$gblImages),$ext) ) {  
299            $info  = getimagesize($fsPath) ;                  $info  = getimagesize($fsPath) ;
300            $tstr  = "<IMG SRC=\"". $relPath . "\" BORDER=0 " ;                  $tstr = "<IMG SRC=\"$webRoot".urlpath($relPath)."\" BORDER=0 " ;
301            $tstr .= $info[3] . " ALT=\"" . $fn . " - " ;                  $tstr .= $info[3] . " ALT=\"" . $fn . " - " ;
302            $tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ;                  $tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ;
303            echo htmlentities($tstr) . "<BR><BR>" . $tstr ;  //              echo htmlentities($tstr) . "<BR><BR>" . $tstr ;
304                    echo $tstr ;
305          }          }
306    
307  ?>  ?>
308    
309  <FORM ACTION="<?php echo $self ; ?>" METHOD="POST">  <FORM ACTION="<?= $self ; ?>" METHOD="POST">
310  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>">  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ; ?>">
311  <INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>">  <INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?= $fn ; ?>">
312  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"><BR>  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"><BR>
313    
314  <?php  <?php
315    
316            if ($file_lock) {
317    ?>
318    <hr>
319    <SPAN TITLE="Check OK and click UNLOCK to remove lock on file.">
320    <B>OK TO FORCE LOCK REMOVAL ON "<?= $fn ; ?>" HELD BY <?= $file_lock ?>? </B></SPAN>
321    <INPUT TYPE="CHECKBOX" NAME="CONFIRM">
322    <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="UNLOCK">
323    <?
324            } // file_lock
325    
326          if (substr($fn,0,4) == ".del") {          if (substr($fn,0,4) == ".del") {
327                  $action="UNDELETE";                  $action="UNDELETE";
328                  $desc="undelete previously deleted file";                  $desc="undelete previously deleted file";
# Line 313  echo($fstr) ; ?></TEXTAREA> Line 334  echo($fstr) ; ?></TEXTAREA>
334          if ($exists && $writable) {          if ($exists && $writable) {
335  ?>  ?>
336    
337  <HR><SPAN TITLE="Check OK and click [<?= $action ?>] to <?= $desc ?>.">  <HR>
338  <B>OK TO <?= $action ?> "<?php echo $fn ; ?>"? </B></SPAN>  <a name="undelete">
339    <SPAN TITLE="Check OK and click [<?= $action ?>] to <?= $desc ?>.">
340    <B>OK TO <?= $action ?> "<?= $fn ; ?>"? </B></SPAN>
341  <INPUT TYPE="CHECKBOX" NAME="CONFIRM">  <INPUT TYPE="CHECKBOX" NAME="CONFIRM">
342  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="<?= $action ?>">  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="<?= $action ?>">
343    
344  <HR><SPAN TITLE="Check OK and click [RENAME] to rename.">  <HR>
345  <B>OK TO RENAME "<?php echo $fn ; ?>" TO  <a name="rename">
346    <SPAN TITLE="Check OK and click [RENAME] to rename.">
347    <B>OK TO RENAME "<?= $fn ; ?>" TO
348  <INPUT TYPE="TEXT" SIZE=24 MAXLENGTH=255 NAME="NEWNAME" VALUE="<?= $fn ?>">  <INPUT TYPE="TEXT" SIZE=24 MAXLENGTH=255 NAME="NEWNAME" VALUE="<?= $fn ?>">
349  ? </B></SPAN>  ? </B></SPAN>
350  <INPUT TYPE="CHECKBOX" NAME="CONFIRM">  <INPUT TYPE="CHECKBOX" NAME="CONFIRM">
351  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="RENAME">  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="RENAME">
352    
353  <?php  <?php
354          }          }       // exists && writable
355          echo "</FORM>" ;  ?>
356    <HR>
357    <a name="note">
358    <B>NOTE FOR "<?= $fn ; ?>":
359    <INPUT TYPE="TEXT" SIZE=50 MAXLENGTH=255 NAME="NOTE" VALUE="<?= ReadNote($fsPath) ?>">
360    </B></SPAN>
361    <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="NOTE">
362    
363    </FORM>
364    
365    <?php
366    
367          $logname=dirname("$fsDir/$fn")."/.log/".basename("$fsDir/$fn");          $name=basename("$fsDir/$fn");
368            $logname=dirname("$fsDir/$fn")."/.log/$name";
369            $bakdir=dirname("$fsDir/$fn")."/.bak";
370          if (file_exists($logname)) {          if (file_exists($logname)) {
                 print "<hr><br><b>CHANGES TO THIS FILE</b><br><table border=0 width=100%>\n";  
371                  $log=fopen($logname,"r");                  $log=fopen($logname,"r");
372                  $cl1=" class=lst"; $cl2="";                  $cl1=" class=LST"; $cl2="";
373                    $logarr = array();
374                  while($line = fgetcsv($log,255,"\t")) {                  while($line = fgetcsv($log,255,"\t")) {
375                          $cl=$cl1; $cl1=$cl2; $cl2=$cl;                          $cl=$cl1; $cl1=$cl2; $cl2=$cl;
376                          print "<tr><td$cl>$line[0]</td><td$cl>$line[1]</td><td$cl>$line[2]</td><td$cl>$line[3]</td></tr>\n";                          array_unshift($logarr,array($cl,$line[0],$line[1],$line[2],$line[3]));
377                  }                  }
378                  fclose($log);                  fclose($log);
379                    if (is_dir("$fsDir/$fn")) {
380                            $whatis="DIRECTORY";
381                    } else {
382                            $whatis="FILE";
383                    }
384                    print "<hr><br><b>CHANGES TO THIS $whatis</b><br><table border=0 width=100%>\n";
385                    $bakcount = 0;  // start from 0, skip fist backup (it's current)
386                    while ($e = array_shift($logarr)) {
387                            if (strstr($e[4],"upload")) {
388                                    if (file_exists("$bakdir/$bakcount/$name")) {
389                                            $e[4]="<a href=\"$webRoot".urlpath(dirname($relPath)."/.bak/$bakcount/$name")."\">$e[4]</a>";
390                                    }
391                                    $bakcount++;
392                            }
393                            print "<tr><td$e[0]>$e[1]</td><td$e[0]>$e[2]</td><td$e[0]>$e[3]</td><td$e[0]>$e[4]</td></tr>\n";
394                    }
395                  print "</table>";                  print "</table>";
396          }          }
397    
# Line 571  function GifIcon($txt) { Line 624  function GifIcon($txt) {
624          case "blank" :          case "blank" :
625                  $d = "blank.gif" ;                  $d = "blank.gif" ;
626                  break ;                  break ;
627            case "checkout":
628                    $d = "box2.gif";
629                    break;
630            case "checkin":
631                    $d = "hand.up.gif";
632                    break;
633            case "locked":
634                    $d = "screw2.gif";
635                    break;
636            case "note":
637                    $d = "quill.gif";
638                    break;
639          default :          default :
640                  $d = "generic.gif" ;                  $d = "generic.gif" ;
641          }          }
# Line 582  function GifIcon($txt) { Line 647  function GifIcon($txt) {
647    
648  function Navigate($fsRoot,$relDir) {  function Navigate($fsRoot,$relDir) {
649    
650          global $gblEditable, $gblIcon ;          global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide ;
651    
652          $self     = $GLOBALS["PHP_SELF"] ;          $self     = $GLOBALS["PHP_SELF"] ;
653          if (isset($GLOBALS["HTTPS"]) && $GLOBALS["HTTPS"] == "on") {  
654                  $webRoot  = "https://" . $GLOBALS["SERVER_NAME"] ;          $fsDir = $fsRoot . $relDir . "/" ; // current directory
         } else {  
                 $webRoot  = "http://" . $GLOBALS["SERVER_NAME"] ;  
         }  
         $fsDir    = $fsRoot . $relDir . "/" ; // current directory  
655    
656          if (!is_dir($fsDir)) Error("Dir not found",$relDir) ;          if (!is_dir($fsDir)) Error("Dir not found",$relDir) ;
657    
658            $hide_items=",$gblHide,";
659    
660          // read directory contents          // read directory contents
661          if ( !($dir = @opendir($fsDir)) )          if ( !($dir = @opendir($fsDir)) )
662                  Error("Read Access denied",$relDir) ;                  Error("Read Access denied",$relDir) ;
663          while ($item = readdir($dir)) {          while ($item = readdir($dir)) {
664                  if ( $item == ".." || $item == "." || substr($item,0,1) == "." ) continue ;                  if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") ) continue ;
665                  if ( is_dir($fsDir . $item) ) {                  if ( is_dir($fsDir . $item) ) {
666                          $dirList[] = $item ;                          $dirList[] = $item ;
667                  } else if ( is_file($fsDir . $item) ) {                  } else if ( is_file($fsDir . $item) ) {
# Line 617  function Navigate($fsRoot,$relDir) { Line 680  function Navigate($fsRoot,$relDir) {
680          // scan deleted files          // scan deleted files
681          if ( $GLOBALS[show_deleted] == 1 && ($dir = @opendir("$fsDir/.del")) ) {          if ( $GLOBALS[show_deleted] == 1 && ($dir = @opendir("$fsDir/.del")) ) {
682                  while ($item = readdir($dir)) {                  while ($item = readdir($dir)) {
683                          if ( substr($item,0,1) == "." ) continue ;                          if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") ) continue ;
684                          $fileList[] = ".del/$item" ;                                      $fileList[] = ".del/$item" ;            
685                  }                  }
686                  closedir($dir) ;                  closedir($dir) ;
# Line 628  function Navigate($fsRoot,$relDir) { Line 691  function Navigate($fsRoot,$relDir) {
691          // start navigation page          // start navigation page
692          $text  = "Use this page to add, delete";          $text  = "Use this page to add, delete";
693          if (! isset($show_deleted)) {          if (! isset($show_deleted)) {
694                  $text .= ", <a href=$PHP_SELF?show_deleted=1>undelete</a>";                  $text .= ", <a href=$self?D=".urlencode($relDir)."&show_deleted=1>undelete</a>";
695          }          }
696          $text .= " or revise files on this web site." ;          $text .= " or revise files on this web site." ;
697            $text .= "<br>Examine list of files <a href=\"$self?A=Ch1\">changed in last day</a> or <a href=\"$self?A=Ch\">all changes</a>.";
698          StartHTML("(Navigate)",$text) ;          StartHTML("(Navigate)",$text) ;
699    
700          echo "<TABLE BORDER=0 CELLPADDING=2          echo "<TABLE BORDER=0 CELLPADDING=2
# Line 642  function Navigate($fsRoot,$relDir) { Line 706  function Navigate($fsRoot,$relDir) {
706                  if ($parent == "") $parent = "/" ;                  if ($parent == "") $parent = "/" ;
707  ?>  ?>
708    
709  <TR><TD><?php echo $gblIcon("up") ?></TD><TD COLSPAN=4 CLASS=LST>  <TR><TD><?= $gblIcon("up") ?></TD><TD COLSPAN=5 CLASS=LST>
710  <A HREF="<?php echo $self ?>?D=<?php echo urlencode($parent) ?>">  <A HREF="<?= $self ?>?D=<?= urlencode($parent) ?>">
711  <B><?php echo $parent ?></B></A></TD></TR>  <B><?= $parent ?></B></A></TD></TR>
712    
713  <?php  <?php
714          }          }
715    
716    function plural($name,$count) {
717            $out="$count $name";
718            if ($count > 1) {
719                    $out.="s";
720            }
721            return $out;
722    }
723    
724          // output subdirs          // output subdirs
725          if (sizeof($dirList) > 0) {          if (sizeof($dirList) > 0) {
726                  sort($dirList) ;                  sort($dirList) ;
727  ?>  ?>
728    
729  <TR><TD></TD><TD COLSPAN=4 CLASS=TOP><HR>DIRECTORY NAME</TD></TR>  <TR><TD></TD><TD COLSPAN=2 CLASS=TOP>DIRECTORY NAME (<?= plural("dir",sizeof($dirList)) ?>)</TD><TD COLSPAN=3 CLASS=TOP>DIRECTORY NOTE</TR>
730    
731  <?php  <?php
732                  while (list($key,$dir) = each($dirList)) {                  while (list($key,$dir) = each($dirList)) {
733    
734                            $info_url=$self."?A=E&F=".urlencode($dir)."&D=".urlencode($relDir);
735                          $tstr = "<A HREF=\"" . $self . "?D=" ;                          $tstr = "<A HREF=\"" . $self . "?D=" ;
736                          $tstr .= urlencode($relDir."/".$dir) ;                          $tstr .= urlencode($relDir."/".$dir) ;
737                          $tstr .= "\">" . $dir . "/</A>" ;                          $tstr .= "\">" . $dir . "/</A>" ;
738                            $note_html="<a href=\"$info_url#note\">".$gblIcon("note")."</a>".ReadNote($fsDir.$dir);
739  ?>  ?>
740    
741  <TR><TD><?php echo $gblIcon("fldr") ?></TD>  <TR><TD>
742  <TD COLSPAN=4 CLASS=LST><?php echo $tstr ?></TD></TR>  <A HREF="<?= $info_url ?>" TITLE="View/Edit">
743    <?= $gblIcon("fldr") ?></A></TD>
744    <TD COLSPAN=2 CLASS=LST><?= $tstr ?></TD>
745    <TD COLSPAN=3 CLASS=LST><?= $note_html ?></TD></TR>
746    
747  <?php  <?php
748                  }  // iterate over dirs                  }  // iterate over dirs
749          }  // end if no dirs          }  // end if no dirs
750  ?>  ?>
751    
752  <TR><TD></TD><TD COLSPAN=4><HR><B><?php echo $webRoot . $relDir ?>  <TR><TD></TD><TD COLSPAN=5><HR><B><?= $webRoot . $relDir ?>
753  </B></TD></TR>  </B></TD></TR>
754  <TR><TD></TD><TD CLASS=TOP>DOCUMENT NAME</TD>  <TR><TD></TD><TD CLASS=TOP>DOCUMENT NAME (<?= plural("file",sizeof($fileList)) ?>)</TD>
755  <TD><?php echo $gblIcon("blank") ?></TD>  <TD><?= $gblIcon("blank").$gblIcon("blank") ?></TD>
756    <TD CLASS=TOP>NOTE</TD>
757  <TD CLASS=TOP>LAST UPDATE</TD><TD CLASS=TOP>FILE SIZE</TD></TR>  <TD CLASS=TOP>LAST UPDATE</TD><TD CLASS=TOP>FILE SIZE</TD></TR>
758    
759  <?php  <?php
760          if (sizeof($fileList) > 0) {          if (sizeof($fileList) > 0) {
761            sort($fileList) ;            sort($fileList) ;
762            while (list($key,$file) = each($fileList)) {              while (list($key,$file) = each($fileList)) {  
763              $path = $fsDir."/".$file ;                  $path = $fsDir."/".$file ;
764              $mod  = filemtime($path) ;                  $mod  = filemtime($path) ;
765              $sz   = filesize($path) ;                  $sz   = filesize($path) ;
766    
767              if ($sz >= 10240) {                  if ($sz >= 10240) {
768                $sz = (int)(($sz+1023)/1024) . " k" ;                          $sz = (int)(($sz+1023)/1024) . " k" ;
769              }                  } else {
770              else {                          $sz .= " " ;
771                $sz .= " " ;                  } // end size
772              } // end size  
773                    $a = $b = "" ;
             $a = $b = "" ;  
   
             if ( ($mod + 30*86400) > time() ) {  
               $a  = "<SPAN CLASS=RED TITLE=\"Newer" ;  
               $a .= " than 30 days\"> * </SPAN>" ;  
             }  
774    
775              $tstr = $webRoot . $relDir . "/" . $file ;                  $info_url=$self."?A=E&F=".urlencode($file)."&D=".urlencode($relDir);
776              $tstr  = "<A HREF=\"" . $tstr . "\">" ;  
777                    if ( ($mod + $gblModDays*86400) > time() ) {
778                            $a  = "<SPAN CLASS=RED TITLE=\"Newer" ;
779                            $a .= " than $gblModDays days\"> * </SPAN>" ;
780                    }
781    
782                    $file_lock=CheckLock($path);
783    
784                    $file_url_html="<A HREF=\"$self?A=V&F=".urlencode($file);
785                    $file_url_html.="&D=".urlencode($relDir);
786                    $file_url_html.="\" TITLE=\"View file\">" ;
787    
788                  if (substr($file,0,5) != ".del/") {                  if (substr($file,0,5) != ".del/") {
789                          $tstr .= $file . "</A>" . $a ;                          $file_url_html .= $file . "</A>" . $a ;
790                    } else {
791                            $file_url_html .= substr($file,5,strlen($file)-5) . "</a> <SPAN CLASS=RED TITLE=\"deleted\"> <a href=\"$info_url#undelete\">deleted</a> </span>";
792                    }
793    
794                    $note_html="<a href=\"$info_url#note\">".$gblIcon("note")."</a>".ReadNote($path);
795    
796                    $ext = strtolower(strrchr($file,".")) ;
797    
798                    if ($file_lock) {
799                            if ($file_lock == $GLOBALS[gblUserName]) {
800                                    $b.="<A HREF=\"$self?A=Ci&F=".urlencode($file);
801                                    $b.="&D=".urlencode($relDir);
802                                    $b.="\" TITLE=\"Checkin (update) file on server\">" ;
803                                    $file_url_html=$b;
804                                    $b.=$gblIcon("checkin")."</A>" ;
805                                    $b.= $gblIcon("blank");
806                                    $file_url_html.="$file</a> $a";
807                                    $note_html = $gblIcon("blank")."<b>Please check-in (update) this file</b>";
808                            } else {
809                                    $b = $gblIcon("locked");
810                                    $b.= $gblIcon("blank");
811                                    $note_html = $gblIcon("blank")."<b>File locked by $file_lock</b>";
812                                    $file_url_html = "$file $a";
813                            }
814                  } else {                  } else {
815                          $tstr .= substr($file,5,strlen($file)-5) . "</a> <SPAN CLASS=RED TITLE=\"deleted\"> deleted </span>";                          $b.="<A HREF=\"$self?A=Co&F=".urlencode($file);
816                            $b.="&D=".urlencode($relDir);
817                            $b.="\" TITLE=\"Checkout file for edit\">" ;
818                            $b.=$gblIcon("checkout")."</A>" ;
819    
820                            if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) {  
821                                    $b.="<A HREF=\"$self?A=C&F=".urlencode($file);
822                                    $b.="&D=".urlencode($relDir);
823                                    $b.="\" TITLE=\"List contents\">" ;
824                                    $b.=$gblIcon("view")."</A>" ;
825                            } else {
826                                    $b.= $gblIcon("blank");
827                            }
828                  }                  }
829    
             $ext = strtolower(strrchr($file,".")) ;  
             if ( $ext=="" ||  
                  strstr(join(" ",$gblEditable),$ext) )  
             {    
               $b  = "<A HREF=\"" . $self . "?A=C&F=" ;  
               $b .= urlencode($file) . "&D=" . urlencode($relDir) ;  
               $b .= "\" TITLE=\"List contents\">" ;  
               $b .= $gblIcon("view") . "</A>" ;  
             }  
830    
831  ?>  ?>
832    
833  <TR><TD>  <TR><TD>
834  <A HREF="<?php echo $self ?>?A=E&F=<?php echo urlencode($file)  <A HREF="<?= $info_url ?>" TITLE="View/Edit">
835  ?>&D=<?php echo urlencode($relDir) ?>" TITLE="View/Edit">  <?= $gblIcon($ext) ?></A></TD>
836  <?php echo $gblIcon($ext) ?></A></TD>  <TD CLASS=LST><?= $file_url_html ?></TD>
837  <TD CLASS=LST><?php echo $tstr ?></TD>  <TD CLASS=LST ALIGN=center><?= $b ?></TD>
838  <TD CLASS=LST ALIGN=center><?php echo $b ?></TD>  <TD CLASS=LST ALIGN=left><?= $note_html ?></TD>
839  <TD CLASS=LST><?php echo date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]",$mod) ?></TD>  <TD CLASS=LST><?= date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]",$mod) ?></TD>
840  <TD CLASS=LST><?php echo $sz ?>Bytes</TD></TR>  <TD CLASS=LST><?= $sz ?>Bytes</TD></TR>
841    
842  <?php  <?php
843            }  // iterate over files            }  // iterate over files
844          }  // end if no files          } else {  // end if no files
845    ?>
846     <TR><TD></TD><TD COLSPAN=5 CLASS=LST>
847      No files in this directory
848     </TD></TR>
849    <?
850            }
851    
852          if ($emptyDir) {          if ($emptyDir) {
853  ?>  ?>
854    
855  <FORM METHOD="POST" ACTION="<?php echo $self ?>">  <FORM METHOD="POST" ACTION="<?= $self ?>">
856   <TR><TD></TD><TD COLSPAN=4 CLASS=BAR>   <TR><TD></TD><TD COLSPAN=5 CLASS=BAR>
857    <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ?>">    <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">
858    OK TO DELETE THIS EMPTY FOLDER?    OK TO DELETE THIS EMPTY FOLDER?
859    <INPUT TYPE="CHECKBOX" NAME="CONFIRM">    <INPUT TYPE="CHECKBOX" NAME="CONFIRM">
860    <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="DELETE">    <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="DELETE">
# Line 750  function Navigate($fsRoot,$relDir) { Line 865  function Navigate($fsRoot,$relDir) {
865          } // end if emptyDir          } // end if emptyDir
866  ?>  ?>
867    
868  <TR><TD></TD><TD COLSPAN=4><HR></TD></TR>  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>
869    
870  <FORM METHOD="POST" ACTION="<?php echo $self ?>">  <?
871  <TR><TD></TD><TD COLSPAN=4 CLASS=BAR>CREATE NEW  if (file_exists(".info.inc")) {
872            print "<TR><TD></TD><TD COLSPAN=5>";
873            include(".info.inc");
874            print "</TD></TR>
875            <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>";
876    }
877    ?>
878    
879    <FORM METHOD="POST" ACTION="<?= $self ?>">
880    <TR><TD></TD><TD COLSPAN=5 CLASS=BAR>CREATE NEW
881   <INPUT TYPE="RADIO" NAME="T" VALUE="D" CHECKED>DIRECTORY -OR-   <INPUT TYPE="RADIO" NAME="T" VALUE="D" CHECKED>DIRECTORY -OR-
882   <INPUT TYPE="RADIO" NAME="T" VALUE="F">FILE : &nbsp;&nbsp;   <INPUT TYPE="RADIO" NAME="T" VALUE="F">FILE : &nbsp;&nbsp;
883   <NOBR>NAME <INPUT TYPE="TEXT" NAME="FN" SIZE=14>   <NOBR>NAME <INPUT TYPE="TEXT" NAME="FN" SIZE=14>
884   <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE">   <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE">
885   <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ?>">   <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">
886   <INPUT TYPE="SUBMIT" VALUE="CREATE"></NOBR>   <INPUT TYPE="SUBMIT" VALUE="CREATE" NAME="CREATE">
887   <NOBR>OR <A HREF="<?php echo $self   </NOBR>
888          ?>?A=U&D=<?php echo urlencode($relDir) ?>">UPLOAD</A> A FILE   <NOBR>OR <A HREF="<?= $self ?>?A=U&D=<?= urlencode($relDir) ?>">UPLOAD</A> A FILE
889   </NOBR>   </NOBR>
890  </TD></TR>  </TD></TR>
891  </FORM>  </FORM>
# Line 773  function Navigate($fsRoot,$relDir) { Line 897  function Navigate($fsRoot,$relDir) {
897    
898  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
899    
900  function UploadPage($fsRoot, $relDir) {  function UploadPage($fsRoot, $relDir, $filename="") {
901    
902          $self = $GLOBALS["PHP_SELF"] ;          $self = $GLOBALS["PHP_SELF"] ;
903          if ($relDir == "") $relDir = "/" ;          if ($relDir == "") $relDir = "/" ;
# Line 781  function UploadPage($fsRoot, $relDir) { Line 905  function UploadPage($fsRoot, $relDir) {
905    
906  <P><TABLE BORDER=0 CELLPADDING=5><TR><TD WIDTH=5></TD><TD CLASS=BAR>  <P><TABLE BORDER=0 CELLPADDING=5><TR><TD WIDTH=5></TD><TD CLASS=BAR>
907  <FORM ENCTYPE="multipart/form-data" METHOD="POST"  <FORM ENCTYPE="multipart/form-data" METHOD="POST"
908   ACTION="<?php echo $self ?>">   ACTION="<?= $self ?>">
909  DESTINATION DIRECTORY:<B><?php echo " " . $relDir ?></B>  DESTINATION DIRECTORY:<B><?= " " . $relDir ?></B>
910    <? if (isset($filename) && $filename!="") { ?>
911    <br>DESTINATION FILE:<B><?= " " . $filename ?></B>
912    <INPUT TYPE="HIDDEN" NAME="FILENAME" VALUE="<?= $filename ?>">
913    <? } ?>
914  <P>PATHNAME OF LOCAL FILE<BR>  <P>PATHNAME OF LOCAL FILE<BR>
915  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ?>">  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">
916  <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="UPLOAD">  <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="UPLOAD">
917  <INPUT SIZE=30 TYPE="FILE" NAME="FN"></P>  <INPUT SIZE=30 TYPE="FILE" NAME="FN"></P>
918  <P><INPUT TYPE="SUBMIT" VALUE="UPLOAD"></P>  <P><INPUT TYPE="SUBMIT" VALUE="UPLOAD"></P>
919  <P>If the <B>[BROWSE...]</B> button is not displayed,<BR>  <P>If the <B>[BROWSE...]</B> button is not displayed,<BR>
920  you must upgrade to an RFC1867-compliant browser.</P>  you must upgrade to an RFC1867-compliant browser.</P>
921  <P>Your browser:<BR><?php echo $GLOBALS["HTTP_USER_AGENT"] ?></P>  <P>Your browser:<BR><?= $GLOBALS["HTTP_USER_AGENT"] ?></P>
922  </FORM>  </FORM>
923  </TD></TR>  </TD></TR>
924  <TR><TD></TD><TD>  <TR><TD></TD><TD>
925  <FORM METHOD="POST" ACTION="<?php echo $self ?>">  <FORM METHOD="POST" ACTION="<?= $self ?>">
926  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ?>"><BR>  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"><BR>
927  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL">  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL">
928  </FORM>  </FORM>
929  </TD></TR></TABLE></P>  </TD></TR></TABLE></P>
# Line 814  function Error($title,$text="") { Line 942  function Error($title,$text="") {
942    
943  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
944    
 function CreateHash($user, $pw) {  
   
         global $gblHash ;  // hash function to use  
   
         if ($user == "" || $pw == "") {  
                 $text = "either no password or no username supplied" ;  
                 Error("Create Hash",$text) ;  
         }  
         $title = "(Create Hash)" ;  
         StartHTML($title) ;  
         echo "<P ALIGN=center>" ;  
         echo "<BLOCKQUOTE>Copy the value below and paste it " ;  
         echo "into the<BR>value for \$gblPw in the source of " ;  
         echo "this file<BR><BR><B>" . $gblHash($user.$pw) ;  
         echo "</B><BR><BR>Hash function: " . $gblHash ;  
         echo "</BLOCKQUOTE></P>" ;  
         EndHTML() ;  
         exit ;  
   
 } // end function CreateHash  
   
 //////////////////////////////////////////////////////////////////  
   
945  function NoEntry() {  function NoEntry() {
946    
947          $user = $GLOBALS["PHP_AUTH_USER"] ;          $user = $GLOBALS["PHP_AUTH_USER"] ;
# Line 846  function NoEntry() { Line 951  function NoEntry() {
951          $title = "(401 Unauthorized)" ;          $title = "(401 Unauthorized)" ;
952          $text  = "No trespassing !" ;          $text  = "No trespassing !" ;
953          StartHTML($title,$text) ;          StartHTML($title,$text) ;
 ?>  
954    
 <FORM ACTION="<?php echo $self ?>?HASH=create" METHOD="POST">  
 <INPUT TYPE="HIDDEN" NAME="USER" VALUE="<?php echo $user ?>">  
 <INPUT TYPE="HIDDEN" NAME="PW" VALUE="<?php echo $pw ?>">  
   
 <BLOCKQUOTE><B>If you are a site administrator:</B><BR><BR>  
 Click below to <B>generate a password hash</B><BR>from  
 the username-password pair you just<BR>entered. Then include the hash in  
 the source<BR>of this file.<BR><BR>  
 <INPUT TYPE="SUBMIT" VALUE="CREATE HASH">  
 </BLOCKQUOTE></FORM>  
   
 <?php  
955          EndHTML() ;          EndHTML() ;
956          exit ;          exit ;
957  }  }
958    
959  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
960    
961  function Logit($target,$msg) {  function LogIt($target,$msg) {
962    
963          $dir=dirname($target);          $dir=dirname($target);
964          if (! file_exists($dir."/.log")) {          if (! file_exists($dir."/.log")) {
# Line 882  function Logit($target,$msg) { Line 974  function Logit($target,$msg) {
974  }  }
975    
976    
977    //////////////////////////////////////////////////////////////////
978    
979    function WriteNote($target,$msg) {
980    
981            $target=stripSlashes($target);
982            $dir=dirname($target);
983            if (! file_exists($dir."/.note")) {
984                    mkdir($dir."/.note",0700);
985            }
986            $file=basename($target);
987    
988            $note=fopen("$dir/.note/$file","w");
989            fputs($note,"$msg\n");
990            fclose($note);
991    
992            Logit($target,"added note $msg");
993    
994    }
995    
996    function ReadNote($target) {
997    
998            $target=stripSlashes($target);
999            $dir=dirname($target);
1000            $file=basename($target);
1001            $msg="";
1002            if (file_exists($dir."/.note/$file")) {
1003                    $note=fopen("$dir/.note/$file","r");
1004                    $msg=fgets($note,4096);
1005                    fclose($note);
1006            }
1007            return HtmlSpecialChars(StripSlashes($msg));
1008    
1009    }
1010    
1011    //////////////////////////////////////////////////////////////////
1012    
1013    function MoveTo($source,$folder) {
1014    
1015            $source=stripSlashes($source);
1016            $file=basename($source);
1017            if (! file_exists($folder)) {
1018                    mkdir($folder,0700);
1019            }
1020            if (file_exists($source)) {
1021                    rename($source,"$folder/$file");
1022            }
1023    }
1024    
1025    //////////////////////////////////////////////////////////////////
1026    
1027    function Lock($target) {
1028    
1029            $target=stripSlashes($target);
1030            $dir=dirname($target);
1031            if (! file_exists($dir."/.lock")) {
1032                    mkdir($dir."/.lock",0700);
1033            }
1034            $file=basename($target);
1035    
1036            if (file_exists("$dir/.lock/$file")) {
1037                    Logit($target,"attempt to locked allready locked file!");
1038            } else {
1039                    $lock=fopen("$dir/.lock/$file","w");
1040                    fputs($lock,"$GLOBALS[gblUserName]\n");
1041                    fclose($lock);
1042    
1043                    Logit($target,"file locked");
1044            }
1045    
1046    }
1047    
1048    function CheckLock($target) {
1049    
1050            $target=stripSlashes($target);
1051            $dir=dirname($target);
1052            $file=basename($target);
1053            $msg=0;
1054            if (file_exists($dir."/.lock/$file")) {
1055                    $lock=fopen("$dir/.lock/$file","r");
1056                    $msg=fgets($lock,4096);
1057                    fclose($lock);
1058            }
1059            return chop($msg);
1060    
1061    }
1062    
1063    function Unlock($target) {
1064    
1065            $target=stripSlashes($target);
1066            $dir=dirname($target);
1067            $file=basename($target);
1068            if (file_exists($dir."/.lock/$file")) {
1069                    unlink("$dir/.lock/$file");
1070                    Logit($target,"file unlocked");
1071            } else {
1072                    Logit($target,"attempt to unlocked non-locked file!");
1073            }
1074    
1075    }
1076    
1077    //////////////////////////////////////////////////////////////////
1078    
1079    function urlpath($url) {
1080            $url=urlencode(StripSlashes("$url"));
1081            $url=str_replace("%2F","/",$url);
1082            $url=str_replace("+","%20",$url);
1083            return($url);
1084    }
1085    
1086    //////////////////////////////////////////////////////////////////
1087    
1088    function safe_rename($fromdir,$fromfile,$tofile) {
1089            function try_rename($from,$to) {
1090    #               print "$from -> $to\n";
1091                    if (file_exists($from) && is_writeable(dirname($to))) {
1092                            rename($from,$to);
1093                    }
1094            }
1095    
1096            function try_dir($todir) {
1097                    if (! file_exists($todir)) {
1098                            mkdir($todir,0700);
1099                    }
1100            }
1101    
1102            $to="$fromdir/$tofile";
1103            $todir=dirname($to);
1104            $tofile=basename($to);
1105    
1106    #       print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n";
1107    
1108            try_rename("$fromdir/$fromfile","$todir/$tofile");
1109            try_dir("$todir/.log");
1110            try_rename("$fromdir/.log/$fromfile","$todir/.log/$tofile");
1111            try_dir("$todir/.note");
1112            try_rename("$fromdir/.note/$fromfile","$todir/.note/$tofile");
1113            try_dir("$todir/.lock");
1114            try_rename("$fromdir/.lock/$fromfile","$todir/.lock/$tofile");
1115            try_dir("$todir/.bak");
1116            for($i=0;$i<=$GLOBALS[gblNumBackups];$i++) {
1117                    try_rename("$fromdir/.bak/$i/$fromfile","$todir/.bak/$i/$tofile");
1118            }
1119    }
1120    
1121    
1122    //////////////////////////////////////////////////////////////////
1123    
1124    // recursivly delete directory
1125    
1126    function rrmdir($dir) {
1127            $handle=opendir($dir);
1128            while ($file = readdir($handle)) {
1129                    if ($file != "." && $file != "..") {
1130                            if (is_dir("$dir/$file"))
1131                                    rrmdir("$dir/$file");
1132                            else
1133                                    if (! @unlink("$dir/$file")) return(0);
1134                    }
1135            }
1136            closedir($handle);
1137            return @rmdir($dir);
1138    }
1139    
1140    //////////////////////////////////////////////////////////////////
1141    
1142    function ChangeLog($target,$msg) {
1143    
1144            global $gblFsRoot;
1145            $log=fopen("$gblFsRoot/.changelog","a+");
1146            if (substr($target,0,strlen($gblFsRoot)) == $gblFsRoot)
1147                    $target=substr($target,strlen($gblFsRoot),strlen($target)-strlen($gblFsRoot));
1148            fputs($log,time()."\t$target\t$GLOBALS[gblUserName]\t$msg\n");
1149            fclose($log);
1150    
1151    }
1152    
1153    function DisplayChangeLog($day) {
1154    
1155            global $gblFsRoot;
1156            if (!file_exists("$gblFsRoot/.changelog")) return;
1157            $log=fopen("$gblFsRoot/.changelog","r");
1158            $logarr = array();
1159            while($line = fgetcsv($log,255,"\t")) {
1160                    if ($day!=1 || ($day==1 && (time()-$line[0] < 24*60*60))) {
1161                            array_unshift($logarr,array($line[0],$line[1],$line[2],$line[3]));
1162                    }
1163            }
1164            fclose($log);
1165            $cl1=" class=LST"; $cl2="";
1166            print "<table border=0 width=100%>\n";
1167            while ($e = array_shift($logarr)) {
1168                    $cl=$cl1; $cl1=$cl2; $cl2=$cl;
1169                    $date = date("$GLOBALS[gblDateFmt]", $e[0]);
1170                    $time = date("$GLOBALS[gblTimeFmt]", $e[0]);
1171                    $dir = dirname($e[1]);
1172                    $file = basename($e[1]);
1173                    print "<tr><td$cl>$date</td><td$cl>$time</td><td$cl><a href=\"$GLOBALS[PHP_SELF]?D=".urlencode($dir)."\">$dir</a>/$file</td><td$cl>$e[2]</td><td$cl>$e[3]</td></tr>\n";
1174            }
1175            print "</table>";
1176            print "<p>".GifIcon(up)." Back to <a href=$GLOBALS[PHP_SELF]>front page</a>.</p>";
1177    }
1178    
1179    //////////////////////////////////////////////////////////////////
1180    
1181    function Download($path) {
1182            global $HTTP_USER_AGENT;
1183            $file=basename($path);
1184            $size = filesize($path);
1185            //header("Content-Type: application/octet-stream");
1186            header("Content-Type: application/force-download");
1187            header("Content-Length: $size");
1188            // IE5.5 just downloads index.php if we don't do this
1189            if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) {
1190                    header("Content-Disposition: filename=$file");
1191            } else {
1192                    header("Content-Disposition: attachment; filename=$file");
1193            }
1194            header("Content-Transfer-Encoding: binary");
1195            $fh = fopen($path, "r");
1196            fpassthru($fh);
1197    }
1198    
1199    
1200  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
1201    
# Line 900  function Logit($target,$msg) { Line 1214  function Logit($target,$msg) {
1214          // forks before authentication: style sheet and hash          // forks before authentication: style sheet and hash
1215          // creation if password not yet set.          // creation if password not yet set.
1216          if ($STYLE == "get") { CSS() ; exit ; }          if ($STYLE == "get") { CSS() ; exit ; }
1217          if ($HASH != "") {  
1218                  CreateHash($USER, $PW) ;          $fsScriptDir  = dirname($SCRIPT_FILENAME) ;    
1219                  exit ;          // i.e. /home/httpd/html/docman
1220    
1221            // read user-defined configuration
1222            if (file_exists("$fsScriptDir/.docman.conf")) {
1223                    include("$fsScriptDir/.docman.conf");
1224          }          }
1225    
1226          // authentication if $gblAuth == true          // where do we get users from?
1227          if ( $gblAuth && $gblHash($PHP_AUTH_USER.$PHP_AUTH_PW) != $gblPw ||          if (file_exists("$gblIncDir/$gblUsers.php")) {
1228                    include("$gblIncDir/$gblUsers.php");
1229            } else {
1230                    Error("Configuration error","Can't find user handling module at <tt>$gblIncDir/$gblUsers.php</tt> ! Please fix <tt>$fsScriptDir/.docman.conf</tt>");
1231            }
1232    
1233            // authentication failure
1234            if ( md5($PHP_AUTH_USER.$PHP_AUTH_PW) != $gblPw ||
1235                  isset($relogin) && $gblPw == $relogin ) {                  isset($relogin) && $gblPw == $relogin ) {
1236                  header("WWW-authenticate: basic realm=\"$SERVER_NAME\"") ;                  header("WWW-authenticate: basic realm=\"$HTTP_HOST\"") ;
1237                  header("HTTP/1.0 401 Unauthorized") ;                  header("HTTP/1.0 401 Unauthorized") ;
1238                  NoEntry() ;                  NoEntry() ;
1239                  exit ;                  exit ;
# Line 920  function Logit($target,$msg) { Line 1245  function Logit($target,$msg) {
1245                  $relDir = urldecode($D) ;  // then use GET                  $relDir = urldecode($D) ;  // then use GET
1246          }                }      
1247    
1248            $relDir=stripSlashes($relDir);
1249    
1250          if ($relDir == "/") $relDir = "" ;                if ($relDir == "/") $relDir = "" ;      
1251          // default : website root = ""          // default : website root = ""
1252    
# Line 931  function Logit($target,$msg) { Line 1258  function Logit($target,$msg) {
1258          // i.e. below $gblFsRoot.          // i.e. below $gblFsRoot.
1259    
1260          $relScriptDir = dirname($SCRIPT_NAME) ;                  $relScriptDir = dirname($SCRIPT_NAME) ;        
1261          // i.e. /siteman          // i.e. /docman
1262    
1263          $fsScriptDir  = dirname($SCRIPT_FILENAME) ;              // start on server root
1264          // i.e. /home/httpd/html/siteman  //      $gblFsRoot = substr($fsScriptDir,0, strlen($fsScriptDir)-strlen($relScriptDir)) ;
1265            // or on script root
1266          $gblFsRoot = substr($fsScriptDir,0,          $gblFsRoot = $fsScriptDir;
           strlen($fsScriptDir)-strlen($relScriptDir)) ;  
1267          // i.e. /home/httpd/html          // i.e. /home/httpd/html
1268    
1269          $fsDir = $gblFsRoot . $relDir ; // current directory          $fsDir = $gblFsRoot . $relDir ; // current directory
1270          if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ;          if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ;
1271            
1272            if (isset($GLOBALS["HTTPS"]) && $GLOBALS["HTTPS"] == "on") {
1273                    $webRoot  = "https://";
1274            } else {
1275                    $webRoot  = "http://";
1276            }
1277            $webRoot .= $GLOBALS["HTTP_HOST"] . $relScriptDir;
1278    
1279            $FN=stripSlashes($FN);
1280    
1281    
1282          switch ($POSTACTION) {          switch ($POSTACTION) {
1283          case "UPLOAD" :          case "UPLOAD" :
1284                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;
# Line 951  function Logit($target,$msg) { Line 1287  function Logit($target,$msg) {
1287                  // TODO : should rather check for escapeshellcmds                  // TODO : should rather check for escapeshellcmds
1288                  // but maybe RFC 18xx asserts safe filenames ....                  // but maybe RFC 18xx asserts safe filenames ....
1289                  $source = $FN ;                  $source = $FN ;
1290                  $target = $fsDir . "/" . $FN_name ;                  if (! file_exists($source)) {
1291                            Error("You must select file with browse to upload it!");
1292                    }
1293                    if (! isset($FILENAME)) {       // from update file
1294                            $target = "$fsDir/$FN_name" ;
1295                    } else {
1296                            $target = "$fsDir/$FILENAME";
1297                    }
1298    
1299                  // backup old files first                  // backup old files first
1300                  $dir=dirname($target);                  $dir=dirname($target);
# Line 963  function Logit($target,$msg) { Line 1306  function Logit($target,$msg) {
1306                  }                  }
1307                  $file=basename($target);                  $file=basename($target);
1308                  for($i=$GLOBALS[gblNumBackups]-1;$i>0;$i--) {                  for($i=$GLOBALS[gblNumBackups]-1;$i>0;$i--) {
1309                          if (! file_exists($dir."/.bak/".$i)) {                          MoveTo("$dir/.bak/$i/$file","$dir/.bak/".($i+1)."/");
                                 mkdir($dir."/.bak/".$i,0700);  
                         }  
                         if (file_exists($dir."/.bak/".$i."/".$file)) {  
                                 rename($dir."/.bak/".$i."/".$file,  
                                         $dir."/.bak/".($i+1)."/".$file);  
                         }  
                 }  
                 if (file_exists($target)) {  
                         rename($target,$dir."/.bak/1/".$file);  
1310                  }                  }
1311                    MoveTo($target,$dir."/.bak/1/");
1312    
1313                  copy($source,$target) ;                  copy($source,$target) ;
1314                  chmod($target,$gblFilePerms) ;                  chmod($target,$gblFilePerms) ;
1315                  clearstatcache() ;                  clearstatcache() ;
1316                  Logit($target,"uploaded");                  Logit($target,"uploaded");
1317                    if (isset($FILENAME)) {
1318                            Unlock($target);
1319                    }
1320                    ChangeLog($target,"updated");
1321                  break ;                  break ;
1322    
1323          case "SAVE" :          case "SAVE" :
1324                  $path = $gblFsRoot . escapeshellcmd($RELPATH) ;                  $path = $gblFsRoot . $RELPATH ;
1325                    $path=stripSlashes($path);
1326                  $writable = is_writeable($path) ;                  $writable = is_writeable($path) ;
1327                  $legaldir = is_writeable(dirname($path)) ;                  $legaldir = is_writeable(dirname($path)) ;
1328                  $exists   = (file_exists($path)) ? 1 : 0 ;                  $exists   = (file_exists($path)) ? 1 : 0 ;
# Line 990  function Logit($target,$msg) { Line 1330  function Logit($target,$msg) {
1330                  if (!($writable || (!$exists && $legaldir)))                  if (!($writable || (!$exists && $legaldir)))
1331                          Error("Write denied",$RELPATH) ;                          Error("Write denied",$RELPATH) ;
1332                  $fh = fopen($path, "w") ;                  $fh = fopen($path, "w") ;
1333                    $FILEDATA=stripSlashes($FILEDATA);
1334                  fwrite($fh,$FILEDATA) ;                  fwrite($fh,$FILEDATA) ;
1335                  fclose($fh) ;                  fclose($fh) ;
1336                  clearstatcache() ;                  clearstatcache() ;
1337                  Logit($path,"saved changes");                  Logit($path,"saved changes");
1338                    ChangeLog($path,"saved changes");
1339                  break ;                  break ;
1340    
1341          case "CREATE" :          case "CREATE" :
# Line 1004  function Logit($target,$msg) { Line 1346  function Logit($target,$msg) {
1346                  $relPath = $relDir . "/" . $FN ;                  $relPath = $relDir . "/" . $FN ;
1347                  switch ( $T ) {                  switch ( $T ) {
1348                  case "D" :  // create a directory                  case "D" :  // create a directory
1349                    if ( ! @mkdir($path,$gblDirPerms) )                          if ( ! @mkdir($path,$gblDirPerms) )
1350                      Error("Mkdir failed",$relPath) ; // eg. if it exists                                  Error("Mkdir failed",$relPath) ; // eg. if it exists
1351                    clearstatcache() ;                          clearstatcache() ;
1352                    break ;                          break ;
1353                  case "F" :  // create a new file                  case "F" :  // create a new file
1354  // this functionality is doubled in DetailView().  // this functionality is doubled in DetailView().
1355  // better keep it here altogether  // better keep it here altogether
1356  // chmod perms to $gblFilePerms  // chmod perms to $gblFilePerms
1357                    if ( file_exists($path) && !is_writable($path) )                          if ( file_exists($path) && !is_writeable($path) )
1358                      Error("File not writable", $relPath) ;                                  Error("File not writable", $relPath) ;
1359                    $tstr = $PHP_SELF . "?A=E&D=" . $relDir . "&F=" . $FN ;                          $fh = fopen($path, "w+") ;
1360                    header("Location: " . $tstr) ;                          if ($fh) {
1361                    exit ;                                  fputs($fh,"\n");
1362                                    fclose($fh) ;
1363                                    LogIt($path,"file created");
1364                            } else {
1365                                    Error("Creation of file $relPath failed -- $path");
1366                            }
1367                            $tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ;
1368                            header("Location: " . $tstr) ;
1369                            ChangeLog($target,"created");
1370                            exit ;
1371                  }                  }
1372                  break ;                  break ;
1373    
# Line 1042  function Logit($target,$msg) { Line 1393  function Logit($target,$msg) {
1393                                  exit ;                                  exit ;
1394                          } else {                          } else {
1395                                  Logit($path,"file deleted");                                  Logit($path,"file deleted");
1396                                  if (! file_exists("$dir/.del/.log")) {                                  MoveTo("$dir/.log/$file","$dir/.del/.log/");
1397                                          mkdir("$dir/.del/.log",0700);                                  MoveTo("$dir/.note/$file","$dir/.del/.note/");
1398                                  }                                  MoveTo("$dir/.lock/$file","$dir/.del/.lock/");
                                 rename("$dir/.log/$file","$dir/.del/.log/$file");  
1399                          }                          }
1400                  }                  }
1401                  else {  // delete directory                  else {  // delete directory
1402                    if ( ! @rmdir($fsDir) ) {                    if ( ! @rrmdir($fsDir) ) {
1403                      Error("Rmdir failed", $tstr . $fsDir) ;                      Error("Rmdir failed", $tstr . $fsDir) ;
1404                    }                    }
1405                    else {                    else {
# Line 1065  function Logit($target,$msg) { Line 1415  function Logit($target,$msg) {
1415                  $file=substr($FN,4,strlen($FN)-4);                  $file=substr($FN,4,strlen($FN)-4);
1416    
1417                  Logit("$fsDir/.del/$file","undeleted");                  Logit("$fsDir/.del/$file","undeleted");
1418                  rename("$fsDir/.del/$file","$fsDir/$file");                  MoveTo("$fsDir/.del/$file","$fsDir/");
1419                  rename("$fsDir/.del/.log/$file","$fsDir/.log/$file");                  MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/");
1420                    MoveTo("$fsDir/.del/.note/$file","$fsDir/.note/");
1421                    MoveTo("$fsDir/.del/.lock/$file","$fsDir/.lock/");
1422    
1423                  break ;                  break ;
1424    
# Line 1074  function Logit($target,$msg) { Line 1426  function Logit($target,$msg) {
1426                  if ( $CONFIRM != "on" ) break ;                  if ( $CONFIRM != "on" ) break ;
1427    
1428                  Logit("$fsDir/$FN","renamed $FN to $NEWNAME");                  Logit("$fsDir/$FN","renamed $FN to $NEWNAME");
1429                  rename("$fsDir/$FN","$fsDir/$NEWNAME");                  safe_rename($fsDir,$FN,$NEWNAME);
1430                  rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME");                  break ;
1431    
1432            case "NOTE" :  
1433                    WriteNote("$fsDir/$FN","$NOTE");
1434                    break ;
1435    
1436            case "UNLOCK" :  
1437                    if ( $CONFIRM != "on" ) break ;
1438                    Unlock("$fsDir/$FN");
1439                  break ;                  break ;
1440    
1441          default :          default :
# Line 1094  function Logit($target,$msg) { Line 1453  function Logit($target,$msg) {
1453          // $A=U : upload to path given in $D          // $A=U : upload to path given in $D
1454          // $A=E : display detail of file $D/$F and edit          // $A=E : display detail of file $D/$F and edit
1455          // $A=C : display code in file $D/$F          // $A=C : display code in file $D/$F
1456            // $A=Co : checkout file $D/$F
1457            // $A=Ci : checkin file $D/$F
1458            // $A=V : view file (do nothing except log)
1459          // default : display directory $D          // default : display directory $D
1460            
1461          switch ($A) {          switch ($A) {
1462          case "U" :          case "U" :
1463                  // upload to $relDir                  // upload to $relDir
1464                  if (!is_writeable($gblFsRoot . $relDir))                  if (!is_writeable($gblFsRoot . $relDir))
1465                          Error("Write access denied",$relDir) ;                          Error("Write access denied",$relDir) ;
1466                  $text  = "Use this page to upload a single " ;                  $text  = "Use this page to upload a single " ;
1467                  $text .= "file to <B>$SERVER_NAME</B>." ;                  $text .= "file to <B>$HTTP_HOST</B>." ;
1468                  StartHTML("(Upload Page)", $text) ;                  StartHTML("(Upload Page)", $text) ;
1469                  UploadPage($gblFsRoot, $relDir) ;                  UploadPage($gblFsRoot, $relDir) ;
1470                  EndHTML() ;                  EndHTML() ;
1471                  exit ;                  exit ;
1472          case "E" :          case "E" :
1473                    $F=stripSlashes($F);
1474                  // detail of $relDir/$F                  // detail of $relDir/$F
1475                  if (is_file("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ;                  if (is_file("$gblFsRoot/$relDir/$F") || is_dir("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ;
1476                  exit ;                  exit ;
1477          case "C" :          case "C" :
1478                    $F=stripSlashes($F);
1479                  // listing of $relDir/$F                  // listing of $relDir/$F
1480                  DisplayCode($gblFsRoot, $relDir, $F) ;                  DisplayCode($gblFsRoot, $relDir, $F) ;
1481                  exit ;                  exit ;
1482            case "Co" :
1483                    // checkout
1484                    Lock("$gblFsRoot/$relDir/$F");
1485                    Download("$gblFsRoot/$relDir/$F");
1486                    exit;
1487            case "Ci" :
1488                    $F=stripSlashes($F);
1489                    // upload && update to $relDir
1490                    if (!is_writeable($gblFsRoot . $relDir))
1491                            Error("Write access denied",$relDir) ;
1492                    $text  = "Use this page to update a single " ;
1493                    $text .= "file to <B>$HTTP_HOST</B>." ;
1494                    StartHTML("(Update file Page)", $text) ;
1495                    UploadPage($gblFsRoot, $relDir, $F) ;
1496                    EndHTML() ;
1497                    exit ;
1498            case "V" :
1499                    // view
1500                    LogIt("$gblFsRoot/$relDir/$F","viewed");
1501                    if ($gblForceDownload) {
1502                            Download("$gblFsRoot/$relDir/$F");
1503                    } else {
1504                            header("Content-Disposition: attachment; filename=$F" );
1505                            Header("Location: $webRoot".urlpath("$relDir/$F"));
1506                    }
1507                    exit;
1508            case "Ch" :
1509                    StartHTML("(File changes)","All changes chronologicaly...");
1510                    DisplayChangeLog(0);    // all
1511                    EndHTML() ;
1512                    exit;
1513            case "Ch1" :
1514                    StartHTML("(File changes)","Changes to files in last day...");
1515                    DisplayChangeLog(1);
1516                    EndHTML() ;
1517                    exit;
1518          }          }
1519    
1520          // default: display directory $relDir          // default: display directory $relDir

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.26