/[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.7 by dpavlin, Fri Aug 4 10:13:10 2000 UTC revision 1.24 by dpavlin, Tue Oct 10 14:32:07 2000 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 65  IMPORTANT INSTALLATION NOTE: Line 57  IMPORTANT INSTALLATION NOTE:
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    
# Line 108  TODO: Line 99  TODO:
99                          if ($user[0] == $GLOBALS["PHP_AUTH_USER"]) {                          if ($user[0] == $GLOBALS["PHP_AUTH_USER"]) {
100                                  $gblUserName=$user[1];                                  $gblUserName=$user[1];
101                                  $gblPw=$user[2];                                  $gblPw=$user[2];
102                                    $gblEmail=$user[3];
103                                  continue ;                                  continue ;
104                          }                          }
105                  }                  }
# Line 120  TODO: Line 112  TODO:
112          $gblDateFmt="Y-m-d";          $gblDateFmt="Y-m-d";
113          $gblTimeFmt="H:i:s";          $gblTimeFmt="H:i:s";
114    
115  // Number of backup files to keep          // Number of backup files to keep
116          $gblNumBackups=5;          $gblNumBackups=3;
117    
118            // show red star if newer than ... days
119            $gblModDays=1;
120    
121          // choose GifIcon below unless you have the M$          // choose GifIcon below unless you have the M$
122          // WingDings font installed on your system          // WingDings font installed on your system
# Line 194  function EndHTML() { Line 189  function EndHTML() {
189  </small>  </small>
190  </P>  </P>
191  <BR>  <BR>
192  <? include(".debug.inc") ?>  <? //include(".debug.inc") ?>
193  <BR><BR></BODY></HTML>  <BR><BR></BODY></HTML>
194    
195  <?php  <?php
# Line 294  echo($fstr) ; ?></TEXTAREA> Line 289  echo($fstr) ; ?></TEXTAREA>
289  </FORM>  </FORM>
290    
291  <?php  <?php
292          } else if ( strstr( join(" ",$gblImages), $ext ) ) {            }
293            if ( !$file_lock && $ext!="" && strstr(join(' ',$gblImages),$ext) ) {  
294                  $info  = getimagesize($fsPath) ;                  $info  = getimagesize($fsPath) ;
295                  $tstr  = "<IMG SRC=\"". $relPath . "\" BORDER=0 " ;                  $tstr = "<IMG SRC=\"".urlpath($relPath)."\" BORDER=0 " ;
296                  $tstr .= $info[3] . " ALT=\"" . $fn . " - " ;                  $tstr .= $info[3] . " ALT=\"" . $fn . " - " ;
297                  $tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ;                  $tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ;
298                  echo htmlentities($tstr) . "<BR><BR>" . $tstr ;  //              echo htmlentities($tstr) . "<BR><BR>" . $tstr ;
299                    echo $tstr ;
300          }          }
301    
302  ?>  ?>
# Line 361  echo($fstr) ; ?></TEXTAREA> Line 358  echo($fstr) ; ?></TEXTAREA>
358  </FORM>  </FORM>
359    
360  <?php  <?php
           
