/[docman2]/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.3 by dpavlin, Sat Jul 27 14:45:30 2002 UTC revision 1.4 by dpavlin, Sat Jul 27 19:12:42 2002 UTC
# Line 84  Line 84 
84          LoadLanguage($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]);          LoadLanguage($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]);
85    
86          // for security and configuration          // for security and configuration
87          $realm="$HTTP_HOST";    // FIX          $realm=$HTTP_SERVER_VARS[HTTP_HOST];
88    
89          $fsDocumentRoot = dirname($HTTP_SERVER_VARS[SCRIPT_FILENAME]);          $fsDocumentRoot = dirname($HTTP_SERVER_VARS[SCRIPT_FILENAME]);
90          if ($fsDocumentRoot == "") Error("Configuration error","Can't get SCRIPT_FILENAME from your web server. Please set <tt>\$fsDocumentRoot</tt> in <tt>\$</tt>",1);          if ($fsDocumentRoot == "") Error("Configuration error","Can't get SCRIPT_FILENAME from your web server. Please set <tt>\$fsDocumentRoot</tt> in <tt>\$</tt>",1);
91    
92          // globals for later          // globals for later
93          $gblLogin = $PHP_AUTH_USER;          $gblLogin = $HTTP_SERVER_VARS[PHP_AUTH_USER];
94          $gblPasswd = $PHP_AUTH_PW;          $gblPasswd = $HTTP_SERVER_VARS[PHP_AUTH_PW];
95    
96  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
97    
# Line 109  function LoadLanguage($lang) { Line 109  function LoadLanguage($lang) {
109    
110  function StartHTML($title,$text="") {  function StartHTML($title,$text="") {
111    
112          global $html,$fsDocumentRoot;          global $html,$fsDocumentRoot,$HTTP_SERVER_VARS;
113    
114          $title = $gblTitle." ".$title ;          $title = $gblTitle." ".$title ;
115          $host  = $GLOBALS["HTTP_HOST"] ;          $host  = $HTTP_SERVER_VARS["HTTP_HOST"] ;
116          $self  = $GLOBALS["PHP_SELF"] ;          $self  = $HTTP_SERVER_VARS["PHP_SELF"] ;
117    
118          if (file_exists("$fsDocumentRoot/docman.css")) {          if (file_exists("$fsDocumentRoot/docman.css")) {
119                  $css=dirname($self)."/docman.css";                  $css=dirname($self)."/docman.css";
# Line 152  function EndHTML() { Line 152  function EndHTML() {
152    
153  function DetailPage($fsRoot,$relDir,$fn) {  function DetailPage($fsRoot,$relDir,$fn) {
154                    
155          global $gblEditable, $gblImages, $webRoot, $html ;          global $gblEditable, $gblImages, $webRoot, $html, $HTTP_SERVER_VARS ;
156          $self = $GLOBALS["PHP_SELF"] ;          $self = $HTTP_SERVER_VARS["PHP_SELF"] ;
157    
158          $relPath  = $relDir . "/" . $fn ;          $relPath  = $relDir . "/" . $fn ;
159          $fsPath   = $fsRoot . $relPath ;          $fsPath   = $fsRoot . $relPath ;
# Line 572  function GifIcon($txt) { Line 572  function GifIcon($txt) {
572  function Navigate($fsRoot,$relDir) {  function Navigate($fsRoot,$relDir) {
573    
574          global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide,          global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide,
575                  $HTTP_GET_VARS, $html;                  $gblIgnoreUnknownFileType,
576                    $HTTP_GET_VARS, $html, $realm_config;
577    
578          $self     = $GLOBALS["PHP_SELF"] ;          $self     = $HTTP_SERVER_VARS["PHP_SELF"] ;
579    
580          if ($relDir == "") $relDir = "/";          if ($relDir == "") $relDir = "/";
581    
# Line 584  function Navigate($fsRoot,$relDir) { Line 585  function Navigate($fsRoot,$relDir) {
585    
586          $hide_items=",$gblHide,";          $hide_items=",$gblHide,";
587    
 #display_all_trustee();  
 print "-- $fsDir --";  
   
588          // read directory contents          // read directory contents
589          if ( !($dir = @opendir($fsDir)) )          if ( !($dir = @opendir($fsDir)) )
590                  Error("Read Access denied",$relDir) ;                  Error("Read Access denied",$relDir,1) ;
591          while ($item = readdir($dir)) {          while ($item = readdir($dir)) {
 print "$item, ";  
592                  if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") ) continue ;                  if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") ) continue ;
593                  if ((is_dir($fsDir.$item) || is_link ($fsDir.$item)) && check_perm($relDir.$item,trperm_b)) {                  if (is_dir($fsDir.$item) || is_link ($fsDir.$item)) {
594                          $dirList[$item] = $item ;                          if (check_perm($relDir.$item,trperm_b)) {
595                          $dirNote[$item] = ReadNote($fsDir.$item);                                  $dirList[$item] = $item ;
596                  } else if ( is_file($fsDir.$item) && check_perm($relDir.$item,trperm_r) ) {                                  $dirNote[$item] = ReadNote($fsDir.$item);
597                          $fileList[$item] = $item ;                                        }
598                          $fileDate[$item] = filemtime($fsDir.$item) ;                  } else if (is_file($fsDir.$item)) {
599                          $fileSize[$item] = filesize($fsDir.$item) ;                          if (check_perm($relDir.$item,trperm_r)) {
600                          $fileNote[$item] = ReadNote($fsDir.$item);                                  $fileList[$item] = $item ;              
601                                    $fileDate[$item] = filemtime($fsDir.$item) ;
602                                    $fileSize[$item] = filesize($fsDir.$item) ;
603                                    $fileNote[$item] = ReadNote($fsDir.$item);
604                            }
605                  } else {                  } else {
606                    // unknown file type                          if (! $gblIgnoreUnknownFileType) Error("File Type Error", "Item <tt>".$fsDir.$item."</tt> is not file, directory or link. If you want to ignore errors like this, set <tt>\$gblIgnoreUnknownFileType = 1</tt> in <tt>$realm_config</tt>.",1);
                   // $text = "Could not determine file type of " ;  
                   // Error("File Error", $text.$relDir."/".$item) ;  
                   // exit ;  
607                  }                  }
608          }          }
609          closedir($dir) ;          closedir($dir) ;
610    
611          // scan deleted files          // scan deleted files
612          if ( $GLOBALS[show_deleted] == 1 && ($dir = @opendir("$fsDir/.del")) ) {          if ( $HTTP_GET_VARS["show_deleted"] == 1 && ($dir = @opendir("$fsDir/.del")) ) {
613                  while ($item = readdir($dir)) {                  while ($item = readdir($dir)) {
614                          if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") || !check_perm($relDir.$item,trperm_w) ) continue ;                          if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") || !check_perm($relDir.$item,trperm_w) ) continue ;
615                          $fileList[$item] = ".del/$item" ;                                        $fileList[$item] = ".del/$item" ;              
# Line 626  print "$item, "; Line 624  print "$item, ";
624    
625          // start navigation page          // start navigation page
626          $text  = "Use this page to add, delete";          $text  = "Use this page to add, delete";
627          if (! isset($show_deleted)) {          if (! isset($HTTP_GET_VARS[show_deleted])) {
628                  $text .= ", <a href=$self?D=".urlencode($relDir)."&show_deleted=1>undelete</a>";                  $text .= ", <a href=$self?D=".urlencode($relDir)."&show_deleted=1>undelete</a>";
629          }          }
630          $text .= " or revise files on this web site." ;          $text .= " or revise files on this web site." ;
# Line 788  print "$item, "; Line 786  print "$item, ";
786    
787                  $file_lock=CheckLock($path);                  $file_lock=CheckLock($path);
788    
789                  $file_url_html="<A HREF=\"$self?A=V&F=".urlencode($file);                  $file_url_html="<A HREF=\"$self?A=V&D=".urlencode($relDir)."&F=".urlencode($file);
                 $file_url_html.="&D=".urlencode($relDir);  
790                  $file_url_html.="\" TITLE=\"View file\">" ;                  $file_url_html.="\" TITLE=\"View file\">" ;
791    
792                  if (substr($file,0,5) != ".del/") {                  if (substr($file,0,5) != ".del/") {
# Line 804  print "$item, "; Line 801  print "$item, ";
801    
802                  if ($file_lock) {                  if ($file_lock) {
803                          if ($file_lock == $GLOBALS[gblUserName]) {                          if ($file_lock == $GLOBALS[gblUserName]) {
804                                  $b.="<A HREF=\"$self?A=Ci&F=".urlencode($file);                                  $b.="<A HREF=\"$self?A=Ci&D=".urlencode($relDir)."&F=".urlencode($file);
                                 $b.="&D=".urlencode($relDir);  
805                                  $b.="\" TITLE=\"Checkin (update) file on server\">" ;                                  $b.="\" TITLE=\"Checkin (update) file on server\">" ;
806                                  $file_url_html=$b;                                  $file_url_html=$b;
807                                  $b.=$gblIcon("checkin")."</A>" ;                                  $b.=$gblIcon("checkin")."</A>" ;
# Line 819  print "$item, "; Line 815  print "$item, ";
815                                  $file_url_html = "$file $a";                                  $file_url_html = "$file $a";
816                          }                          }
817                  } else {                  } else {
818                          $b.="<A HREF=\"$self?A=Co&F=".urlencode($file);                          $b.="<A HREF=\"$self?A=Co&D=".urlencode($relDir)."&F=".urlencode($file);
                         $b.="&D=".urlencode($relDir);  
819                          $b.="\" TITLE=\"Checkout file for edit\">" ;                          $b.="\" TITLE=\"Checkout file for edit\">" ;
820                          $b.=$gblIcon("checkout")."</A>" ;                          $b.=$gblIcon("checkout")."</A>";
821    
822                          if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) {                            if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) {  
823                                  $b.="<A HREF=\"$self?A=C&F=".urlencode($file);                                  $b.="<A HREF=\"$self?A=C&D=".urlencode($relDir)."&F=".urlencode($file);
                                 $b.="&D=".urlencode($relDir);  
824                                  $b.="\" TITLE=\"List contents\">" ;                                  $b.="\" TITLE=\"List contents\">" ;
825                                  $b.=$gblIcon("view")."</A>" ;                                  $b.=$gblIcon("view")."</A>" ;
826                          } else {                          } else {
# Line 896  if (file_exists(".info.inc")) { Line 890  if (file_exists(".info.inc")) {
890    
891  function UploadPage($fsRoot, $relDir, $filename="") {  function UploadPage($fsRoot, $relDir, $filename="") {
892    
893          $self = $GLOBALS["PHP_SELF"] ;          global $html, $HTTP_SERVER_VARS;
894    
895            $self = $HTTP_SERVER_VARS["PHP_SELF"] ;
896          if ($relDir == "") $relDir = "/" ;          if ($relDir == "") $relDir = "/" ;
 ?>  
897    
898  <P><TABLE BORDER=0 CELLPADDING=5><TR><TD WIDTH=5></TD><TD CLASS=BAR>          include("$html/UploadPage.html");
 <FORM ENCTYPE="multipart/form-data" METHOD="POST"  
  ACTION="<?= $self ?>">  
 DESTINATION DIRECTORY:<B><?= " " . $relDir ?></B>  
 <? if (isset($filename) && $filename!="") { ?>  
 <br>DESTINATION FILE:<B><?= " " . $filename ?></B>  
 <INPUT TYPE="HIDDEN" NAME="FILENAME" VALUE="<?= $filename ?>">  
 <? } ?>  
 <P>PATHNAME OF LOCAL FILE<BR>  
 <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">  
 <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="UPLOAD">  
 <INPUT SIZE=30 TYPE="FILE" NAME="FN"></P>  
 <P><INPUT TYPE="SUBMIT" VALUE="UPLOAD"></P>  
 <P>If the <B>[BROWSE...]</B> button is not displayed,<BR>  
 you must upgrade to an RFC1867-compliant browser.</P>  
 <P>Your browser:<BR><?= $GLOBALS["HTTP_USER_AGENT"] ?></P>  
 </FORM>  
 </TD></TR>  
 <TR><TD></TD><TD>  
 <FORM METHOD="POST" ACTION="<?= $self ?>">  
 <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"><BR>  
 <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL">  
 </FORM>  
 </TD></TR></TABLE></P>  
899    
 <?php    
900  } // end function UploadPage  } // end function UploadPage
901    
902  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
# Line 937  function Error($title,$text="",$sysadmin Line 908  function Error($title,$text="",$sysadmin
908          global $gblSeparateAdminMessages,          global $gblSeparateAdminMessages,
909                  $gblMailAdminMessages,$realm,                  $gblMailAdminMessages,$realm,
910                  $HTTP_SERVER_VARS;                  $HTTP_SERVER_VARS;
911            if (! headers_sent()) header("HTTP/1.0 404 Not Found");
912          if ($sysadmin) {          if ($sysadmin) {
913                  if ($gblSeparateAdminMessages) {                  if ($gblSeparateAdminMessages) {
914                          $user="Your administrator ";                          $user="Your administrator ";
# Line 1157  function rrmdir($dir) { Line 1129  function rrmdir($dir) {
1129    
1130  function DisplayChangeLog($day) {  function DisplayChangeLog($day) {
1131    
1132          global $gblFsRoot;          global $gblFsRoot,$HTTP_SERVER_VARS;
1133    
1134          if (!file_exists("$gblFsRoot/.changelog")) return;          if (!file_exists("$gblFsRoot/.changelog")) return;
1135          $log=fopen("$gblFsRoot/.changelog","r");          $log=fopen("$gblFsRoot/.changelog","r");
1136          $logarr = array();          $logarr = array();
# Line 1179  function DisplayChangeLog($day) { Line 1152  function DisplayChangeLog($day) {
1152                  $time = date("$GLOBALS[gblTimeFmt]", $e[0]);                  $time = date("$GLOBALS[gblTimeFmt]", $e[0]);
1153                  $dir = dirname($e[1]);                  $dir = dirname($e[1]);
1154                  $file = basename($e[1]);                  $file = basename($e[1]);
1155                  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";                  print "<tr><td$cl>$date</td><td$cl>$time</td><td$cl><a href=\"$HTTP_SERVER_VARS[PHP_SELF]?D=".urlencode($dir)."\">$dir</a>/$file</td><td$cl>$e[2]</td><td$cl>$e[3]</td></tr>\n";
1156          }          }
1157          print "</table>";          print "</table>";
1158          print "<p>".GifIcon(up)." Back to <a href=$GLOBALS[PHP_SELF]>front page</a>.</p>";          print "<p>".GifIcon(up)." Back to <a href=$HTTP_SERVER_VARS[PHP_SELF]>front page</a>.</p>";
1159  }  }
1160    
1161  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
1162    
1163  function Download($path) {  function Download($path,$force=0) {
1164          global $HTTP_USER_AGENT;          global $HTTP_SERVER_VARS,$mime_type;
1165          $file=basename($path);  
1166            // default transfer-encoding
1167            $encoding = "binary";
1168    
1169            // known transfer encodings
1170            $encoding_ext = array(
1171                    "gz" => "x-gzip",
1172                    "Z" => "x-compress",
1173            );
1174    
1175            $file = basename($path);
1176          $size = filesize($path);          $size = filesize($path);
1177          //header("Content-Type: application/octet-stream");  
1178          header("Content-Type: application/force-download");          $ext_arr = explode(".",$file);
1179          header("Content-Length: $size");          $ext = array_pop($ext_arr);
1180            if ($encoding_ext[$ext]) {
1181                    $encoding = $encoding_ext[$ext];
1182                    $ext = array_pop($ext_arr);
1183            }
1184    
1185            if ($force || !isset($mime_type[$ext])) {
1186                    header("Content-Type: application/force-download");
1187            } else {
1188                    header("Content-Type: $mime_type[$ext]");
1189            }
1190    
1191          // IE5.5 just downloads index.php if we don't do this          // IE5.5 just downloads index.php if we don't do this
1192          if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) {          if(preg_match("/MSIE 5.5/", $HTTP_SERVER_VARS[HTTP_USER_AGENT])) {
1193                  header("Content-Disposition: filename=$file");                  header("Content-Disposition: filename=$file");
1194          } else {          } else {
1195                  header("Content-Disposition: attachment; filename=$file");                  header("Content-Disposition: attachment; filename=$file");
1196          }          }
1197          header("Content-Transfer-Encoding: binary");  
1198            header("Content-Transfer-Encoding: $encoding");
1199          $fh = fopen($path, "r");          $fh = fopen($path, "r");
1200          fpassthru($fh);          fpassthru($fh);
1201  }  }
# Line 1447  print " return: $return<br>\n"; Line 1442  print " return: $return<br>\n";
1442          return($return);          return($return);
1443  }  }
1444    
1445    //////////////////////////////////////////////////////////////////
1446    
1447    function readMime() {
1448            global $mime_type;
1449    
1450            if (! isset($gblMimeTypes)) {
1451                    $gblMimeTypes = "/etc/mime.types";
1452            }
1453    
1454            $mime = @fopen($gblMimeTypes,"r");
1455    
1456            if (! $mime) Error("Can't read MIME types","<tt>$gblMimeTypes</tt> file not found. You can setup other <tt>mime.types</tt> file using <tt>\$gblMimeTypes</tt> in <tt>$realm_config</tt>");
1457    
1458            while($line = fgets($mime,80)) {
1459                    if (substr($line,0,1) == "#") continue; // skip comment
1460                    $arr = preg_split("/[\s\t]+/",$line);
1461                    $type = array_shift($arr);
1462                    while ($ext = array_shift($arr)) {
1463                            $mime_type[$ext] = $type;
1464                    }
1465            }
1466    
1467            fclose($mime);
1468    }
1469    
1470  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
1471  // MAIN PROGRAM  // MAIN PROGRAM
# Line 1529  print " return: $return<br>\n"; Line 1548  print " return: $return<br>\n";
1548                  isset($relogin) && $secHash == $relogin) {                  isset($relogin) && $secHash == $relogin) {
1549                  header("WWW-authenticate: basic realm=\"$realm\"") ;                  header("WWW-authenticate: basic realm=\"$realm\"") ;
1550                  header("HTTP/1.0 401 Unauthorized") ;                  header("HTTP/1.0 401 Unauthorized") ;
1551    phpinfo();
1552                  Error("401 Unauthorized","No trespassing !");                  Error("401 Unauthorized","No trespassing !");
                 exit ;  
1553          }          }
1554    
1555            // read mime.types
1556            readMime();
1557    
1558          // get current directory relative to $gblFsRoot          // get current directory relative to $gblFsRoot
1559          $relDir = $DIR ;        // from POST          $relDir = $DIR ;        // from POST
1560          if ($relDir == "") {    // not defined in POST ?          if ($relDir == "") {    // not defined in POST ?
# Line 1561  print " return: $return<br>\n"; Line 1583  print " return: $return<br>\n";
1583          $fsDir = $gblFsRoot . $relDir ; // current directory          $fsDir = $gblFsRoot . $relDir ; // current directory
1584          if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ;          if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ;
1585    
1586          if (isset($GLOBALS["HTTPS"]) && $GLOBALS["HTTPS"] == "on") {          if (isset($HTTP_SERVER_VARS["HTTPS"]) && $HTTP_SERVER_VARS["HTTPS"] == "on") {
1587                  $webRoot  = "https://";                  $webRoot  = "https://";
1588          } else {          } else {
1589                  $webRoot  = "http://";                  $webRoot  = "http://";
1590          }          }
1591          $webRoot .= $GLOBALS["HTTP_HOST"] . $relScriptDir;          $webRoot .= $HTTP_SERVER_VARS["HTTP_HOST"] . $relScriptDir;
1592    
1593          $FN=stripSlashes($FN);          // take variables from server
1594            $FN=stripSlashes($HTTP_POST_VARS["FN"]);
1595            $DIR=stripSlashes($HTTP_POST_VARS["DIR"]);
1596            $RELPATH=stripSlashes($HTTP_POST_VARS["RELPATH"]);
1597            $T=stripSlashes($HTTP_POST_VARS["T"]);
1598    
1599            // get
1600            $A=stripSlashes($HTTP_GET_VARS["A"]);
1601            $D=stripSlashes($HTTP_GET_VARS["D"]);
1602    
1603    //      if (isset($F)) Error("Document manager system error","variable $F shouldn't be set here (re-check old code)",1);
1604    //      $F=stripSlashes($HTTP_SERVER_VARS["PATH_INFO"]);
1605            $F=stripSlashes($HTTP_GET_VARS["F"]);
1606    
1607          switch ($POSTACTION) {          switch ($HTTP_POST_VARS["POSTACTION"]) {
1608          case "UPLOAD" :          case "UPLOAD" :
1609                    $FN_name=stripSlashes($HTTP_POST_FILES["FN"]["tmp_name"]);
1610                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;
1611                  if (strstr($FN_name,"/"))                  if (strstr($FN_name,"/"))
1612                          Error("Non-conforming filename") ;                          Error("Non-conforming filename") ;
1613                  // TODO : should rather check for escapeshellcmds                  // TODO : should rather check for escapeshellcmds
1614                  // but maybe RFC 18xx asserts safe filenames ....                  // but maybe RFC 18xx asserts safe filenames ....
1615                  $source = $FN ;                  $source = $FN_name ;
1616                    print "-- $source -- $FN_name -- $HTTP_POST_FILES[FN] -- ";
1617    //              phpinfo();
1618                  if (! file_exists($source)) {                  if (! file_exists($source)) {
1619                          Error("You must select file with browse to upload it!");                          Error("You must select file with browse to upload it!");
1620                  }                  }
1621                    $FILENAME = $HTTP_POST_VARS["FILENAME"];
1622                  if (! isset($FILENAME)) {       // from update file                  if (! isset($FILENAME)) {       // from update file
1623                          $target = "$fsDir/$FN_name" ;                          $target = "$fsDir/$FN_name" ;
1624                  } else {                  } else {
# Line 1680  print " return: $return<br>\n"; Line 1718  print " return: $return<br>\n";
1718    
1719  //                      if ( ! @unlink($path) ) {  //                      if ( ! @unlink($path) ) {
1720                          if ( ! rename($path,"$dir/.del/$file") ) {                          if ( ! rename($path,"$dir/.del/$file") ) {
                                 Error("File delete failed", $tstr . $path) ;  
1721                                  LogIt($path,"file delete failed");                                  LogIt($path,"file delete failed");
1722                                  exit ;                                  Error("File delete failed", $tstr . $path) ;
1723                          } else {                          } else {
1724                                  LogIt($path,"file deleted",trperm_w);                                  LogIt($path,"file deleted",trperm_w);
1725                                  MoveTo("$dir/.log/$file","$dir/.del/.log/");                                  MoveTo("$dir/.log/$file","$dir/.del/.log/");
# Line 1756  print " return: $return<br>\n"; Line 1793  print " return: $return<br>\n";
1793                  if (!is_writeable($gblFsRoot . $relDir))                  if (!is_writeable($gblFsRoot . $relDir))
1794                          Error("Write access denied",$relDir) ;                          Error("Write access denied",$relDir) ;
1795                  $text  = "Use this page to upload a single " ;                  $text  = "Use this page to upload a single " ;
1796                  $text .= "file to <B>$HTTP_HOST</B>." ;                  $text .= "file to <B>$realm</B>." ;
1797                  StartHTML("(Upload Page)", $text) ;                  StartHTML("(Upload Page)", $text) ;
1798                  UploadPage($gblFsRoot, $relDir) ;                  UploadPage($gblFsRoot, $relDir) ;
1799                  EndHTML() ;                  EndHTML() ;
1800                  exit ;                  exit ;
1801          case "E" :          case "E" :
                 $F=stripSlashes($F);  
1802                  // detail of $relDir/$F                  // detail of $relDir/$F
1803                  if (is_file("$gblFsRoot/$relDir/$F") || is_dir("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ;                  if (is_file("$gblFsRoot/$relDir/$F") || is_dir("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ;
1804                  exit ;                  exit ;
# Line 1782  print " return: $return<br>\n"; Line 1818  print " return: $return<br>\n";
1818                  if (!is_writeable($gblFsRoot . $relDir))                  if (!is_writeable($gblFsRoot . $relDir))
1819                          Error("Write access denied",$relDir) ;                          Error("Write access denied",$relDir) ;
1820                  $text  = "Use this page to update a single " ;                  $text  = "Use this page to update a single " ;
1821                  $text .= "file to <B>$HTTP_HOST</B>." ;                  $text .= "file to <B>$realm</B>." ;
1822                  StartHTML("(Update file Page)", $text) ;                  StartHTML("(Update file Page)", $text) ;
1823                  UploadPage($gblFsRoot, $relDir, $F) ;                  UploadPage($gblFsRoot, $relDir, $F) ;
1824                  EndHTML() ;                  EndHTML() ;
# Line 1817  print " return: $return<br>\n"; Line 1853  print " return: $return<br>\n";
1853                  $title = "You should define \$title variable with page title";                  $title = "You should define \$title variable with page title";
1854                  include($inc_file);                  include($inc_file);
1855                  StartHTML($title, $text) ;                  StartHTML($title, $text) ;
1856                  print "<p>".GifIcon(up)." Back to <a href=$GLOBALS[PHP_SELF]>front page</a>.</p>";                  print "<p>".GifIcon(up)." Back to <a href=$HTTP_SERVER_VARS[PHP_SELF]>front page</a>.</p>";
1857                  EndHTML() ;                  EndHTML() ;
1858                  exit ;                  exit ;
1859          }          }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.26