/[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.4 by dpavlin, Thu Aug 3 20:54:27 2000 UTC revision 1.6 by dpavlin, Fri Aug 4 10:07:04 2000 UTC
# Line 184  function EndHTML() { Line 184  function EndHTML() {
184  <B><?= date($GLOBALS[gblDateFmt]) ?> -  <B><?= date($GLOBALS[gblDateFmt]) ?> -
185  <?= date($GLOBALS[gblTimeFmt]) ?> -  <?= date($GLOBALS[gblTimeFmt]) ?> -
186  <?= $GLOBALS[gblUserName] ?>  <?= $GLOBALS[gblUserName] ?>
187  <small> [<a href="<?= $PHP_SELF ?>?relogin=<?= $GLOBALS[gblPw] ?>">logout</a>]</small>  <small> [<a href="<?= $GLOBALS["PHP_SELF"] ?>?relogin=<?= $GLOBALS[gblPw] ?>">logout</a>]</small>
188  </B>  </B>
189  <BR>ANYPORTAL(php) Site Manager  <BR>ANYPORTAL(php) Site Manager
190  <br><small>  <br><small>
# Line 240  function DetailPage($fsRoot,$relDir,$fn) Line 240  function DetailPage($fsRoot,$relDir,$fn)
240          $ext      = strtolower(strrchr($relPath,".")) ;          $ext      = strtolower(strrchr($relPath,".")) ;
241          $editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ;          $editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ;
242          $writable = is_writeable($fsPath) ;          $writable = is_writeable($fsPath) ;
243            $file_lock = CheckLock($fsPath);
244    
245          if (!$editable && !$exists)          if (!$editable && !$exists)
246                  Error("Creation unsupported for type",$relPath) ;                  Error("Creation unsupported for type",$relPath) ;
# Line 268  function DetailPage($fsRoot,$relDir,$fn) Line 269  function DetailPage($fsRoot,$relDir,$fn)
269    
270          }          }
271    
272          if ( $editable && ($writable || !$exists) ) {          if ( $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 293  echo($fstr) ; ?></TEXTAREA> Line 294  echo($fstr) ; ?></TEXTAREA>
294  </FORM>  </FORM>
295    
296  <?php  <?php
297            } else if ( strstr( join(" ",$gblImages), $ext ) ) {  
298                    $info  = getimagesize($fsPath) ;
299                    $tstr  = "<IMG SRC=\"". $relPath . "\" BORDER=0 " ;
300                    $tstr .= $info[3] . " ALT=\"" . $fn . " - " ;
301                    $tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ;
302                    echo htmlentities($tstr) . "<BR><BR>" . $tstr ;
303          }          }
304          else if ( strstr( join(" ",$gblImages), $ext ) ) {    
           $info  = getimagesize($fsPath) ;  
           $tstr  = "<IMG SRC=\"". $relPath . "\" BORDER=0 " ;  
           $tstr .= $info[3] . " ALT=\"" . $fn . " - " ;  
           $tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ;  
           echo htmlentities($tstr) . "<BR><BR>" . $tstr ;  
         }  
305  ?>  ?>
306    
307  <FORM ACTION="<?= $self ; ?>" METHOD="POST">  <FORM ACTION="<?= $self ; ?>" METHOD="POST">
# Line 309  echo($fstr) ; ?></TEXTAREA> Line 310  echo($fstr) ; ?></TEXTAREA>
310  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"><BR>  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"><BR>
311    
312  <?php  <?php
313    
314            if ($file_lock) {
315    ?>
316    <hr>
317    <SPAN TITLE="Check OK and click UNLOCK to remove lock on file.">
318    <B>OK TO FORCE LOCK REMOVAL ON "<?= $fn ; ?>" HELD BY <?= $file_lock ?>? </B></SPAN>
319    <INPUT TYPE="CHECKBOX" NAME="CONFIRM">
320    <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="UNLOCK">
321    <?
322            } // file_lock
323    
324          if (substr($fn,0,4) == ".del") {          if (substr($fn,0,4) == ".del") {
325                  $action="UNDELETE";                  $action="UNDELETE";
326                  $desc="undelete previously deleted file";                  $desc="undelete previously deleted file";
# Line 336  echo($fstr) ; ?></TEXTAREA> Line 348  echo($fstr) ; ?></TEXTAREA>
348  <INPUT TYPE="CHECKBOX" NAME="CONFIRM">  <INPUT TYPE="CHECKBOX" NAME="CONFIRM">
349  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="RENAME">  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="RENAME">
350    
351    <?php
352            }       // exists && writable
353    ?>
354  <HR>  <HR>
355  <a name="note">  <a name="note">
356  <B>NOTE FOR "<?= $fn ; ?>":  <B>NOTE FOR "<?= $fn ; ?>":
# Line 343  echo($fstr) ; ?></TEXTAREA> Line 358  echo($fstr) ; ?></TEXTAREA>
358  </B></SPAN>  </B></SPAN>
359  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="NOTE">  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="NOTE">
360    
361    </FORM>
362    
363  <?php  <?php
364          }          
         echo "</FORM>" ;  