361    
362          $logname=dirname("$fsDir/$fn")."/.log/".basename("$fsDir/$fn");          $name=basename("$fsDir/$fn");
363            $logname=dirname("$fsDir/$fn")."/.log/$name";
364            $bakdir=dirname("$fsDir/$fn")."/.bak";
365          if (file_exists($logname)) {          if (file_exists($logname)) {
                 print "<hr><br><b>CHANGES TO THIS FILE</b><br><table border=0 width=100%>\n";  
366                  $log=fopen($logname,"r");                  $log=fopen($logname,"r");
367                  $cl1=" class=lst"; $cl2="";                  $cl1=" class=lst"; $cl2="";
368                    $logarr = array();
369                  while($line = fgetcsv($log,255,"\t")) {                  while($line = fgetcsv($log,255,"\t")) {
370                          $cl=$cl1; $cl1=$cl2; $cl2=$cl;                          $cl=$cl1; $cl1=$cl2; $cl2=$cl;
371                          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]));
372                  }                  }
373                  fclose($log);                  fclose($log);
374                    print "<hr><br><b>CHANGES TO THIS FILE</b><br><table border=0 width=100%>\n";
375                    $bakcount = 0;  // start from 0, skip fist backup (it's current)
376                    while ($e = array_shift($logarr)) {
377                            if (strstr($e[4],"upload")) {
378                                    if (file_exists("$bakdir/$bakcount/$name")) {
379                                            $e[4]="<a href=\"".dirname($relPath)."/.bak/$bakcount/$name\">$e[4]</a>";
380                                    }
381                                    $bakcount++;
382                            }
383                            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";
384                    }
385                  print "</table>";                  print "</table>";
386          }          }
387    
# Line 628  function GifIcon($txt) { Line 637  function GifIcon($txt) {
637    
638  function Navigate($fsRoot,$relDir) {  function Navigate($fsRoot,$relDir) {
639    
640          global $gblEditable, $gblIcon ;          global $gblEditable, $gblIcon, $gblModDays ;
641    
642          $self     = $GLOBALS["PHP_SELF"] ;          $self     = $GLOBALS["PHP_SELF"] ;
643          if (isset($GLOBALS["HTTPS"]) && $GLOBALS["HTTPS"] == "on") {          if (isset($GLOBALS["HTTPS"]) && $GLOBALS["HTTPS"] == "on") {
# Line 677  function Navigate($fsRoot,$relDir) { Line 686  function Navigate($fsRoot,$relDir) {
686                  $text .= ", <a href=$self?D=".urlencode($relDir)."&show_deleted=1>undelete</a>";                  $text .= ", <a href=$self?D=".urlencode($relDir)."&show_deleted=1>undelete</a>";
687          }          }
688          $text .= " or revise files on this web site." ;          $text .= " or revise files on this web site." ;
689            $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>.";
690          StartHTML("(Navigate)",$text) ;          StartHTML("(Navigate)",$text) ;
691    
692          echo "<TABLE BORDER=0 CELLPADDING=2          echo "<TABLE BORDER=0 CELLPADDING=2
# Line 743  function Navigate($fsRoot,$relDir) { Line 753  function Navigate($fsRoot,$relDir) {
753    
754                  $info_url=$self."?A=E&F=".urlencode($file)."&D=".urlencode($relDir);                  $info_url=$self."?A=E&F=".urlencode($file)."&D=".urlencode($relDir);
755    
756                  if ( ($mod + 30*86400) > time() ) {                  if ( ($mod + $gblModDays*86400) > time() ) {
757                          $a  = "<SPAN CLASS=RED TITLE=\"Newer" ;                          $a  = "<SPAN CLASS=RED TITLE=\"Newer" ;
758                          $a .= " than 30 days\"> * </SPAN>" ;                          $a .= " than $gblModDays days\"> * </SPAN>" ;
759                  }                  }
760    
761                  $file_lock=CheckLock($path);                  $file_lock=CheckLock($path);
# Line 831  function Navigate($fsRoot,$relDir) { Line 841  function Navigate($fsRoot,$relDir) {
841  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>
842    
843  <TR><TD></TD><TD COLSPAN=5>  <TR><TD></TD><TD COLSPAN=5>
844  To just view file without editing, select it's filename (<b>don't edit files which are opened this way!</b>)<br>  <?
845  To <b>edit</b> file select <?= $gblIcon("checkout") ?> to check-out  if (file_exists(".info.inc")) {
846  and edit it locally. After editing is over, select filename or <?= $gblIcon("checkin") ?> to check-in (update copy of file on server).<br>          include(".info.inc");
847  <by>If you select icon left from filename, you will get detailed information  }
848  about file, as well as delete, rename and annotation options.  ?>
849  </TD></TR>  </TD></TR>
850    
851  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>
# Line 848  about file, as well as delete, rename an Line 858  about file, as well as delete, rename an
858   <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE">   <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE">
859   <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">   <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">
860   <INPUT TYPE="SUBMIT" VALUE="CREATE"></NOBR>   <INPUT TYPE="SUBMIT" VALUE="CREATE"></NOBR>
861   <NOBR>OR <A HREF="<?= $self   <NOBR>OR <A HREF="<?= $self ?>?A=U&D=<?= urlencode($relDir) ?>">UPLOAD</A> A FILE
         ?>?A=U&D=<?= urlencode($relDir) ?>">UPLOAD</A> A FILE  
862   </NOBR>   </NOBR>
863  </TD></TR>  </TD></TR>
864  </FORM>  </FORM>
# Line 958  the source<BR>of this file.<BR><BR> Line 967  the source<BR>of this file.<BR><BR>
967    
968  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
969    
970  function Logit($target,$msg) {  function LogIt($target,$msg) {
971    
972          $dir=dirname($target);          $dir=dirname($target);
973          if (! file_exists($dir."/.log")) {          if (! file_exists($dir."/.log")) {
# Line 978  function Logit($target,$msg) { Line 987  function Logit($target,$msg) {
987    
988  function WriteNote($target,$msg) {  function WriteNote($target,$msg) {
989    
990            $target=stripSlashes($target);
991          $dir=dirname($target);          $dir=dirname($target);
992          if (! file_exists($dir."/.note")) {          if (! file_exists($dir."/.note")) {
993                  mkdir($dir."/.note",0700);                  mkdir($dir."/.note",0700);
# Line 994  function WriteNote($target,$msg) { Line 1004  function WriteNote($target,$msg) {
1004    
1005  function ReadNote($target) {  function ReadNote($target) {
1006    
1007            $target=stripSlashes($target);
1008          $dir=dirname($target);          $dir=dirname($target);
1009          $file=basename($target);          $file=basename($target);
1010          $msg="";          $msg="";
# Line 1010  function ReadNote($target) { Line 1021  function ReadNote($target) {
1021    
1022  function MoveTo($source,$folder) {  function MoveTo($source,$folder) {
1023    
1024            $source=stripSlashes($source);
1025          $file=basename($source);          $file=basename($source);
1026          if (! file_exists($folder)) {          if (! file_exists($folder)) {
1027                  mkdir($folder,0700);                  mkdir($folder,0700);
# Line 1023  function MoveTo($source,$folder) { Line 1035  function MoveTo($source,$folder) {
1035    
1036  function Lock($target) {  function Lock($target) {
1037    
1038            $target=stripSlashes($target);
1039          $dir=dirname($target);          $dir=dirname($target);
1040          if (! file_exists($dir."/.lock")) {          if (! file_exists($dir."/.lock")) {
1041                  mkdir($dir."/.lock",0700);                  mkdir($dir."/.lock",0700);
# Line 1043  function Lock($target) { Line 1056  function Lock($target) {
1056    
1057  function CheckLock($target) {  function CheckLock($target) {
1058    
1059            $target=stripSlashes($target);
1060          $dir=dirname($target);          $dir=dirname($target);
1061          $file=basename($target);          $file=basename($target);
1062          $msg=0;          $msg=0;
# Line 1057  function CheckLock($target) { Line 1071  function CheckLock($target) {
1071    
1072  function Unlock($target) {  function Unlock($target) {
1073    
1074            $target=stripSlashes($target);
1075          $dir=dirname($target);          $dir=dirname($target);
1076          $file=basename($target);          $file=basename($target);
1077          if (file_exists($dir."/.lock/$file")) {          if (file_exists($dir."/.lock/$file")) {
# Line 1070  function Unlock($target) { Line 1085  function Unlock($target) {
1085    
1086  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
1087    
1088  function redir_to_url($url) {  function urlpath($url) {
1089          $url=urlencode(StripSlashes("$relDir/$F"));          $url=urlencode(StripSlashes("$url"));
1090          $url=str_replace("%2F","/",$url);          $url=str_replace("%2F","/",$url);
1091          $url=str_replace("+","%20",$url);          $url=str_replace("+","%20",$url);
1092          Header("Location: $url");          return($url);
1093    }
1094    
1095    //////////////////////////////////////////////////////////////////
1096    
1097    function safe_rename($from,$to) {
1098            if (file_exists($from) && is_writable(dirname($to))) {
1099                    rename($from,$to);
1100            }
1101    }
1102    
1103    //////////////////////////////////////////////////////////////////
1104    
1105    // recursivly delete directory
1106    
1107    function rrmdir($dir) {
1108            $handle=opendir($dir);
1109            while ($file = readdir($handle)) {
1110                    if ($file != "." && $file != "..") {
1111                            if (is_dir("$dir/$file"))
1112                                    rrmdir("$dir/$file");
1113                            else
1114                                    if (! @unlink("$dir/$file")) return(0);
1115                    }
1116            }
1117            closedir($handle);
1118            return @rmdir($dir);
1119    }
1120    
1121    //////////////////////////////////////////////////////////////////
1122    
1123    function ChangeLog($target,$msg) {
1124    
1125            global $gblFsRoot;
1126            $log=fopen("$gblFsRoot/.changelog","a+");
1127            if (substr($target,0,strlen($gblFsRoot)) == $gblFsRoot)
1128                    $target=substr($target,strlen($gblFsRoot),strlen($target)-strlen($gblFsRoot));
1129            fputs($log,time()."\t$target\t$GLOBALS[gblUserName]\t$msg\n");
1130            fclose($log);
1131    
1132    }
1133    
1134    function DisplayChangeLog($day) {
1135    
1136            global $gblFsRoot;
1137            if (!file_exists("$gblFsRoot/.changelog")) return;
1138            $log=fopen("$gblFsRoot/.changelog","r");
1139            $logarr = array();
1140            while($line = fgetcsv($log,255,"\t")) {
1141                    if ($day!=1 || ($day==1 && (time()-$line[0] < 24*60*60))) {
1142                            array_unshift($logarr,array($line[0],$line[1],$line[2],$line[3]));
1143                    }
1144            }
1145            fclose($log);
1146            $cl1=" class=lst"; $cl2="";
1147            print "<table border=0 width=100%>\n";
1148            while ($e = array_shift($logarr)) {
1149                    $cl=$cl1; $cl1=$cl2; $cl2=$cl;
1150                    $date = date("$GLOBALS[gblDateFmt]", $e[0]);
1151                    $time = date("$GLOBALS[gblTimeFmt]", $e[0]);
1152                    $dir = dirname($e[1]);
1153                    $file = basename($e[1]);
1154                    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";
1155            }
1156            print "</table>";
1157            print "<p>".GifIcon(up)." Back to <a href=$GLOBALS[PHP_SELF]>front page</a>.</p>";
1158  }  }
1159    
1160  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
# Line 1125  function redir_to_url($url) { Line 1205  function redir_to_url($url) {
1205          // i.e. below $gblFsRoot.          // i.e. below $gblFsRoot.
1206    
1207          $relScriptDir = dirname($SCRIPT_NAME) ;                  $relScriptDir = dirname($SCRIPT_NAME) ;        
1208          // i.e. /siteman          // i.e. /docman
1209    
1210          $fsScriptDir  = dirname($SCRIPT_FILENAME) ;              $fsScriptDir  = dirname($SCRIPT_FILENAME) ;    
1211          // i.e. /home/httpd/html/siteman          // i.e. /home/httpd/html/docman
1212    
1213          $gblFsRoot = substr($fsScriptDir,0,          // start on server root
1214            strlen($fsScriptDir)-strlen($relScriptDir)) ;  //      $gblFsRoot = substr($fsScriptDir,0, strlen($fsScriptDir)-strlen($relScriptDir)) ;
1215            // or on script root
1216            $gblFsRoot = $fsScriptDir;
1217          // i.e. /home/httpd/html          // i.e. /home/httpd/html
1218    
1219          $fsDir = $gblFsRoot . $relDir ; // current directory          $fsDir = $gblFsRoot . $relDir ; // current directory
1220          if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ;          if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ;
1221            
1222            $FN=stripSlashes($FN);
1223    
1224          switch ($POSTACTION) {          switch ($POSTACTION) {
1225          case "UPLOAD" :          case "UPLOAD" :
1226                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;
# Line 1172  function redir_to_url($url) { Line 1256  function redir_to_url($url) {
1256                  if (isset($FILENAME)) {                  if (isset($FILENAME)) {
1257                          Unlock($target);                          Unlock($target);
1258                  }                  }
1259                    ChangeLog($target,"updated");
1260                  break ;                  break ;
1261    
1262          case "SAVE" :          case "SAVE" :
1263                  $path = $gblFsRoot . escapeshellcmd($RELPATH) ;                  $path = $gblFsRoot . $RELPATH ;
1264                    $path=stripSlashes($path);
1265                  $writable = is_writeable($path) ;                  $writable = is_writeable($path) ;
1266                  $legaldir = is_writeable(dirname($path)) ;                  $legaldir = is_writeable(dirname($path)) ;
1267                  $exists   = (file_exists($path)) ? 1 : 0 ;                  $exists   = (file_exists($path)) ? 1 : 0 ;
# Line 1183  function redir_to_url($url) { Line 1269  function redir_to_url($url) {
1269                  if (!($writable || (!$exists && $legaldir)))                  if (!($writable || (!$exists && $legaldir)))
1270                          Error("Write denied",$RELPATH) ;                          Error("Write denied",$RELPATH) ;
1271                  $fh = fopen($path, "w") ;                  $fh = fopen($path, "w") ;
1272                    $FILEDATA=stripSlashes($FILEDATA);
1273                  fwrite($fh,$FILEDATA) ;                  fwrite($fh,$FILEDATA) ;
1274                  fclose($fh) ;                  fclose($fh) ;
1275                  clearstatcache() ;                  clearstatcache() ;
1276                  Logit($path,"saved changes");                  Logit($path,"saved changes");
1277                    ChangeLog($path,"saved changes");
1278                  break ;                  break ;
1279    
1280          case "CREATE" :          case "CREATE" :
# Line 1217  function redir_to_url($url) { Line 1305  function redir_to_url($url) {
1305                          }                          }
1306                          $tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ;                          $tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ;
1307                          header("Location: " . $tstr) ;                          header("Location: " . $tstr) ;
1308                            ChangeLog($target,"created");
1309                          exit ;                          exit ;
1310                  }                  }
1311                  break ;                  break ;
# Line 1249  function redir_to_url($url) { Line 1338  function redir_to_url($url) {
1338                          }                          }
1339                  }                  }
1340                  else {  // delete directory                  else {  // delete directory
1341                    if ( ! @rmdir($fsDir) ) {                    if ( ! @rrmdir($fsDir) ) {
1342                      Error("Rmdir failed", $tstr . $fsDir) ;                      Error("Rmdir failed", $tstr . $fsDir) ;
1343                    }                    }
1344                    else {                    else {
# Line 1276  function redir_to_url($url) { Line 1365  function redir_to_url($url) {
1365                  if ( $CONFIRM != "on" ) break ;                  if ( $CONFIRM != "on" ) break ;
1366    
1367                  Logit("$fsDir/$FN","renamed $FN to $NEWNAME");                  Logit("$fsDir/$FN","renamed $FN to $NEWNAME");
1368                  rename("$fsDir/$FN","$fsDir/$NEWNAME");                  safe_rename("$fsDir/$FN","$fsDir/$NEWNAME");
1369                  rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME");                  safe_rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME");
1370                  rename("$fsDir/.note/$FN","$fsDir/.note/$NEWNAME");                  safe_rename("$fsDir/.note/$FN","$fsDir/.note/$NEWNAME");
1371                  rename("$fsDir/.lock/$FN","$fsDir/.lock/$NEWNAME");                  safe_rename("$fsDir/.lock/$FN","$fsDir/.lock/$NEWNAME");
1372                    for($i=0;$i<=$GLOBALS[gblNumBackups];$i++) {
1373                            safe_rename("$fsDir/.bak/$i/$FN","$fsDir/.bak/$i/$NEWNAME");
1374                    }
1375    
1376                  break ;                  break ;
1377    
# Line 1311  function redir_to_url($url) { Line 1403  function redir_to_url($url) {
1403          // $A=Ci : checkin file $D/$F          // $A=Ci : checkin file $D/$F
1404          // $A=V : view file (do nothing except log)          // $A=V : view file (do nothing except log)
1405          // default : display directory $D          // default : display directory $D
1406            
1407          switch ($A) {          switch ($A) {
1408          case "U" :          case "U" :
1409                  // upload to $relDir                  // upload to $relDir
# Line 1324  function redir_to_url($url) { Line 1416  function redir_to_url($url) {
1416                  EndHTML() ;                  EndHTML() ;
1417                  exit ;                  exit ;
1418          case "E" :          case "E" :
1419                    $F=stripSlashes($F);
1420                  // detail of $relDir/$F                  // detail of $relDir/$F
1421                  if (is_file("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ;                  if (is_file("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ;
1422                  exit ;                  exit ;
1423          case "C" :          case "C" :
1424                    $F=stripSlashes($F);
1425                  // listing of $relDir/$F                  // listing of $relDir/$F
1426                  DisplayCode($gblFsRoot, $relDir, $F) ;                  DisplayCode($gblFsRoot, $relDir, $F) ;
1427                  exit ;                  exit ;
1428          case "Co" :          case "Co" :
1429                  // checkout                  // checkout
1430                  Lock("$gblFsRoot/$relDir/$F");                  Lock("$gblFsRoot/$relDir/$F");
1431                  redir_to_url("$relDir/$F");                  header("Content-Disposition: attachment; filename=$F" );
1432                    Header("Location: ".urlpath("$relDir/$F"));
1433                  exit;                  exit;
1434          case "Ci" :          case "Ci" :
1435                    $F=stripSlashes($F);
1436                  // upload && update to $relDir                  // upload && update to $relDir
1437                  if (!is_writeable($gblFsRoot . $relDir))                  if (!is_writeable($gblFsRoot . $relDir))
1438                          Error("Write access denied",$relDir) ;                          Error("Write access denied",$relDir) ;
# Line 1348  function redir_to_url($url) { Line 1444  function redir_to_url($url) {
1444                  exit ;                  exit ;
1445          case "V" :          case "V" :
1446                  // view                  // view
1447                  Log("viewed");                  LogIt("$gblFsRoot/$relDir/$F","viewed");
1448                  redir_to_url("$relDir/$F");                  header("Content-Disposition: attachment; filename=$F" );
1449                    Header("Location: ".urlpath("$relDir/$F"));
1450                    exit;
1451            case "Ch" :
1452                    StartHTML("(File changes)","All changes chronologicaly...");
1453                    DisplayChangeLog(0);    // all
1454                    EndHTML() ;
1455                    exit;
1456            case "Ch1" :
1457                    StartHTML("(File changes)","Changes to files in last day...");
1458                    DisplayChangeLog(1);
1459                    EndHTML() ;
1460                  exit;                  exit;
1461          }          }
1462    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.26