/[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.46 by dpavlin, Mon Oct 29 16:20:28 2001 UTC revision 1.49 by dpavlin, Fri Dec 14 17:28:06 2001 UTC
# Line 371  echo($fstr) ; ?></TEXTAREA> Line 371  echo($fstr) ; ?></TEXTAREA>
371                  $log=fopen($logname,"r");                  $log=fopen($logname,"r");
372                  $cl1=" class=LST"; $cl2="";                  $cl1=" class=LST"; $cl2="";
373                  $logarr = array();                  $logarr = array();
374                  while($line = fgetcsv($log,255,"\t")) {                  while($line = fgetcsv($log,512,"\t")) {
375                          $cl=$cl1; $cl1=$cl2; $cl2=$cl;                          $cl=$cl1; $cl1=$cl2; $cl2=$cl;
376                          array_unshift($logarr,array($cl,$line[0],$line[1],$line[2],$line[3]));                          array_unshift($logarr,array($cl,$line[0],$line[1],$line[2],$line[3]));
377                  }                  }
# Line 701  function Navigate($fsRoot,$relDir) { Line 701  function Navigate($fsRoot,$relDir) {
701                  CELLSPACING=3 WIDTH=\"100%\">" ;                  CELLSPACING=3 WIDTH=\"100%\">" ;
702    
703          // updir bar              // updir bar    
704          if ($fsDir != $fsRoot) {          if (chopsl($fsDir) != chopsl($fsRoot)) {
705                  $parent = dirname($relDir) ;                  $parent = dirname($relDir) ;
706                  if ($parent == "") $parent = "/" ;                  if ($parent == "") $parent = "/" ;
707  ?>  ?>
# Line 849  function plural($name,$count) { Line 849  function plural($name,$count) {
849  <?  <?
850          }          }
851    
852          if ($emptyDir) {          if ($emptyDir && $relDir != "") {
853  ?>  ?>
854    
855  <FORM METHOD="POST" ACTION="<?= $self ?>">  <FORM METHOD="POST" ACTION="<?= $self ?>">
# Line 1145  function ChangeLog($target,$msg) { Line 1145  function ChangeLog($target,$msg) {
1145          $log=fopen("$gblFsRoot/.changelog","a+");          $log=fopen("$gblFsRoot/.changelog","a+");
1146          if (substr($target,0,strlen($gblFsRoot)) == $gblFsRoot)          if (substr($target,0,strlen($gblFsRoot)) == $gblFsRoot)
1147                  $target=substr($target,strlen($gblFsRoot),strlen($target)-strlen($gblFsRoot));                  $target=substr($target,strlen($gblFsRoot),strlen($target)-strlen($gblFsRoot));
1148            $msg=str_replace("\t"," ",$msg);
1149          fputs($log,time()."\t$target\t$GLOBALS[gblUserName]\t$msg\n");          fputs($log,time()."\t$target\t$GLOBALS[gblUserName]\t$msg\n");
1150          fclose($log);          fclose($log);
1151    
# Line 1156  function DisplayChangeLog($day) { Line 1157  function DisplayChangeLog($day) {
1157          if (!file_exists("$gblFsRoot/.changelog")) return;          if (!file_exists("$gblFsRoot/.changelog")) return;
1158          $log=fopen("$gblFsRoot/.changelog","r");          $log=fopen("$gblFsRoot/.changelog","r");
1159          $logarr = array();          $logarr = array();
1160          while($line = fgetcsv($log,255,"\t")) {          while($line = fgetcsv($log,512,"\t")) {
1161                    $line[0] .= sizeof($line);
1162                    while (sizeof($line) > 4) {
1163                            $tmp = array_pop($line);
1164                            $line.=" $tmp";
1165                    }
1166                  if ($day!=1 || ($day==1 && (time()-$line[0] < 24*60*60))) {                  if ($day!=1 || ($day==1 && (time()-$line[0] < 24*60*60))) {
1167                          array_unshift($logarr,array($line[0],$line[1],$line[2],$line[3]));                          array_unshift($logarr,array($line[0],$line[1],$line[2],$line[3]));
1168                  }                  }
# Line 1199  function Download($path) { Line 1205  function Download($path) {
1205    
1206  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
1207    
1208    function chopsl($path) {
1209            if (substr($path,strlen($path)-1,1) == "/") $path=substr($path,0,strlen($path)-1);
1210            $path=str_replace("//","/",$path);
1211            return $path;
1212    }
1213    
1214    //////////////////////////////////////////////////////////////////
1215  // MAIN PROGRAM  // MAIN PROGRAM
1216  // ============  // ============
1217  // query parameters: capital letters  // query parameters: capital letters
# Line 1456  function Download($path) { Line 1469  function Download($path) {
1469          // $A=Co : checkout file $D/$F          // $A=Co : checkout file $D/$F
1470          // $A=Ci : checkin file $D/$F          // $A=Ci : checkin file $D/$F
1471          // $A=V : view file (do nothing except log)          // $A=V : view file (do nothing except log)
1472            // $A=I : include file .$F.php from $gblFsRoot
1473          // default : display directory $D          // default : display directory $D
1474    
1475          switch ($A) {          switch ($A) {
# Line 1515  function Download($path) { Line 1529  function Download($path) {
1529                  DisplayChangeLog(1);                  DisplayChangeLog(1);
1530                  EndHTML() ;                  EndHTML() ;
1531                  exit;                  exit;
1532            case "I" :
1533                    $F=stripSlashes($F);
1534                    $inc_file="${gblFsRoot}/.${F}.php";
1535                    if (!isset($F) || $F == "" || !file_exists($inc_file)) Error("Fatal error $inc_file"); // can't find file to include
1536                    if (!is_readable($inc_file))
1537                            Error("Read access to include file denied",".${F}.php");
1538                    $text  = "Your include file should define \$text variable which holds this text and \$title variable which is page title";
1539                    $title = "You should define \$title variable with page title";
1540                    include($inc_file);
1541                    StartHTML($title, $text) ;
1542                    print "<p>".GifIcon(up)." Back to <a href=$GLOBALS[PHP_SELF]>front page</a>.</p>";
1543                    EndHTML() ;
1544                    exit ;
1545          }          }
1546    
1547          // default: display directory $relDir          // default: display directory $relDir

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

  ViewVC Help
Powered by ViewVC 1.1.26