365    
366          $logname=dirname("$fsDir/$fn")."/.log/".basename("$fsDir/$fn");          $logname=dirname("$fsDir/$fn")."/.log/".basename("$fsDir/$fn");
367          if (file_exists($logname)) {          if (file_exists($logname)) {
# Line 590  function GifIcon($txt) { Line 606  function GifIcon($txt) {
606                  $d = "blank.gif" ;                  $d = "blank.gif" ;
607                  break ;                  break ;
608          case "checkout":          case "checkout":
609                  $d = "down.gif";                  $d = "box2.gif";
610                  break;                  break;
611          case "checkin":          case "checkin":
612                  $d = "up.gif";                  $d = "hand.up.gif";
613                    break;
614            case "locked":
615                    $d = "screw2.gif";
616                  break;                  break;
617          case "note":          case "note":
618                  $d = "quill.gif";                  $d = "quill.gif";
# Line 655  function Navigate($fsRoot,$relDir) { Line 674  function Navigate($fsRoot,$relDir) {
674          // start navigation page          // start navigation page
675          $text  = "Use this page to add, delete";          $text  = "Use this page to add, delete";
676          if (! isset($show_deleted)) {          if (! isset($show_deleted)) {
677                  $text .= ", <a href=".$GLOBALS[PHP_SELF]."?D=".urlencode($relDir)."&show_deleted=1>undelete</a>";                  $text .= ", <a href=$self?D=".urlencode($relDir)."&show_deleted=1>undelete</a>";
678          }          }
679          $text .= " or revise files on this web site." ;          $text .= " or revise files on this web site." ;
680          StartHTML("(Navigate)",$text) ;          StartHTML("(Navigate)",$text) ;
# Line 702  function Navigate($fsRoot,$relDir) { Line 721  function Navigate($fsRoot,$relDir) {
721  <TR><TD></TD><TD COLSPAN=5><HR><B><?= $webRoot . $relDir ?>  <TR><TD></TD><TD COLSPAN=5><HR><B><?= $webRoot . $relDir ?>
722  </B></TD></TR>  </B></TD></TR>
723  <TR><TD></TD><TD CLASS=TOP>DOCUMENT NAME</TD>  <TR><TD></TD><TD CLASS=TOP>DOCUMENT NAME</TD>
724  <TD><?= $gblIcon("blank") ?></TD>  <TD><?= $gblIcon("blank").$gblIcon("blank") ?></TD>
725  <TD CLASS=TOP>NOTE</TD>  <TD CLASS=TOP>NOTE</TD>
726  <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>
727    
# Line 729  function Navigate($fsRoot,$relDir) { Line 748  function Navigate($fsRoot,$relDir) {
748                          $a .= " than 30 days\"> * </SPAN>" ;                          $a .= " than 30 days\"> * </SPAN>" ;
749                  }                  }
750    
751                  $tstr = $webRoot . $relDir . "/" . $file ;                  $file_lock=CheckLock($path);
752                  $tstr  = "<A HREF=\"" . $tstr . "\">" ;  
753                    $file_url_html="<A HREF=\"$self?A=V&F=".urlencode($file);
754                    $file_url_html.="&D=".urlencode($relDir);
755                    $file_url_html.="\" TITLE=\"View file\">" ;
756    
757                  if (substr($file,0,5) != ".del/") {                  if (substr($file,0,5) != ".del/") {
758                          $tstr .= $file . "</A>" . $a ;                          $file_url_html .= $file . "</A>" . $a ;
759                  } else {                  } else {
760                          $tstr .= substr($file,5,strlen($file)-5) . "</a> <SPAN CLASS=RED TITLE=\"deleted\"> <a href=\"$info_url#undelete\">deleted</a> </span>";                          $file_url_html .= substr($file,5,strlen($file)-5) . "</a> <SPAN CLASS=RED TITLE=\"deleted\"> <a href=\"$info_url#undelete\">deleted</a> </span>";
761                  }                  }
762    
763  //              $b = $gblIcon("checkout");                  $note_html="<a href=\"$info_url#note\">".$gblIcon("note")."</a>".ReadNote($path);
 //              $b .= $gblIcon("checkin");  
