/[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.21 by dpavlin, Wed Sep 13 08:27:43 2000 UTC revision 1.22 by dpavlin, Wed Sep 13 09:59:16 2000 UTC
# Line 367  echo($fstr) ; ?></TEXTAREA> Line 367  echo($fstr) ; ?></TEXTAREA>
367  </FORM>  </FORM>
368    
369  <?php  <?php
370            
371          $name=basename("$fsDir/$fn");          $name=basename("$fsDir/$fn");
372          $logname=dirname("$fsDir/$fn")."/.log/$name";          $logname=dirname("$fsDir/$fn")."/.log/$name";
373          $bakdir=dirname("$fsDir/$fn")."/.bak";          $bakdir=dirname("$fsDir/$fn")."/.bak";
# Line 978  the source<BR>of this file.<BR><BR> Line 978  the source<BR>of this file.<BR><BR>
978    
979  function LogIt($target,$msg) {  function LogIt($target,$msg) {
980    
         $target=stripSlashes($target);  
981          $dir=dirname($target);          $dir=dirname($target);
982          if (! file_exists($dir."/.log")) {          if (! file_exists($dir."/.log")) {
983                  mkdir($dir."/.log",0700);                  mkdir($dir."/.log",0700);
# Line 1226  function DisplayChangeLog($day) { Line 1225  function DisplayChangeLog($day) {
1225    
1226          $fsDir = $gblFsRoot . $relDir ; // current directory          $fsDir = $gblFsRoot . $relDir ; // current directory
1227          if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ;          if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ;
1228            
1229            $FN=stripSlashes($FN);
1230    
1231          switch ($POSTACTION) {          switch ($POSTACTION) {
1232          case "UPLOAD" :          case "UPLOAD" :
1233                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;
# Line 1267  function DisplayChangeLog($day) { Line 1268  function DisplayChangeLog($day) {
1268    
1269          case "SAVE" :          case "SAVE" :
1270                  $path = $gblFsRoot . $RELPATH ;                  $path = $gblFsRoot . $RELPATH ;
1271                    $path=stripSlashes($path);
1272                  $writable = is_writeable($path) ;                  $writable = is_writeable($path) ;
1273                  $legaldir = is_writeable(dirname($path)) ;                  $legaldir = is_writeable(dirname($path)) ;
1274                  $exists   = (file_exists($path)) ? 1 : 0 ;                  $exists   = (file_exists($path)) ? 1 : 0 ;
# Line 1274  function DisplayChangeLog($day) { Line 1276  function DisplayChangeLog($day) {
1276                  if (!($writable || (!$exists && $legaldir)))                  if (!($writable || (!$exists && $legaldir)))
1277                          Error("Write denied",$RELPATH) ;                          Error("Write denied",$RELPATH) ;
1278                  $fh = fopen($path, "w") ;                  $fh = fopen($path, "w") ;
1279                    $FILEDATA=stripSlashes($FILEDATA);
1280                  fwrite($fh,$FILEDATA) ;                  fwrite($fh,$FILEDATA) ;
1281                  fclose($fh) ;                  fclose($fh) ;
1282                  clearstatcache() ;                  clearstatcache() ;
# Line 1408  function DisplayChangeLog($day) { Line 1411  function DisplayChangeLog($day) {
1411          // $A=V : view file (do nothing except log)          // $A=V : view file (do nothing except log)
1412          // default : display directory $D          // default : display directory $D
1413    
         $F=stripSlashes($F);  
   
1414          switch ($A) {          switch ($A) {
1415          case "U" :          case "U" :
1416                  // upload to $relDir                  // upload to $relDir
# Line 1422  function DisplayChangeLog($day) { Line 1423  function DisplayChangeLog($day) {
1423                  EndHTML() ;                  EndHTML() ;
1424                  exit ;                  exit ;
1425          case "E" :          case "E" :
1426                    $F=stripSlashes($F);
1427                  // detail of $relDir/$F                  // detail of $relDir/$F
1428                  if (is_file("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ;                  if (is_file("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ;
1429                  exit ;                  exit ;
1430          case "C" :          case "C" :
1431                    $F=stripSlashes($F);
1432                  // listing of $relDir/$F                  // listing of $relDir/$F
1433                  DisplayCode($gblFsRoot, $relDir, $F) ;                  DisplayCode($gblFsRoot, $relDir, $F) ;
1434                  exit ;                  exit ;
# Line 1436  function DisplayChangeLog($day) { Line 1439  function DisplayChangeLog($day) {
1439                  Header("Location: ".urlpath("$relDir/$F"));                  Header("Location: ".urlpath("$relDir/$F"));
1440                  exit;                  exit;
1441          case "Ci" :          case "Ci" :
1442                    $F=stripSlashes($F);
1443                  // upload && update to $relDir                  // upload && update to $relDir
1444                  if (!is_writeable($gblFsRoot . $relDir))                  if (!is_writeable($gblFsRoot . $relDir))
1445                          Error("Write access denied",$relDir) ;                          Error("Write access denied",$relDir) ;

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.26