65 |
TODO: |
TODO: |
66 |
mixed file/directory output (add type to each entry, |
mixed file/directory output (add type to each entry, |
67 |
real support for links) |
real support for links) |
68 |
add more content-management (like cms.sourceforge.net): |
retrieve old versions of files (overwritten) |
|
check-out/check-in/reserve |
|
|
comments to files |
|
69 |
*/ |
*/ |
70 |
|
|
71 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
155 |
|
|
156 |
<HTML> |
<HTML> |
157 |
<HEAD> |
<HEAD> |
158 |
<TITLE><?php echo $host . " " . $title ?></TITLE> |
<TITLE><?= $host . " " . $title ?></TITLE> |
159 |
<META NAME="description" CONTENT="PHP port of AnyPortal Site Manager"> |
<META NAME="description" CONTENT="PHP port of AnyPortal Site Manager"> |
160 |
<META NAME="keywords" CONTENT="site manager, web site maintenance"> |
<META NAME="keywords" CONTENT="site manager, web site maintenance"> |
161 |
<META NAME="robots" CONTENT="noindex"> |
<META NAME="robots" CONTENT="noindex"> |
162 |
<META HTTP-EQUIV="expires" CONTENT="0"> |
<META HTTP-EQUIV="expires" CONTENT="0"> |
163 |
<LINK REL="stylesheet" TYPE="text/css" |
<LINK REL="stylesheet" TYPE="text/css" |
164 |
HREF="<?php echo $self ?>?STYLE=get"> |
HREF="<?= $self ?>?STYLE=get"> |
165 |
</HEAD> |
</HEAD> |
166 |
<BODY BGCOLOR="#FFFFFF"> |
<BODY BGCOLOR="#FFFFFF"> |
167 |
<H3 ALIGN="RIGHT"><?php echo $host ?></H3> |
<H3 ALIGN="RIGHT"><?= $host ?></H3> |
168 |
<TABLE BORDER=0 WIDTH="100%"><TR> |
<TABLE BORDER=0 WIDTH="100%"><TR> |
169 |
<TD CLASS=INV><?php echo $title ?></TD></TR></TABLE> |
<TD CLASS=INV><?= $title ?></TD></TR></TABLE> |
170 |
<P><?php echo $text ?></P> |
<P><?= $text ?></P> |
171 |
|
|
172 |
<?php |
<?php |
173 |
} // end function StartHTML |
} // end function StartHTML |
182 |
<B><?= date($GLOBALS[gblDateFmt]) ?> - |
<B><?= date($GLOBALS[gblDateFmt]) ?> - |
183 |
<?= date($GLOBALS[gblTimeFmt]) ?> - |
<?= date($GLOBALS[gblTimeFmt]) ?> - |
184 |
<?= $GLOBALS[gblUserName] ?> |
<?= $GLOBALS[gblUserName] ?> |
185 |
<small> [<a href="<?= $PHP_SELF ?>?relogin=<?= $GLOBALS[gblPw] ?>">logout</a>]</small> |
<small> [<a href="<?= $GLOBALS["PHP_SELF"] ?>?relogin=<?= $GLOBALS[gblPw] ?>">logout</a>]</small> |
186 |
</B> |
</B> |
187 |
<BR>ANYPORTAL(php) Site Manager |
<BR>ANYPORTAL(php) Site Manager |
188 |
<br><small> |
<br><small> |
192 |
</small> |
</small> |
193 |
</P> |
</P> |
194 |
<BR> |
<BR> |
195 |
<? //include("../debug.inc") ?> |
<? //include(".debug.inc") ?> |
196 |
<BR><BR></BODY></HTML> |
<BR><BR></BODY></HTML> |
197 |
|
|
198 |
<?php |
<?php |
238 |
$ext = strtolower(strrchr($relPath,".")) ; |
$ext = strtolower(strrchr($relPath,".")) ; |
239 |
$editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ; |
$editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ; |
240 |
$writable = is_writeable($fsPath) ; |
$writable = is_writeable($fsPath) ; |
241 |
|
$file_lock = CheckLock($fsPath); |
242 |
|
|
243 |
if (!$editable && !$exists) |
if (!$editable && !$exists) |
244 |
Error("Creation unsupported for type",$relPath) ; |
Error("Creation unsupported for type",$relPath) ; |
253 |
|
|
254 |
echo "<H3>" . $relDir . "/" . $fn . "</H3>" ; |
echo "<H3>" . $relDir . "/" . $fn . "</H3>" ; |
255 |
if ($exists) { // get file info |
if ($exists) { // get file info |
256 |
$fsize = filesize($fsPath) ; |
$fsize = filesize($fsPath) ; |
257 |
$fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ; |
$fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ; |
258 |
$faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ; |
$faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ; |
259 |
echo "<PRE> file size: " . $fsize . " Bytes<BR>" ; |
echo "<PRE> file size: " . $fsize . " Bytes<BR>" ; |
260 |
echo "last modified: <B>" . $fmodified . "</B><BR>" ; |
echo "last modified: <B>" . $fmodified . "</B><BR>" ; |
261 |
echo "last accessed: <B>" . $faccessed . "</B><BR>" ; |
echo "last accessed: <B>" . $faccessed . "</B><BR>" ; |
262 |
echo " owner: <B>" . fileowner($fsPath) . "</B><BR>" ; |
echo " owner: <B>" . fileowner($fsPath) . "</B><BR>" ; |
263 |
echo " group: <B>" . filegroup($fsPath) . "</B><BR>" ; |
echo " group: <B>" . filegroup($fsPath) . "</B><BR>" ; |
264 |
echo " permissions: <B>" ; |
echo " permissions: <B>" ; |
265 |
echo printf( "%o", fileperms($fsPath) ) . "</B>" ; |
echo printf( "%o", fileperms($fsPath) ) . "</B>" ; |
266 |
echo "</PRE>" ; |
echo "</PRE>" ; |
267 |
|
|
268 |
} |
} |
269 |
|
|
270 |
if ( $editable && ($writable || !$exists) ) { |
if ( $editable && ($writable || !$exists) && !$file_lock ) { |
271 |
$fh = fopen($fsPath,"a+") ; |
$fh = fopen($fsPath,"a+") ; |
272 |
rewind($fh) ; |
rewind($fh) ; |
273 |
$fstr = fread($fh,filesize($fsPath)) ; |
$fstr = fread($fh,filesize($fsPath)) ; |
275 |
$fstr = htmlentities( $fstr ) ; |
$fstr = htmlentities( $fstr ) ; |
276 |
?> |
?> |
277 |
|
|
278 |
<FORM ACTION="<?php echo $self ; ?>" METHOD="POST"> |
<FORM ACTION="<?= $self ; ?>" METHOD="POST"> |
279 |
<SPAN TITLE="Click [SAVE] to store updated contents."> |
<SPAN TITLE="Click [SAVE] to store updated contents."> |
280 |
<B>DOCUMENT CONTENTS</B> |
<B>DOCUMENT CONTENTS</B> |
281 |
</SPAN><BR> |
</SPAN><BR> |
282 |
<TEXTAREA NAME="FILEDATA" ROWS=18 COLS=70 WRAP="OFF"><?php |
<TEXTAREA NAME="FILEDATA" ROWS=18 COLS=70 WRAP="OFF"><?php |
283 |
echo($fstr) ; ?></TEXTAREA> |
echo($fstr) ; ?></TEXTAREA> |
284 |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>"> |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ; ?>"> |
285 |
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>"> |
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?= $fn ; ?>"> |
286 |
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="SAVE"> |
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="SAVE"> |
287 |
<INPUT TYPE="HIDDEN" SIZE=48 MAXLENGTH=255 NAME="RELPATH" |
<INPUT TYPE="HIDDEN" SIZE=48 MAXLENGTH=255 NAME="RELPATH" |
288 |
VALUE="<?php echo $relPath ; ?>"> |
VALUE="<?= $relPath ; ?>"> |
289 |
<br> |
<br> |
290 |
<INPUT TYPE="RESET" VALUE="UNDO ALL CHANGES"> |
<INPUT TYPE="RESET" VALUE="UNDO ALL CHANGES"> |
291 |
<INPUT TYPE="SUBMIT" VALUE="SAVE"> |
<INPUT TYPE="SUBMIT" VALUE="SAVE"> |
293 |
|
|
294 |
<?php |
<?php |
295 |
} |
} |
296 |
else if ( strstr( join(" ",$gblImages), $ext ) ) { |
if ( !$file_lock && strstr(join(" ",$gblImages),$ext) ) { |
297 |
$info = getimagesize($fsPath) ; |
$info = getimagesize($fsPath) ; |
298 |
$tstr = "<IMG SRC=\"". $relPath . "\" BORDER=0 " ; |
$tstr = "<IMG SRC=\"".urlpath($relPath)."\" BORDER=0 " ; |
299 |
$tstr .= $info[3] . " ALT=\"" . $fn . " - " ; |
$tstr .= $info[3] . " ALT=\"" . $fn . " - " ; |
300 |
$tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ; |
$tstr .= (int)(($fsize+1023)/1024) . "Kb\">" ; |
301 |
echo htmlentities($tstr) . "<BR><BR>" . $tstr ; |
// echo htmlentities($tstr) . "<BR><BR>" . $tstr ; |
302 |
|
echo $tstr ; |
303 |
} |
} |
304 |
|
|
305 |
?> |
?> |
306 |
|
|
307 |
<FORM ACTION="<?php echo $self ; ?>" METHOD="POST"> |
<FORM ACTION="<?= $self ; ?>" METHOD="POST"> |
308 |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>"> |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ; ?>"> |
309 |
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>"> |
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?= $fn ; ?>"> |
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"; |
332 |
if ($exists && $writable) { |
if ($exists && $writable) { |
333 |
?> |
?> |
334 |
|
|
335 |
<HR><SPAN TITLE="Check OK and click [<?= $action ?>] to <?= $desc ?>."> |
<HR> |
336 |
<B>OK TO <?= $action ?> "<?php echo $fn ; ?>"? </B></SPAN> |
<a name="undelete"> |
337 |
|
<SPAN TITLE="Check OK and click [<?= $action ?>] to <?= $desc ?>."> |
338 |
|
<B>OK TO <?= $action ?> "<?= $fn ; ?>"? </B></SPAN> |
339 |
<INPUT TYPE="CHECKBOX" NAME="CONFIRM"> |
<INPUT TYPE="CHECKBOX" NAME="CONFIRM"> |
340 |
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="<?= $action ?>"> |
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="<?= $action ?>"> |
341 |
|
|
342 |
<HR><SPAN TITLE="Check OK and click [RENAME] to rename."> |
<HR> |
343 |
<B>OK TO RENAME "<?php echo $fn ; ?>" TO |
<a name="rename"> |
344 |
|
<SPAN TITLE="Check OK and click [RENAME] to rename."> |
345 |
|
<B>OK TO RENAME "<?= $fn ; ?>" TO |
346 |
<INPUT TYPE="TEXT" SIZE=24 MAXLENGTH=255 NAME="NEWNAME" VALUE="<?= $fn ?>"> |
<INPUT TYPE="TEXT" SIZE=24 MAXLENGTH=255 NAME="NEWNAME" VALUE="<?= $fn ?>"> |
347 |
? </B></SPAN> |
? </B></SPAN> |
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 |
<?php |
352 |
} |
} // exists && writable |
353 |
echo "</FORM>" ; |
?> |
354 |
|
<HR> |
355 |
|
<a name="note"> |
356 |
|
<B>NOTE FOR "<?= $fn ; ?>": |
357 |
|
<INPUT TYPE="TEXT" SIZE=50 MAXLENGTH=255 NAME="NOTE" VALUE="<?= ReadNote($fsPath) ?>"> |
358 |
|
</B></SPAN> |
359 |
|
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="NOTE"> |
360 |
|
|
361 |
|
</FORM> |
362 |
|
|
363 |
$logname=dirname("$fsDir/$fn")."/.log/".basename("$fsDir/$fn"); |
<?php |
364 |
|
|
365 |
|
$name=basename("$fsDir/$fn"); |
366 |
|
$logname=dirname("$fsDir/$fn")."/.log/$name"; |
367 |
|
$bakdir=dirname("$fsDir/$fn")."/.bak"; |
368 |
if (file_exists($logname)) { |
if (file_exists($logname)) { |
|
print "<hr><br><b>CHANGES TO THIS FILE</b><br><table border=0 width=100%>\n"; |
|
369 |
$log=fopen($logname,"r"); |
$log=fopen($logname,"r"); |
370 |
$cl1=" class=lst"; $cl2=""; |
$cl1=" class=lst"; $cl2=""; |
371 |
|
$logarr = array(); |
372 |
while($line = fgetcsv($log,255,"\t")) { |
while($line = fgetcsv($log,255,"\t")) { |
373 |
$cl=$cl1; $cl1=$cl2; $cl2=$cl; |
$cl=$cl1; $cl1=$cl2; $cl2=$cl; |
374 |
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])); |
375 |
} |
} |
376 |
fclose($log); |
fclose($log); |
377 |
|
print "<hr><br><b>CHANGES TO THIS FILE</b><br><table border=0 width=100%>\n"; |
378 |
|
$bakcount = 0; // start from 0, skip fist backup (it's current) |
379 |
|
while ($e = array_shift($logarr)) { |
380 |
|
if (strstr($e[4],"upload")) { |
381 |
|
if (file_exists("$bakdir/$bakcount/$name")) { |
382 |
|
$e[4]="<a href=\"".dirname($relPath)."/.bak/$bakcount/$name\">$e[4]</a>"; |
383 |
|
} |
384 |
|
$bakcount++; |
385 |
|
} |
386 |
|
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"; |
387 |
|
} |
388 |
print "</table>"; |
print "</table>"; |
389 |
} |
} |
390 |
|
|
617 |
case "blank" : |
case "blank" : |
618 |
$d = "blank.gif" ; |
$d = "blank.gif" ; |
619 |
break ; |
break ; |
620 |
|
case "checkout": |
621 |
|
$d = "box2.gif"; |
622 |
|
break; |
623 |
|
case "checkin": |
624 |
|
$d = "hand.up.gif"; |
625 |
|
break; |
626 |
|
case "locked": |
627 |
|
$d = "screw2.gif"; |
628 |
|
break; |
629 |
|
case "note": |
630 |
|
$d = "quill.gif"; |
631 |
|
break; |
632 |
default : |
default : |
633 |
$d = "generic.gif" ; |
$d = "generic.gif" ; |
634 |
} |
} |
686 |
// start navigation page |
// start navigation page |
687 |
$text = "Use this page to add, delete"; |
$text = "Use this page to add, delete"; |
688 |
if (! isset($show_deleted)) { |
if (! isset($show_deleted)) { |
689 |
$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>"; |
690 |
} |
} |
691 |
$text .= " or revise files on this web site." ; |
$text .= " or revise files on this web site." ; |
692 |
StartHTML("(Navigate)",$text) ; |
StartHTML("(Navigate)",$text) ; |
700 |
if ($parent == "") $parent = "/" ; |
if ($parent == "") $parent = "/" ; |
701 |
?> |
?> |
702 |
|
|
703 |
<TR><TD><?php echo $gblIcon("up") ?></TD><TD COLSPAN=4 CLASS=LST> |
<TR><TD><?= $gblIcon("up") ?></TD><TD COLSPAN=5 CLASS=LST> |
704 |
<A HREF="<?php echo $self ?>?D=<?php echo urlencode($parent) ?>"> |
<A HREF="<?= $self ?>?D=<?= urlencode($parent) ?>"> |
705 |
<B><?php echo $parent ?></B></A></TD></TR> |
<B><?= $parent ?></B></A></TD></TR> |
706 |
|
|
707 |
<?php |
<?php |
708 |
} |
} |
712 |
sort($dirList) ; |
sort($dirList) ; |
713 |
?> |
?> |
714 |
|
|
715 |
<TR><TD></TD><TD COLSPAN=4 CLASS=TOP><HR>DIRECTORY NAME</TD></TR> |
<TR><TD></TD><TD COLSPAN=5 CLASS=TOP><HR>DIRECTORY NAME</TD></TR> |
716 |
|
|
717 |
<?php |
<?php |
718 |
while (list($key,$dir) = each($dirList)) { |
while (list($key,$dir) = each($dirList)) { |
722 |
$tstr .= "\">" . $dir . "/</A>" ; |
$tstr .= "\">" . $dir . "/</A>" ; |
723 |
?> |
?> |
724 |
|
|
725 |
<TR><TD><?php echo $gblIcon("fldr") ?></TD> |
<TR><TD><?= $gblIcon("fldr") ?></TD> |
726 |
<TD COLSPAN=4 CLASS=LST><?php echo $tstr ?></TD></TR> |
<TD COLSPAN=5 CLASS=LST><?= $tstr ?></TD></TR> |
727 |
|
|
728 |
<?php |
<?php |
729 |
} // iterate over dirs |
} // iterate over dirs |
730 |
} // end if no dirs |
} // end if no dirs |
731 |
?> |
?> |
732 |
|
|
733 |
<TR><TD></TD><TD COLSPAN=4><HR><B><?php echo $webRoot . $relDir ?> |
<TR><TD></TD><TD COLSPAN=5><HR><B><?= $webRoot . $relDir ?> |
734 |
</B></TD></TR> |
</B></TD></TR> |
735 |
<TR><TD></TD><TD CLASS=TOP>DOCUMENT NAME</TD> |
<TR><TD></TD><TD CLASS=TOP>DOCUMENT NAME</TD> |
736 |
<TD><?php echo $gblIcon("blank") ?></TD> |
<TD><?= $gblIcon("blank").$gblIcon("blank") ?></TD> |
737 |
|
<TD CLASS=TOP>NOTE</TD> |
738 |
<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> |
739 |
|
|
740 |
<?php |
<?php |
741 |
if (sizeof($fileList) > 0) { |
if (sizeof($fileList) > 0) { |
742 |
sort($fileList) ; |
sort($fileList) ; |
743 |
while (list($key,$file) = each($fileList)) { |
while (list($key,$file) = each($fileList)) { |
744 |
$path = $fsDir."/".$file ; |
$path = $fsDir."/".$file ; |
745 |
$mod = filemtime($path) ; |
$mod = filemtime($path) ; |
746 |
$sz = filesize($path) ; |
$sz = filesize($path) ; |
|
|
|
|
if ($sz >= 10240) { |
|
|
$sz = (int)(($sz+1023)/1024) . " k" ; |
|
|
} |
|
|
else { |
|
|
$sz .= " " ; |
|
|
} // end size |
|
|
|
|
|
$a = $b = "" ; |
|
|
|
|
|
if ( ($mod + 30*86400) > time() ) { |
|
|
$a = "<SPAN CLASS=RED TITLE=\"Newer" ; |
|
|
$a .= " than 30 days\"> * </SPAN>" ; |
|
|
} |
|
747 |
|
|
748 |
$tstr = $webRoot . $relDir . "/" . $file ; |
if ($sz >= 10240) { |
749 |
$tstr = "<A HREF=\"" . $tstr . "\">" ; |
$sz = (int)(($sz+1023)/1024) . " k" ; |
750 |
|
} else { |
751 |
|
$sz .= " " ; |
752 |
|
} // end size |
753 |
|
|
754 |
|
$a = $b = "" ; |
755 |
|
|
756 |
|
$info_url=$self."?A=E&F=".urlencode($file)."&D=".urlencode($relDir); |
757 |
|
|
758 |
|
if ( ($mod + 30*86400) > time() ) { |
759 |
|
$a = "<SPAN CLASS=RED TITLE=\"Newer" ; |
760 |
|
$a .= " than 30 days\"> * </SPAN>" ; |
761 |
|
} |
762 |
|
|
763 |
|
$file_lock=CheckLock($path); |
764 |
|
|
765 |
|
$file_url_html="<A HREF=\"$self?A=V&F=".urlencode($file); |
766 |
|
$file_url_html.="&D=".urlencode($relDir); |
767 |
|
$file_url_html.="\" TITLE=\"View file\">" ; |
768 |
|
|
769 |
if (substr($file,0,5) != ".del/") { |
if (substr($file,0,5) != ".del/") { |
770 |
$tstr .= $file . "</A>" . $a ; |
$file_url_html .= $file . "</A>" . $a ; |
771 |
} else { |
} else { |
772 |
$tstr .= substr($file,5,strlen($file)-5) . "</a> <SPAN CLASS=RED TITLE=\"deleted\"> deleted </span>"; |
$file_url_html .= substr($file,5,strlen($file)-5) . "</a> <SPAN CLASS=RED TITLE=\"deleted\"> <a href=\"$info_url#undelete\">deleted</a> </span>"; |
773 |
|
} |
774 |
|
|
775 |
|
$note_html="<a href=\"$info_url#note\">".$gblIcon("note")."</a>".ReadNote($path); |
776 |
|
|
777 |
|
$ext = strtolower(strrchr($file,".")) ; |
778 |
|
|
779 |
|
if ($file_lock) { |
780 |
|
if ($file_lock == $GLOBALS[gblUserName]) { |
781 |
|
$b.="<A HREF=\"$self?A=Ci&F=".urlencode($file); |
782 |
|
$b.="&D=".urlencode($relDir); |
783 |
|
$b.="\" TITLE=\"Checkin (update) file on server\">" ; |
784 |
|
$file_url_html=$b; |
785 |
|
$b.=$gblIcon("checkin")."</A>" ; |
786 |
|
$b.= $gblIcon("blank"); |
787 |
|
$file_url_html.="$file</a> $a"; |
788 |
|
$note_html = $gblIcon("blank")."<b>Please check-in (update) this file</b>"; |
789 |
|
} else { |
790 |
|
$b = $gblIcon("locked"); |
791 |
|
$b.= $gblIcon("blank"); |
792 |
|
$note_html = $gblIcon("blank")."<b>File locked by $file_lock</b>"; |
793 |
|
$file_url_html = "$file $a"; |
794 |
|
} |
795 |
|
} else { |
796 |
|
$b.="<A HREF=\"$self?A=Co&F=".urlencode($file); |
797 |
|
$b.="&D=".urlencode($relDir); |
798 |
|
$b.="\" TITLE=\"Checkout file for edit\">" ; |
799 |
|
$b.=$gblIcon("checkout")."</A>" ; |
800 |
|
|
801 |
|
if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) { |
802 |
|
$b.="<A HREF=\"$self?A=C&F=".urlencode($file); |
803 |
|
$b.="&D=".urlencode($relDir); |
804 |
|
$b.="\" TITLE=\"List contents\">" ; |
805 |
|
$b.=$gblIcon("view")."</A>" ; |
806 |
|
} else { |
807 |
|
$b.= $gblIcon("blank"); |
808 |
|
} |
809 |
} |
} |
810 |
|
|
|
$ext = strtolower(strrchr($file,".")) ; |
|
|
if ( $ext=="" || |
|
|
strstr(join(" ",$gblEditable),$ext) ) |
|
|
{ |
|
|
$b = "<A HREF=\"" . $self . "?A=C&F=" ; |
|
|
$b .= urlencode($file) . "&D=" . urlencode($relDir) ; |
|
|
$b .= "\" TITLE=\"List contents\">" ; |
|
|
$b .= $gblIcon("view") . "</A>" ; |
|
|
} |
|
811 |
|
|
812 |
?> |
?> |
813 |
|
|
814 |
<TR><TD> |
<TR><TD> |
815 |
<A HREF="<?php echo $self ?>?A=E&F=<?php echo urlencode($file) |
<A HREF="<?= $info_url ?>" TITLE="View/Edit"> |
816 |
?>&D=<?php echo urlencode($relDir) ?>" TITLE="View/Edit"> |
<?= $gblIcon($ext) ?></A></TD> |
817 |
<?php echo $gblIcon($ext) ?></A></TD> |
<TD CLASS=LST><?= $file_url_html ?></TD> |
818 |
<TD CLASS=LST><?php echo $tstr ?></TD> |
<TD CLASS=LST ALIGN=center><?= $b ?></TD> |
819 |
<TD CLASS=LST ALIGN=center><?php echo $b ?></TD> |
<TD CLASS=LST ALIGN=left><?= $note_html ?></TD> |
820 |
<TD CLASS=LST><?php echo date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]",$mod) ?></TD> |
<TD CLASS=LST><?= date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]",$mod) ?></TD> |
821 |
<TD CLASS=LST><?php echo $sz ?>Bytes</TD></TR> |
<TD CLASS=LST><?= $sz ?>Bytes</TD></TR> |
822 |
|
|
823 |
<?php |
<?php |
824 |
} // iterate over files |
} // iterate over files |
827 |
if ($emptyDir) { |
if ($emptyDir) { |
828 |
?> |
?> |
829 |
|
|
830 |
<FORM METHOD="POST" ACTION="<?php echo $self ?>"> |
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
831 |
<TR><TD></TD><TD COLSPAN=4 CLASS=BAR> |
<TR><TD></TD><TD COLSPAN=5 CLASS=BAR> |
832 |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ?>"> |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"> |
833 |
OK TO DELETE THIS EMPTY FOLDER? |
OK TO DELETE THIS EMPTY FOLDER? |
834 |
<INPUT TYPE="CHECKBOX" NAME="CONFIRM"> |
<INPUT TYPE="CHECKBOX" NAME="CONFIRM"> |
835 |
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="DELETE"> |
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="DELETE"> |
840 |
} // end if emptyDir |
} // end if emptyDir |
841 |
?> |
?> |
842 |
|
|
843 |
<TR><TD></TD><TD COLSPAN=4><HR></TD></TR> |
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR> |
844 |
|
|
845 |
<FORM METHOD="POST" ACTION="<?php echo $self ?>"> |
<TR><TD></TD><TD COLSPAN=5> |
846 |
<TR><TD></TD><TD COLSPAN=4 CLASS=BAR>CREATE NEW |
To just view file without editing, select it's filename (<b>don't edit files which are opened this way!</b>)<br> |
847 |
|
To <b>edit</b> file select <?= $gblIcon("checkout") ?> to check-out |
848 |
|
and edit it locally. After editing is over, select filename or <?= $gblIcon("checkin") ?> to check-in (update copy of file on server).<br> |
849 |
|
<by>If you select icon left from filename, you will get detailed information |
850 |
|
about file, as well as delete, rename and annotation options. |
851 |
|
</TD></TR> |
852 |
|
|
853 |
|
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR> |
854 |
|
|
855 |
|
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
856 |
|
<TR><TD></TD><TD COLSPAN=5 CLASS=BAR>CREATE NEW |
857 |
<INPUT TYPE="RADIO" NAME="T" VALUE="D" CHECKED>DIRECTORY -OR- |
<INPUT TYPE="RADIO" NAME="T" VALUE="D" CHECKED>DIRECTORY -OR- |
858 |
<INPUT TYPE="RADIO" NAME="T" VALUE="F">FILE : |
<INPUT TYPE="RADIO" NAME="T" VALUE="F">FILE : |
859 |
<NOBR>NAME <INPUT TYPE="TEXT" NAME="FN" SIZE=14> |
<NOBR>NAME <INPUT TYPE="TEXT" NAME="FN" SIZE=14> |
860 |
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE"> |
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE"> |
861 |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ?>"> |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"> |
862 |
<INPUT TYPE="SUBMIT" VALUE="CREATE"></NOBR> |
<INPUT TYPE="SUBMIT" VALUE="CREATE"></NOBR> |
863 |
<NOBR>OR <A HREF="<?php echo $self |
<NOBR>OR <A HREF="<?= $self ?>?A=U&D=<?= urlencode($relDir) ?>">UPLOAD</A> A FILE |
|
?>?A=U&D=<?php echo urlencode($relDir) ?>">UPLOAD</A> A FILE |
|
864 |
</NOBR> |
</NOBR> |
865 |
</TD></TR> |
</TD></TR> |
866 |
</FORM> |
</FORM> |
872 |
|
|
873 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
874 |
|
|
875 |
function UploadPage($fsRoot, $relDir) { |
function UploadPage($fsRoot, $relDir, $filename) { |
876 |
|
|
877 |
$self = $GLOBALS["PHP_SELF"] ; |
$self = $GLOBALS["PHP_SELF"] ; |
878 |
if ($relDir == "") $relDir = "/" ; |
if ($relDir == "") $relDir = "/" ; |
880 |
|
|
881 |
<P><TABLE BORDER=0 CELLPADDING=5><TR><TD WIDTH=5></TD><TD CLASS=BAR> |
<P><TABLE BORDER=0 CELLPADDING=5><TR><TD WIDTH=5></TD><TD CLASS=BAR> |
882 |
<FORM ENCTYPE="multipart/form-data" METHOD="POST" |
<FORM ENCTYPE="multipart/form-data" METHOD="POST" |
883 |
ACTION="<?php echo $self ?>"> |
ACTION="<?= $self ?>"> |
884 |
DESTINATION DIRECTORY:<B><?php echo " " . $relDir ?></B> |
DESTINATION DIRECTORY:<B><?= " " . $relDir ?></B> |
885 |
|
<? if (isset($filename)) { ?> |
886 |
|
<br>DESTINATION FILE:<B><?= " " . $filename ?></B> |
887 |
|
<INPUT TYPE="HIDDEN" NAME="FILENAME" VALUE="<?= $filename ?>"> |
888 |
|
<? } ?> |
889 |
<P>PATHNAME OF LOCAL FILE<BR> |
<P>PATHNAME OF LOCAL FILE<BR> |
890 |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ?>"> |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"> |
891 |
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="UPLOAD"> |
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="UPLOAD"> |
892 |
<INPUT SIZE=30 TYPE="FILE" NAME="FN"></P> |
<INPUT SIZE=30 TYPE="FILE" NAME="FN"></P> |
893 |
<P><INPUT TYPE="SUBMIT" VALUE="UPLOAD"></P> |
<P><INPUT TYPE="SUBMIT" VALUE="UPLOAD"></P> |
894 |
<P>If the <B>[BROWSE...]</B> button is not displayed,<BR> |
<P>If the <B>[BROWSE...]</B> button is not displayed,<BR> |
895 |
you must upgrade to an RFC1867-compliant browser.</P> |
you must upgrade to an RFC1867-compliant browser.</P> |
896 |
<P>Your browser:<BR><?php echo $GLOBALS["HTTP_USER_AGENT"] ?></P> |
<P>Your browser:<BR><?= $GLOBALS["HTTP_USER_AGENT"] ?></P> |
897 |
</FORM> |
</FORM> |
898 |
</TD></TR> |
</TD></TR> |
899 |
<TR><TD></TD><TD> |
<TR><TD></TD><TD> |
900 |
<FORM METHOD="POST" ACTION="<?php echo $self ?>"> |
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
901 |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ?>"><BR> |
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"><BR> |
902 |
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"> |
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"> |
903 |
</FORM> |
</FORM> |
904 |
</TD></TR></TABLE></P> |
</TD></TR></TABLE></P> |
951 |
StartHTML($title,$text) ; |
StartHTML($title,$text) ; |
952 |
?> |
?> |
953 |
|
|
954 |
<FORM ACTION="<?php echo $self ?>?HASH=create" METHOD="POST"> |
<FORM ACTION="<?= $self ?>?HASH=create" METHOD="POST"> |
955 |
<INPUT TYPE="HIDDEN" NAME="USER" VALUE="<?php echo $user ?>"> |
<INPUT TYPE="HIDDEN" NAME="USER" VALUE="<?= $user ?>"> |
956 |
<INPUT TYPE="HIDDEN" NAME="PW" VALUE="<?php echo $pw ?>"> |
<INPUT TYPE="HIDDEN" NAME="PW" VALUE="<?= $pw ?>"> |
957 |
|
|
958 |
<BLOCKQUOTE><B>If you are a site administrator:</B><BR><BR> |
<BLOCKQUOTE><B>If you are a site administrator:</B><BR><BR> |
959 |
Click below to <B>generate a password hash</B><BR>from |
Click below to <B>generate a password hash</B><BR>from |
985 |
} |
} |
986 |
|
|
987 |
|
|
988 |
|
////////////////////////////////////////////////////////////////// |
989 |
|
|
990 |
|
function WriteNote($target,$msg) { |
991 |
|
|
992 |
|
$dir=dirname($target); |
993 |
|
if (! file_exists($dir."/.note")) { |
994 |
|
mkdir($dir."/.note",0700); |
995 |
|
} |
996 |
|
$file=basename($target); |
997 |
|
|
998 |
|
$note=fopen("$dir/.note/$file","w"); |
999 |
|
fputs($note,"$msg\n"); |
1000 |
|
fclose($note); |
1001 |
|
|
1002 |
|
Logit($target,"added note $msg"); |
1003 |
|
|
1004 |
|
} |
1005 |
|
|
1006 |
|
function ReadNote($target) { |
1007 |
|
|
1008 |
|
$dir=dirname($target); |
1009 |
|
$file=basename($target); |
1010 |
|
$msg=""; |
1011 |
|
if (file_exists($dir."/.note/$file")) { |
1012 |
|
$note=fopen("$dir/.note/$file","r"); |
1013 |
|
$msg=fgets($note,4096); |
1014 |
|
fclose($note); |
1015 |
|
} |
1016 |
|
return StripSlashes($msg); |
1017 |
|
|
1018 |
|
} |
1019 |
|
|
1020 |
|
////////////////////////////////////////////////////////////////// |
1021 |
|
|
1022 |
|
function MoveTo($source,$folder) { |
1023 |
|
|
1024 |
|
$file=basename($source); |
1025 |
|
if (! file_exists($folder)) { |
1026 |
|
mkdir($folder,0700); |
1027 |
|
} |
1028 |
|
if (file_exists($source)) { |
1029 |
|
rename($source,"$folder/$file"); |
1030 |
|
} |
1031 |
|
} |
1032 |
|
|
1033 |
|
////////////////////////////////////////////////////////////////// |
1034 |
|
|
1035 |
|
function Lock($target) { |
1036 |
|
|
1037 |
|
$dir=dirname($target); |
1038 |
|
if (! file_exists($dir."/.lock")) { |
1039 |
|
mkdir($dir."/.lock",0700); |
1040 |
|
} |
1041 |
|
$file=basename($target); |
1042 |
|
|
1043 |
|
if (file_exists("$dir/.lock/$file")) { |
1044 |
|
Logit($target,"attempt to locked allready locked file!"); |
1045 |
|
} else { |
1046 |
|
$lock=fopen("$dir/.lock/$file","w"); |
1047 |
|
fputs($lock,"$GLOBALS[gblUserName]\n"); |
1048 |
|
fclose($lock); |
1049 |
|
|
1050 |
|
Logit($target,"file locked"); |
1051 |
|
} |
1052 |
|
|
1053 |
|
} |
1054 |
|
|
1055 |
|
function CheckLock($target) { |
1056 |
|
|
1057 |
|
$dir=dirname($target); |
1058 |
|
$file=basename($target); |
1059 |
|
$msg=0; |
1060 |
|
if (file_exists($dir."/.lock/$file")) { |
1061 |
|
$lock=fopen("$dir/.lock/$file","r"); |
1062 |
|
$msg=fgets($lock,4096); |
1063 |
|
fclose($lock); |
1064 |
|
} |
1065 |
|
return chop($msg); |
1066 |
|
|
1067 |
|
} |
1068 |
|
|
1069 |
|
function Unlock($target) { |
1070 |
|
|
1071 |
|
$dir=dirname($target); |
1072 |
|
$file=basename($target); |
1073 |
|
if (file_exists($dir."/.lock/$file")) { |
1074 |
|
unlink("$dir/.lock/$file"); |
1075 |
|
Logit($target,"file unlocked"); |
1076 |
|
} else { |
1077 |
|
Logit($target,"attempt to unlocked non-locked file!"); |
1078 |
|
} |
1079 |
|
|
1080 |
|
} |
1081 |
|
|
1082 |
|
////////////////////////////////////////////////////////////////// |
1083 |
|
|
1084 |
|
function urlpath($url) { |
1085 |
|
$url=urlencode(StripSlashes("$url")); |
1086 |
|
$url=str_replace("%2F","/",$url); |
1087 |
|
$url=str_replace("+","%20",$url); |
1088 |
|
return($url); |
1089 |
|
} |
1090 |
|
|
1091 |
|
////////////////////////////////////////////////////////////////// |
1092 |
|
|
1093 |
|
function safe_rename($from,$to) { |
1094 |
|
if (file_exists($from) && is_writable(dirname($to))) { |
1095 |
|
rename($from,$to); |
1096 |
|
} |
1097 |
|
} |
1098 |
|
|
1099 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1100 |
|
|
1164 |
// TODO : should rather check for escapeshellcmds |
// TODO : should rather check for escapeshellcmds |
1165 |
// but maybe RFC 18xx asserts safe filenames .... |
// but maybe RFC 18xx asserts safe filenames .... |
1166 |
$source = $FN ; |
$source = $FN ; |
1167 |
$target = $fsDir . "/" . $FN_name ; |
if (! isset($FILENAME)) { // from update file |
1168 |
|
$target = "$fsDir/$FN_name" ; |
1169 |
|
} else { |
1170 |
|
$target = "$fsDir/$FILENAME"; |
1171 |
|
} |
1172 |
|
|
1173 |
// backup old files first |
// backup old files first |
1174 |
$dir=dirname($target); |
$dir=dirname($target); |
1180 |
} |
} |
1181 |
$file=basename($target); |
$file=basename($target); |
1182 |
for($i=$GLOBALS[gblNumBackups]-1;$i>0;$i--) { |
for($i=$GLOBALS[gblNumBackups]-1;$i>0;$i--) { |
1183 |
if (! file_exists($dir."/.bak/".$i)) { |
MoveTo("$dir/.bak/$i/$file","$dir/.bak/".($i+1)."/"); |
|
mkdir($dir."/.bak/".$i,0700); |
|
|
} |
|
|
if (file_exists($dir."/.bak/".$i."/".$file)) { |
|
|
rename($dir."/.bak/".$i."/".$file, |
|
|
$dir."/.bak/".($i+1)."/".$file); |
|
|
} |
|
|
} |
|
|
if (file_exists($target)) { |
|
|
rename($target,$dir."/.bak/1/".$file); |
|
1184 |
} |
} |
1185 |
|
MoveTo($target,$dir."/.bak/1/"); |
1186 |
|
|
1187 |
copy($source,$target) ; |
copy($source,$target) ; |
1188 |
chmod($target,$gblFilePerms) ; |
chmod($target,$gblFilePerms) ; |
1189 |
clearstatcache() ; |
clearstatcache() ; |
1190 |
Logit($target,"uploaded"); |
Logit($target,"uploaded"); |
1191 |
|
if (isset($FILENAME)) { |
1192 |
|
Unlock($target); |
1193 |
|
} |
1194 |
break ; |
break ; |
1195 |
|
|
1196 |
case "SAVE" : |
case "SAVE" : |
1216 |
$relPath = $relDir . "/" . $FN ; |
$relPath = $relDir . "/" . $FN ; |
1217 |
switch ( $T ) { |
switch ( $T ) { |
1218 |
case "D" : // create a directory |
case "D" : // create a directory |
1219 |
if ( ! @mkdir($path,$gblDirPerms) ) |
if ( ! @mkdir($path,$gblDirPerms) ) |
1220 |
Error("Mkdir failed",$relPath) ; // eg. if it exists |
Error("Mkdir failed",$relPath) ; // eg. if it exists |
1221 |
clearstatcache() ; |
clearstatcache() ; |
1222 |
break ; |
break ; |
1223 |
case "F" : // create a new file |
case "F" : // create a new file |
1224 |
// this functionality is doubled in DetailView(). |
// this functionality is doubled in DetailView(). |
1225 |
// better keep it here altogether |
// better keep it here altogether |
1226 |
// chmod perms to $gblFilePerms |
// chmod perms to $gblFilePerms |
1227 |
if ( file_exists($path) && !is_writable($path) ) |
if ( file_exists($path) && !is_writable($path) ) |
1228 |
Error("File not writable", $relPath) ; |
Error("File not writable", $relPath) ; |
1229 |
$tstr = $PHP_SELF . "?A=E&D=" . $relDir . "&F=" . $FN ; |
$fh = fopen($path, "w+") ; |
1230 |
header("Location: " . $tstr) ; |
if ($fh) { |
1231 |
exit ; |
fputs($fh,"\n"); |
1232 |
|
fclose($fh) ; |
1233 |
|
LogIt($path,"file created"); |
1234 |
|
} else { |
1235 |
|
Error("Creation of file $relPath failed -- $path"); |
1236 |
|
} |
1237 |
|
$tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ; |
1238 |
|
header("Location: " . $tstr) ; |
1239 |
|
exit ; |
1240 |
} |
} |
1241 |
break ; |
break ; |
1242 |
|
|
1262 |
exit ; |
exit ; |
1263 |
} else { |
} else { |
1264 |
Logit($path,"file deleted"); |
Logit($path,"file deleted"); |
1265 |
if (! file_exists("$dir/.del/.log")) { |
MoveTo("$dir/.log/$file","$dir/.del/.log/"); |
1266 |
mkdir("$dir/.del/.log",0700); |
MoveTo("$dir/.note/$file","$dir/.del/.note/"); |
1267 |
} |
MoveTo("$dir/.lock/$file","$dir/.del/.lock/"); |
|
rename("$dir/.log/$file","$dir/.del/.log/$file"); |
|
1268 |
} |
} |
1269 |
} |
} |
1270 |
else { // delete directory |
else { // delete directory |
1284 |
$file=substr($FN,4,strlen($FN)-4); |
$file=substr($FN,4,strlen($FN)-4); |
1285 |
|
|
1286 |
Logit("$fsDir/.del/$file","undeleted"); |
Logit("$fsDir/.del/$file","undeleted"); |
1287 |
rename("$fsDir/.del/$file","$fsDir/$file"); |
MoveTo("$fsDir/.del/$file","$fsDir/"); |
1288 |
rename("$fsDir/.del/.log/$file","$fsDir/.log/$file"); |
MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/"); |
1289 |
|
MoveTo("$fsDir/.del/.note/$file","$fsDir/.note/"); |
1290 |
|
MoveTo("$fsDir/.del/.lock/$file","$fsDir/.lock/"); |
1291 |
|
|
1292 |
break ; |
break ; |
1293 |
|
|
1295 |
if ( $CONFIRM != "on" ) break ; |
if ( $CONFIRM != "on" ) break ; |
1296 |
|
|
1297 |
Logit("$fsDir/$FN","renamed $FN to $NEWNAME"); |
Logit("$fsDir/$FN","renamed $FN to $NEWNAME"); |
1298 |
rename("$fsDir/$FN","$fsDir/$NEWNAME"); |
safe_rename("$fsDir/$FN","$fsDir/$NEWNAME"); |
1299 |
rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME"); |
safe_rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME"); |
1300 |
|
safe_rename("$fsDir/.note/$FN","$fsDir/.note/$NEWNAME"); |
1301 |
|
safe_rename("$fsDir/.lock/$FN","$fsDir/.lock/$NEWNAME"); |
1302 |
|
|
1303 |
|
break ; |
1304 |
|
|
1305 |
|
case "NOTE" : |
1306 |
|
WriteNote("$fsDir/$FN","$NOTE"); |
1307 |
|
break ; |
1308 |
|
|
1309 |
|
case "UNLOCK" : |
1310 |
|
if ( $CONFIRM != "on" ) break ; |
1311 |
|
Unlock("$fsDir/$FN"); |
1312 |
break ; |
break ; |
1313 |
|
|
1314 |
default : |
default : |
1326 |
// $A=U : upload to path given in $D |
// $A=U : upload to path given in $D |
1327 |
// $A=E : display detail of file $D/$F and edit |
// $A=E : display detail of file $D/$F and edit |
1328 |
// $A=C : display code in file $D/$F |
// $A=C : display code in file $D/$F |
1329 |
|
// $A=Co : checkout file $D/$F |
1330 |
|
// $A=Ci : checkin file $D/$F |
1331 |
|
// $A=V : view file (do nothing except log) |
1332 |
// default : display directory $D |
// default : display directory $D |
1333 |
|
|
1334 |
switch ($A) { |
switch ($A) { |
1350 |
// listing of $relDir/$F |
// listing of $relDir/$F |
1351 |
DisplayCode($gblFsRoot, $relDir, $F) ; |
DisplayCode($gblFsRoot, $relDir, $F) ; |
1352 |
exit ; |
exit ; |
1353 |
|
case "Co" : |
1354 |
|
// checkout |
1355 |
|
Lock("$gblFsRoot/$relDir/$F"); |
1356 |
|
Header("Location: ".urlpath("$relDir/$F")); |
1357 |
|
exit; |
1358 |
|
case "Ci" : |
1359 |
|
// upload && update to $relDir |
1360 |
|
if (!is_writeable($gblFsRoot . $relDir)) |
1361 |
|
Error("Write access denied",$relDir) ; |
1362 |
|
$text = "Use this page to update a single " ; |
1363 |
|
$text .= "file to <B>$SERVER_NAME</B>." ; |
1364 |
|
StartHTML("(Update file Page)", $text) ; |
1365 |
|
UploadPage($gblFsRoot, $relDir, $F) ; |
1366 |
|
EndHTML() ; |
1367 |
|
exit ; |
1368 |
|
case "V" : |
1369 |
|
// view |
1370 |
|
LogIt("$gblFsRoot/$relDir/$F","viewed"); |
1371 |
|
Header("Location: ".urlpath("$relDir/$F")); |
1372 |
|
exit; |
1373 |
} |
} |
1374 |
|
|
1375 |
// default: display directory $relDir |
// default: display directory $relDir |