764    
765                  $ext = strtolower(strrchr($file,".")) ;                  $ext = strtolower(strrchr($file,".")) ;
766                  if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) {    
767                          $b .= "<A HREF=\"" . $self . "?A=C&F=" ;                  if ($file_lock) {
768                          $b .= urlencode($file) . "&D=" . urlencode($relDir) ;                          if ($file_lock == $GLOBALS[gblUserName]) {
769                          $b .= "\" TITLE=\"List contents\">" ;                                  $b.="<A HREF=\"$self?A=Ci&F=".urlencode($file);
770                          $b .= $gblIcon("view") . "</A>" ;                                  $b.="&D=".urlencode($relDir);
771                                    $b.="\" TITLE=\"Checkin (update) file on server\">" ;
772                                    $file_url_html=$b;
773                                    $b.=$gblIcon("checkin")."</A>" ;
774                                    $b.= $gblIcon("blank");
775                                    $file_url_html.="$file</a> $a";
776                                    $note_html = $gblIcon("blank")."<b>Please check-in (update) this file</b>";
777                            } else {
778                                    $b = $gblIcon("locked");
779                                    $b.= $gblIcon("blank");
780                                    $note_html = $gblIcon("blank")."<b>File locked by $file_lock</b>";
781                                    $file_url_html = "$file $a";
782                            }
783                  } else {                  } else {
784                          $b .= $gblIcon("blank");                          $b.="<A HREF=\"$self?A=Co&F=".urlencode($file);
785                            $b.="&D=".urlencode($relDir);
786                            $b.="\" TITLE=\"Checkout file for edit\">" ;
787                            $b.=$gblIcon("checkout")."</A>" ;
788    
789                            if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) {  
790                                    $b.="<A HREF=\"$self?A=C&F=".urlencode($file);
791                                    $b.="&D=".urlencode($relDir);
792                                    $b.="\" TITLE=\"List contents\">" ;
793                                    $b.=$gblIcon("view")."</A>" ;
794                            } else {
795                                    $b.= $gblIcon("blank");
796                            }
797                  }                  }
798    
799    
# Line 757  function Navigate($fsRoot,$relDir) { Line 802  function Navigate($fsRoot,$relDir) {
802  <TR><TD>  <TR><TD>
803  <A HREF="<?= $info_url ?>" TITLE="View/Edit">  <A HREF="<?= $info_url ?>" TITLE="View/Edit">
804  <?= $gblIcon($ext) ?></A></TD>  <?= $gblIcon($ext) ?></A></TD>
805  <TD CLASS=LST><?= $tstr ?></TD>  <TD CLASS=LST><?= $file_url_html ?></TD>
806  <TD CLASS=LST ALIGN=center><?= $b ?></TD>  <TD CLASS=LST ALIGN=center><?= $b ?></TD>
807  <TD CLASS=LST ALIGN=left><a href="<?= $info_url ?>#note"><?= $gblIcon("note") ?></a><?= ReadNote($path) ?></TD>  <TD CLASS=LST ALIGN=left><?= $note_html ?></TD>
808  <TD CLASS=LST><?= date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]",$mod) ?></TD>  <TD CLASS=LST><?= date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]",$mod) ?></TD>
809  <TD CLASS=LST><?= $sz ?>Bytes</TD></TR>  <TD CLASS=LST><?= $sz ?>Bytes</TD></TR>
810    
# Line 785  function Navigate($fsRoot,$relDir) { Line 830  function Navigate($fsRoot,$relDir) {
830    
831  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>
832    
833    <TR><TD></TD><TD COLSPAN=5>
834    To just view file without editing, select it's filename (<b>don't edit files which are opened this way!</b>)<br>
835    To <b>edit</b> file select <?= $gblIcon("checkout") ?> to check-out
836    and edit it locally. After editing is over, select filename or <?= $gblIcon("checkin") ?> to check-in (update copy of file on server).<br>
837    <by>If you select icon left from filename, you will get detailed information
838    about file, as well as delete, rename and annotation options.
839    </TD></TR>
840    
841    <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>
842    
843  <FORM METHOD="POST" ACTION="<?= $self ?>">  <FORM METHOD="POST" ACTION="<?= $self ?>">
844  <TR><TD></TD><TD COLSPAN=5 CLASS=BAR>CREATE NEW  <TR><TD></TD><TD COLSPAN=5 CLASS=BAR>CREATE NEW
845   <INPUT TYPE="RADIO" NAME="T" VALUE="D" CHECKED>DIRECTORY -OR-   <INPUT TYPE="RADIO" NAME="T" VALUE="D" CHECKED>DIRECTORY -OR-
# Line 806  function Navigate($fsRoot,$relDir) { Line 861  function Navigate($fsRoot,$relDir) {
861    
862  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
863    
864  function UploadPage($fsRoot, $relDir) {  function UploadPage($fsRoot, $relDir, $filename) {
865    
866          $self = $GLOBALS["PHP_SELF"] ;          $self = $GLOBALS["PHP_SELF"] ;
867          if ($relDir == "") $relDir = "/" ;          if ($relDir == "") $relDir = "/" ;
# Line 816  function UploadPage($fsRoot, $relDir) { Line 871  function UploadPage($fsRoot, $relDir) {
871  <FORM ENCTYPE="multipart/form-data" METHOD="POST"  <FORM ENCTYPE="multipart/form-data" METHOD="POST"
872   ACTION="<?= $self ?>">   ACTION="<?= $self ?>">
873  DESTINATION DIRECTORY:<B><?= " " . $relDir ?></B>  DESTINATION DIRECTORY:<B><?= " " . $relDir ?></B>
874    <? if (isset($filename)) { ?>
875    <br>DESTINATION FILE:<B><?= " " . $filename ?></B>
876    <INPUT TYPE="HIDDEN" NAME="FILENAME" VALUE="<?= $filename ?>">
877    <? } ?>
878  <P>PATHNAME OF LOCAL FILE<BR>  <P>PATHNAME OF LOCAL FILE<BR>
879  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">
880  <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="UPLOAD">  <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="UPLOAD">
# Line 943  function ReadNote($target) { Line 1002  function ReadNote($target) {
1002                  $msg=fgets($note,4096);                  $msg=fgets($note,4096);
1003                  fclose($note);                  fclose($note);
1004          }          }
1005          return $msg;          return StripSlashes($msg);
1006    
1007  }  }
1008    
# Line 962  function MoveTo($source,$folder) { Line 1021  function MoveTo($source,$folder) {
1021    
1022  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
1023    
1024    function Lock($target) {
1025    
1026            $dir=dirname($target);
1027            if (! file_exists($dir."/.lock")) {
1028                    mkdir($dir."/.lock",0700);
1029            }
1030            $file=basename($target);
1031    
1032            if (file_exists("$dir/.lock/$file")) {
1033                    Logit($target,"attempt to locked allready locked file!");
1034            } else {
1035                    $lock=fopen("$dir/.lock/$file","w");
1036                    fputs($lock,"$GLOBALS[gblUserName]\n");
1037                    fclose($lock);
1038    
1039                    Logit($target,"file locked");
1040            }
1041    
1042    }
1043    
1044    function CheckLock($target) {
1045    
1046            $dir=dirname($target);
1047            $file=basename($target);
1048            $msg=0;
1049            if (file_exists($dir."/.lock/$file")) {
1050                    $lock=fopen("$dir/.lock/$file","r");
1051                    $msg=fgets($lock,4096);
1052                    fclose($lock);
1053            }
1054            return chop($msg);
1055    
1056    }
1057    
1058    function Unlock($target) {
1059    
1060            $dir=dirname($target);
1061            $file=basename($target);
1062            if (file_exists($dir."/.lock/$file")) {
1063                    unlink("$dir/.lock/$file");
1064                    Logit($target,"file unlocked");
1065            } else {
1066                    Logit($target,"attempt to unlocked non-locked file!");
1067            }
1068    
1069    }
1070    
1071    //////////////////////////////////////////////////////////////////
1072    
1073  // MAIN PROGRAM  // MAIN PROGRAM
1074  // ============  // ============
1075  // query parameters: capital letters  // query parameters: capital letters
# Line 1028  function MoveTo($source,$folder) { Line 1136  function MoveTo($source,$folder) {
1136                  // TODO : should rather check for escapeshellcmds                  // TODO : should rather check for escapeshellcmds
1137                  // but maybe RFC 18xx asserts safe filenames ....                  // but maybe RFC 18xx asserts safe filenames ....
1138                  $source = $FN ;                  $source = $FN ;
1139                  $target = $fsDir . "/" . $FN_name ;                  if (! isset($FILENAME)) {       // from update file
1140                            $target = "$fsDir/$FN_name" ;
1141                    } else {
1142                            $target = "$fsDir/$FILENAME";
1143                    }
1144    
1145                  // backup old files first                  // backup old files first
1146                  $dir=dirname($target);                  $dir=dirname($target);
# Line 1042  function MoveTo($source,$folder) { Line 1154  function MoveTo($source,$folder) {
1154                  for($i=$GLOBALS[gblNumBackups]-1;$i>0;$i--) {                  for($i=$GLOBALS[gblNumBackups]-1;$i>0;$i--) {
1155                          MoveTo("$dir/.bak/$i/$file","$dir/.bak/".($i+1)."/");                          MoveTo("$dir/.bak/$i/$file","$dir/.bak/".($i+1)."/");
1156                  }                  }
1157                  MoveTo($target,$dir."/.bak/1/".$file);                  MoveTo($target,$dir."/.bak/1/");
1158    
1159                  copy($source,$target) ;                  copy($source,$target) ;
1160                  chmod($target,$gblFilePerms) ;                  chmod($target,$gblFilePerms) ;
1161                  clearstatcache() ;                  clearstatcache() ;
1162                  Logit($target,"uploaded");                  Logit($target,"uploaded");
1163                    if (isset($FILENAME)) {
1164                            Unlock($target);
1165                    }
1166                  break ;                  break ;
1167    
1168          case "SAVE" :          case "SAVE" :
# Line 1073  function MoveTo($source,$folder) { Line 1188  function MoveTo($source,$folder) {
1188                  $relPath = $relDir . "/" . $FN ;                  $relPath = $relDir . "/" . $FN ;
1189                  switch ( $T ) {                  switch ( $T ) {
1190                  case "D" :  // create a directory                  case "D" :  // create a directory
1191                    if ( ! @mkdir($path,$gblDirPerms) )                          if ( ! @mkdir($path,$gblDirPerms) )
1192                      Error("Mkdir failed",$relPath) ; // eg. if it exists                                  Error("Mkdir failed",$relPath) ; // eg. if it exists
1193                    clearstatcache() ;                          clearstatcache() ;
1194                    break ;                          break ;
1195                  case "F" :  // create a new file                  case "F" :  // create a new file
1196  // this functionality is doubled in DetailView().  // this functionality is doubled in DetailView().
1197  // better keep it here altogether  // better keep it here altogether
1198  // chmod perms to $gblFilePerms  // chmod perms to $gblFilePerms
1199                    if ( file_exists($path) && !is_writable($path) )                          if ( file_exists($path) && !is_writable($path) )
1200                      Error("File not writable", $relPath) ;                                  Error("File not writable", $relPath) ;
1201                    $tstr = $PHP_SELF . "?A=E&D=" . $relDir . "&F=" . $FN ;                          $fh = fopen($path, "w+") ;
1202                    header("Location: " . $tstr) ;                          if ($fh) {
1203                    exit ;                                  fputs($fh,"\n");
1204                                    fclose($fh) ;
1205                                    LogIt($path,"file created");
1206                            } else {
1207                                    Error("Creation of file $relPath failed -- $path");
1208                            }
1209                            $tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ;
1210                            header("Location: " . $tstr) ;
1211                            exit ;
1212                  }                  }
1213                  break ;                  break ;
1214    
# Line 1111  function MoveTo($source,$folder) { Line 1234  function MoveTo($source,$folder) {
1234                                  exit ;                                  exit ;
1235                          } else {                          } else {
1236                                  Logit($path,"file deleted");                                  Logit($path,"file deleted");
                                 if (! file_exists("$dir/.del/.log")) {  
                                         mkdir("$dir/.del/.log",0700);  
                                 }  
1237                                  MoveTo("$dir/.log/$file","$dir/.del/.log/");                                  MoveTo("$dir/.log/$file","$dir/.del/.log/");
1238                                  MoveTo("$dir/.note/$file","$dir/.del/.note/");                                  MoveTo("$dir/.note/$file","$dir/.del/.note/");
1239                                    MoveTo("$dir/.lock/$file","$dir/.del/.lock/");
1240                          }                          }
1241                  }                  }
1242                  else {  // delete directory                  else {  // delete directory
# Line 1138  function MoveTo($source,$folder) { Line 1259  function MoveTo($source,$folder) {
1259                  MoveTo("$fsDir/.del/$file","$fsDir/");                  MoveTo("$fsDir/.del/$file","$fsDir/");
1260                  MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/");                  MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/");
1261                  MoveTo("$fsDir/.del/.note/$file","$fsDir/.note/");                  MoveTo("$fsDir/.del/.note/$file","$fsDir/.note/");
1262                    MoveTo("$fsDir/.del/.lock/$file","$fsDir/.lock/");
1263    
1264                  break ;                  break ;
1265    
# Line 1147  function MoveTo($source,$folder) { Line 1269  function MoveTo($source,$folder) {
1269                  Logit("$fsDir/$FN","renamed $FN to $NEWNAME");                  Logit("$fsDir/$FN","renamed $FN to $NEWNAME");
1270                  rename("$fsDir/$FN","$fsDir/$NEWNAME");                  rename("$fsDir/$FN","$fsDir/$NEWNAME");
1271                  rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME");                  rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME");
1272                    rename("$fsDir/.note/$FN","$fsDir/.note/$NEWNAME");
1273                    rename("$fsDir/.lock/$FN","$fsDir/.lock/$NEWNAME");
1274    
1275                  break ;                  break ;
1276    
# Line 1154  function MoveTo($source,$folder) { Line 1278  function MoveTo($source,$folder) {
1278                  WriteNote("$fsDir/$FN","$NOTE");                  WriteNote("$fsDir/$FN","$NOTE");
1279                  break ;                  break ;
1280    
1281            case "UNLOCK" :  
1282                    if ( $CONFIRM != "on" ) break ;
1283                    Unlock("$fsDir/$FN");
1284                    break ;
1285    
1286          default :          default :
1287                  // user hit "CANCEL" or undefined action                  // user hit "CANCEL" or undefined action
1288          }          }
# Line 1169  function MoveTo($source,$folder) { Line 1298  function MoveTo($source,$folder) {
1298          // $A=U : upload to path given in $D          // $A=U : upload to path given in $D
1299          // $A=E : display detail of file $D/$F and edit          // $A=E : display detail of file $D/$F and edit
1300          // $A=C : display code in file $D/$F          // $A=C : display code in file $D/$F
1301            // $A=Co : checkout file $D/$F
1302            // $A=Ci : checkin file $D/$F
1303            // $A=V : view file (do nothing except log)
1304          // default : display directory $D          // default : display directory $D
1305                    
1306          switch ($A) {          switch ($A) {
# Line 1190  function MoveTo($source,$folder) { Line 1322  function MoveTo($source,$folder) {
1322                  // listing of $relDir/$F                  // listing of $relDir/$F
1323                  DisplayCode($gblFsRoot, $relDir, $F) ;                  DisplayCode($gblFsRoot, $relDir, $F) ;
1324                  exit ;                  exit ;
1325            case "Co" :
1326                    // checkout
1327                    Lock("$gblFsRoot/$relDir/$F");
1328                    $url="$relDir/$F"; $url=str_replace(" ","%20",$url);
1329                    Header("Location: $url");
1330                    exit;
1331            case "Ci" :
1332                    // upload && update to $relDir
1333                    if (!is_writeable($gblFsRoot . $relDir))
1334                            Error("Write access denied",$relDir) ;
1335                    $text  = "Use this page to update a single " ;
1336                    $text .= "file to <B>$SERVER_NAME</B>." ;
1337                    StartHTML("(Update file Page)", $text) ;
1338                    UploadPage($gblFsRoot, $relDir, $F) ;
1339                    EndHTML() ;
1340                    exit ;
1341            case "V" :
1342                    // view
1343                    Log("viewed");
1344                    $url="$relDir/$F"; $url=str_replace(" ","%20",$url);
1345                    Header("Location: $url");
1346                    exit;
1347          }          }
1348    
1349          // default: display directory $relDir          // default: display directory $relDir

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

  ViewVC Help
Powered by ViewVC 1.1.26