25 |
// from where to include auth_*.php modules? |
// from where to include auth_*.php modules? |
26 |
$gblIncDir = "/data/docman2"; |
$gblIncDir = "/data/docman2"; |
27 |
|
|
28 |
// force download (so it won't open in associated application) |
// force download on view (so it won't open in associated application) |
29 |
$gblForceDownload = 1; |
$gblForceDownload = 0; |
30 |
|
|
31 |
// date format |
// date format |
32 |
$gblDateFmt="Y-m-d"; |
$gblDateFmt="Y-m-d"; |
84 |
LoadLanguage($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]); |
LoadLanguage($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]); |
85 |
|
|
86 |
// for security and configuration |
// for security and configuration |
87 |
$realm="$HTTP_HOST"; // FIX |
$realm=$HTTP_SERVER_VARS[HTTP_HOST]; |
88 |
|
|
89 |
$fsDocumentRoot = dirname($HTTP_SERVER_VARS[SCRIPT_FILENAME]); |
$fsDocumentRoot = dirname($HTTP_SERVER_VARS[SCRIPT_FILENAME]); |
90 |
if ($fsDocumentRoot == "") Error("Configuration error","Can't get SCRIPT_FILENAME from your web server. Please set <tt>\$fsDocumentRoot</tt> in <tt>\$</tt>"); |
if ($fsDocumentRoot == "") Error("Configuration error","Can't get SCRIPT_FILENAME from your web server. Please set <tt>\$fsDocumentRoot</tt> in <tt>\$</tt>",1); |
91 |
|
|
92 |
// globals for later |
// globals for later |
93 |
$gblLogin = $PHP_AUTH_USER; |
$gblLogin = $HTTP_SERVER_VARS[PHP_AUTH_USER]; |
94 |
$gblPasswd = $PHP_AUTH_PW; |
$gblPasswd = $HTTP_SERVER_VARS[PHP_AUTH_PW]; |
95 |
|
|
96 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
97 |
|
|
109 |
|
|
110 |
function StartHTML($title,$text="") { |
function StartHTML($title,$text="") { |
111 |
|
|
112 |
global $html,$fsDocumentRoot; |
global $html,$fsDocumentRoot,$HTTP_SERVER_VARS; |
113 |
|
|
114 |
$title = $gblTitle." ".$title ; |
$title = $gblTitle." ".$title ; |
115 |
$host = $GLOBALS["HTTP_HOST"] ; |
$host = $HTTP_SERVER_VARS["HTTP_HOST"] ; |
116 |
$self = $GLOBALS["PHP_SELF"] ; |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
117 |
|
|
118 |
if (file_exists("$fsDocumentRoot/docman.css")) { |
if (file_exists("$fsDocumentRoot/docman.css")) { |
119 |
$css=dirname($self)."/docman.css"; |
$css=dirname($self)."/docman.css"; |
120 |
} else { |
} else { |
121 |
$css=$self."?STYLE=get&css=$css"; |
$css=$self."?STYLE=get"; |
122 |
} |
} |
123 |
|
|
124 |
include("$html/head.html"); |
include("$html/head.html"); |
145 |
$url_title="relogin"; |
$url_title="relogin"; |
146 |
} |
} |
147 |
include("$html/footer.html"); |
include("$html/footer.html"); |
|
//phpinfo(); |
|
148 |
} // end function EndHTML |
} // end function EndHTML |
149 |
|
|
150 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
151 |
|
|
152 |
function DetailPage($fsRoot,$relDir,$fn) { |
function DetailPage($fsRoot,$relDir,$fn) { |
153 |
|
|
154 |
global $gblEditable, $gblImages, $webRoot, $html ; |
global $gblEditable, $gblImages, $webRoot, $html, $HTTP_SERVER_VARS ; |
155 |
$self = $GLOBALS["PHP_SELF"] ; |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
156 |
|
|
157 |
$relPath = $relDir . "/" . $fn ; |
$relPath = $relDir . "/" . $fn ; |
158 |
$fsPath = $fsRoot . $relPath ; |
$fsPath = $fsRoot . $relPath ; |
165 |
$file_lock = CheckLock($fsPath); |
$file_lock = CheckLock($fsPath); |
166 |
|
|
167 |
if (!$editable && !$exists) |
if (!$editable && !$exists) |
168 |
Error(_("Creation unsupported for type"),$relPath) ; |
Error("Creation unsupported for type",$relPath) ; |
169 |
if (!exists && !is_writeable($fsDir) ) |
if (!exists && !is_writeable($fsDir) ) |
170 |
Error(_("Creation denied"),$relDir) ; |
Error("Creation denied",$relDir) ; |
171 |
|
|
172 |
$text = _("Use this page to view, modify or ") ; |
$text = _("Use this page to view, modify or ") ; |
173 |
if (is_dir($fsPath)) { |
if (is_dir($fsPath)) { |
571 |
function Navigate($fsRoot,$relDir) { |
function Navigate($fsRoot,$relDir) { |
572 |
|
|
573 |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
574 |
$HTTP_GET_VARS, $html; |
$gblIgnoreUnknownFileType, $gblRepositoryDir, |
575 |
|
$fsRealmDir, $realm, $realm_sep, |
576 |
|
$HTTP_GET_VARS, $html, $realm_config; |
577 |
|
|
578 |
$self = $GLOBALS["PHP_SELF"] ; |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
579 |
|
|
580 |
if ($relDir == "") $relDir = "/"; |
if ($relDir == "") $relDir = "/"; |
581 |
|
|
585 |
|
|
586 |
$hide_items=",$gblHide,"; |
$hide_items=",$gblHide,"; |
587 |
|
|
|
#display_all_trustee(); |
|
|
print "-- $fsDir --"; |
|
|
|
|
588 |
// read directory contents |
// read directory contents |
589 |
if ( !($dir = @opendir($fsDir)) ) |
if ( !($dir = @opendir($fsDir)) ) |
590 |
Error("Read Access denied",$relDir) ; |
Error("Read Access denied",$relDir,1) ; |
591 |
while ($item = readdir($dir)) { |
while ($item = readdir($dir)) { |
|
print "$item, "; |
|
592 |
if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") ) continue ; |
if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") ) continue ; |
593 |
if ((is_dir($fsDir.$item) || is_link ($fsDir.$item)) && check_perm($relDir.$item,trperm_b)) { |
if (is_dir($fsDir.$item) || is_link ($fsDir.$item)) { |
594 |
$dirList[$item] = $item ; |
if (check_perm($relDir.$item,trperm_b)) { |
595 |
$dirNote[$item] = ReadNote($fsDir.$item); |
$dirList[$item] = $item ; |
596 |
} else if ( is_file($fsDir.$item) && check_perm($relDir.$item,trperm_r) ) { |
$dirNote[$item] = ReadNote($fsDir.$item); |
597 |
$fileList[$item] = $item ; |
} |
598 |
$fileDate[$item] = filemtime($fsDir.$item) ; |
} else if (is_file($fsDir.$item)) { |
599 |
$fileSize[$item] = filesize($fsDir.$item) ; |
if (check_perm($relDir.$item,trperm_r)) { |
600 |
$fileNote[$item] = ReadNote($fsDir.$item); |
$fileList[$item] = $item ; |
601 |
|
$fileDate[$item] = filemtime($fsDir.$item) ; |
602 |
|
$fileSize[$item] = filesize($fsDir.$item) ; |
603 |
|
$fileNote[$item] = ReadNote($fsDir.$item); |
604 |
|
} |
605 |
} else { |
} else { |
606 |
// unknown file type |
if (! $gblIgnoreUnknownFileType) Error("File Type Error", "Item <tt>".$fsDir.$item."</tt> is not file, directory or link. If you want to ignore errors like this, set <tt>\$gblIgnoreUnknownFileType = 1</tt> in <tt>$realm_config</tt>.",1); |
|
// $text = "Could not determine file type of " ; |
|
|
// Error("File Error", $text.$relDir."/".$item) ; |
|
|
// exit ; |
|
607 |
} |
} |
608 |
} |
} |
609 |
closedir($dir) ; |
closedir($dir) ; |
610 |
|
|
611 |
// scan deleted files |
// scan deleted files |
612 |
if ( $GLOBALS[show_deleted] == 1 && ($dir = @opendir("$fsDir/.del")) ) { |
if ( $HTTP_GET_VARS["show_deleted"] == 1 && ($dir = @opendir("$fsDir/.del")) ) { |
613 |
while ($item = readdir($dir)) { |
while ($item = readdir($dir)) { |
614 |
if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") || !check_perm($relDir.$item,trperm_w) ) continue ; |
if ( substr($item,0,1) == "." || strstr($hide_items,",$item,") || !check_perm($relDir.$item,trperm_w) ) continue ; |
615 |
$fileList[$item] = ".del/$item" ; |
$fileList[$item] = ".del/$item" ; |
624 |
|
|
625 |
// start navigation page |
// start navigation page |
626 |
$text = "Use this page to add, delete"; |
$text = "Use this page to add, delete"; |
627 |
if (! isset($show_deleted)) { |
if (! isset($HTTP_GET_VARS[show_deleted])) { |
628 |
$text .= ", <a href=$self?D=".urlencode($relDir)."&show_deleted=1>undelete</a>"; |
$text .= ", <a href=$self?D=".urlencode($relDir)."&show_deleted=1>undelete</a>"; |
629 |
} |
} |
630 |
$text .= " or revise files on this web site." ; |
$text .= " or revise files on this web site." ; |
713 |
|
|
714 |
$dir = $dirList[$key]; |
$dir = $dirList[$key]; |
715 |
|
|
716 |
$info_url=self_args(array("A" => "A=E", "F" => "F=".urlencode($dir))); |
$info_url=self_args(array("A"=>"A=E", "F"=>"F=".urlencode($dir), "D"=>$D)); |
717 |
$dir_url=$self."?D=".urlencode($relDir.$dir); |
$dir_url=$self."?D=".urlencode($relDir."/".$dir); |
718 |
include("$html/Navigate-dirEntry.html"); |
include("$html/Navigate-dirEntry.html"); |
719 |
|
|
720 |
} // iterate over dirs |
} // iterate over dirs |
786 |
|
|
787 |
$file_lock=CheckLock($path); |
$file_lock=CheckLock($path); |
788 |
|
|
789 |
$file_url_html="<A HREF=\"$self?A=V&F=".urlencode($file); |
$file_url_html="<A HREF=\"$self?A=V&D=".urlencode($relDir)."&F=".urlencode($file); |
|
$file_url_html.="&D=".urlencode($relDir); |
|
790 |
$file_url_html.="\" TITLE=\"View file\">" ; |
$file_url_html.="\" TITLE=\"View file\">" ; |
791 |
|
|
792 |
if (substr($file,0,5) != ".del/") { |
if (substr($file,0,5) != ".del/") { |
801 |
|
|
802 |
if ($file_lock) { |
if ($file_lock) { |
803 |
if ($file_lock == $GLOBALS[gblUserName]) { |
if ($file_lock == $GLOBALS[gblUserName]) { |
804 |
$b.="<A HREF=\"$self?A=Ci&F=".urlencode($file); |
$b.="<A HREF=\"$self?A=Ci&D=".urlencode($relDir)."&F=".urlencode($file); |
|
$b.="&D=".urlencode($relDir); |
|
805 |
$b.="\" TITLE=\"Checkin (update) file on server\">" ; |
$b.="\" TITLE=\"Checkin (update) file on server\">" ; |
806 |
$file_url_html=$b; |
$file_url_html=$b; |
807 |
$b.=$gblIcon("checkin")."</A>" ; |
$b.=$gblIcon("checkin")."</A>" ; |
815 |
$file_url_html = "$file $a"; |
$file_url_html = "$file $a"; |
816 |
} |
} |
817 |
} else { |
} else { |
818 |
$b.="<A HREF=\"$self?A=Co&F=".urlencode($file); |
$b.="<A HREF=\"$self?A=Co&D=".urlencode($relDir)."&F=".urlencode($file); |
|
$b.="&D=".urlencode($relDir); |
|
819 |
$b.="\" TITLE=\"Checkout file for edit\">" ; |
$b.="\" TITLE=\"Checkout file for edit\">" ; |
820 |
$b.=$gblIcon("checkout")."</A>" ; |
$b.=$gblIcon("checkout")."</A>"; |
821 |
|
|
822 |
if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) { |
if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) { |
823 |
$b.="<A HREF=\"$self?A=C&F=".urlencode($file); |
$b.="<A HREF=\"$self?A=C&D=".urlencode($relDir)."&F=".urlencode($file); |
|
$b.="&D=".urlencode($relDir); |
|
824 |
$b.="\" TITLE=\"List contents\">" ; |
$b.="\" TITLE=\"List contents\">" ; |
825 |
$b.=$gblIcon("view")."</A>" ; |
$b.=$gblIcon("view")."</A>" ; |
826 |
} else { |
} else { |
860 |
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR> |
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR> |
861 |
|
|
862 |
<? |
<? |
863 |
if (file_exists(".info.inc")) { |
|
864 |
|
if (file_exists("$fsRealmDir/$realm".$realm_sep."info.inc")) { |
865 |
|
print "<TR><TD></TD><TD COLSPAN=5>"; |
866 |
|
include("$fsRealmDir/$realm".$realm_sep."info.inc"); |
867 |
|
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
868 |
|
} elseif (file_exists("$gblRepositoryDir/.info.inc")) { |
869 |
print "<TR><TD></TD><TD COLSPAN=5>"; |
print "<TR><TD></TD><TD COLSPAN=5>"; |
870 |
include(".info.inc"); |
include("$gblRepositoryDir/.info.inc"); |
871 |
print "</TD></TR> |
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
|
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
|
872 |
} |
} |
873 |
|
|
874 |
|
|
875 |
?> |
?> |
876 |
|
|
877 |
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
896 |
|
|
897 |
function UploadPage($fsRoot, $relDir, $filename="") { |
function UploadPage($fsRoot, $relDir, $filename="") { |
898 |
|
|
899 |
$self = $GLOBALS["PHP_SELF"] ; |
global $html, $HTTP_SERVER_VARS; |
900 |
|
|
901 |
|
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
902 |
if ($relDir == "") $relDir = "/" ; |
if ($relDir == "") $relDir = "/" ; |
|
?> |
|
903 |
|
|
904 |
<P><TABLE BORDER=0 CELLPADDING=5><TR><TD WIDTH=5></TD><TD CLASS=BAR> |
include("$html/UploadPage.html"); |
|
<FORM ENCTYPE="multipart/form-data" METHOD="POST" |
|
|
ACTION="<?= $self ?>"> |
|
|
DESTINATION DIRECTORY:<B><?= " " . $relDir ?></B> |
|
|
<? if (isset($filename) && $filename!="") { ?> |
|
|
<br>DESTINATION FILE:<B><?= " " . $filename ?></B> |
|
|
<INPUT TYPE="HIDDEN" NAME="FILENAME" VALUE="<?= $filename ?>"> |
|
|
<? } ?> |
|
|
<P>PATHNAME OF LOCAL FILE<BR> |
|
|
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"> |
|
|
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="UPLOAD"> |
|
|
<INPUT SIZE=30 TYPE="FILE" NAME="FN"></P> |
|
|
<P><INPUT TYPE="SUBMIT" VALUE="UPLOAD"></P> |
|
|
<P>If the <B>[BROWSE...]</B> button is not displayed,<BR> |
|
|
you must upgrade to an RFC1867-compliant browser.</P> |
|
|
<P>Your browser:<BR><?= $GLOBALS["HTTP_USER_AGENT"] ?></P> |
|
|
</FORM> |
|
|
</TD></TR> |
|
|
<TR><TD></TD><TD> |
|
|
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
|
|
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"><BR> |
|
|
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"> |
|
|
</FORM> |
|
|
</TD></TR></TABLE></P> |
|
905 |
|
|
|
<?php |
|
906 |
} // end function UploadPage |
} // end function UploadPage |
907 |
|
|
908 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
909 |
|
|
910 |
function Error($title,$text="") { |
// Error with sysadmin flag are reported to error_log or hidden from |
911 |
StartHTML("(".$title.")",$text) ; |
// users |
912 |
echo "<P ALIGN=center>Hit your Browser's Back Button.</P>" ; |
|
913 |
EndHTML() ; |
function Error($title,$text="",$sysadmin=0,$no_404=0) { |
914 |
|
global $gblSeparateAdminMessages, |
915 |
|
$gblMailAdminMessages,$realm, |
916 |
|
$HTTP_SERVER_VARS; |
917 |
|
if (! headers_sent() && ! $no_404) header("HTTP/1.0 404 Not Found"); |
918 |
|
if ($sysadmin) { |
919 |
|
if ($gblSeparateAdminMessages) { |
920 |
|
$user="Your administrator "; |
921 |
|
if ($gblMailAdminMessages) { |
922 |
|
mail($HTTP_SERVER_VARS["SERVER_ADMIN"], "docman $realm error message: $title", strip_tags($text)); |
923 |
|
$user.="<tt>".$HTTP_SERVER_VARS["SERVER_ADMIN"]."</tt> "; |
924 |
|
} |
925 |
|
$user.="has been notified about error" ; |
926 |
|
StartHTML("($title)",$user); |
927 |
|
echo "<P ALIGN=center>Hit your Browser's Back Button.</P>" ; |
928 |
|
EndHTML(); |
929 |
|
error_log("docman $realm: ".strip_tags($text)); |
930 |
|
} else { |
931 |
|
StartHTML("ADMIN: ".$title,$text) ; |
932 |
|
echo "<P ALIGN=center>Hit your Browser's Back Button.</P>" ; |
933 |
|
EndHTML(); |
934 |
|
} |
935 |
|
} else { |
936 |
|
StartHTML("(".$title.")",$text) ; |
937 |
|
echo "<P ALIGN=center>Hit your Browser's Back Button.</P>" ; |
938 |
|
EndHTML() ; |
939 |
|
} |
940 |
exit ; |
exit ; |
941 |
} // end function Error |
} // end function Error |
942 |
|
|
943 |
////////////////////////////////////////////////////////////////// |
function LogIt($target,$msg, $changelog=0) { |
|
|
|
|
function LogIt($target,$msg) { |
|
944 |
|
|
945 |
$dir=dirname($target); |
$dir=dirname($target); |
946 |
if (! file_exists($dir."/.log")) { |
if (! file_exists($dir."/.log")) { |
947 |
if (! @mkdir($dir."/.log",0700)) Error("docman installation problem","can't create log directory <tt>$dir/.log</tt>"); |
if (! @mkdir($dir."/.log",0700)) Error("docman installation problem","can't create log directory <tt>$dir/.log</tt>",1); |
948 |
} |
} |
949 |
$file=basename($target); |
$file=basename($target); |
950 |
|
|
953 |
"\t$GLOBALS[gblUserName]\t$msg\n"); |
"\t$GLOBALS[gblUserName]\t$msg\n"); |
954 |
fclose($log); |
fclose($log); |
955 |
|
|
956 |
|
if (! $changelog) return; |
957 |
|
|
958 |
|
global $gblFsRoot; |
959 |
|
$log=fopen("$gblFsRoot/.changelog","a+"); |
960 |
|
if (substr($target,0,strlen($gblFsRoot)) == $gblFsRoot) |
961 |
|
$target=substr($target,strlen($gblFsRoot),strlen($target)-strlen($gblFsRoot)); |
962 |
|
$msg=str_replace("\t"," ",$msg); |
963 |
|
fputs($log,time()."\t$target\t$GLOBALS[gblUserName]\t$msg\n"); |
964 |
|
fclose($log); |
965 |
|
|
966 |
|
// FIX: implement e-mail notification based on $changelog |
967 |
|
// permission |
968 |
} |
} |
969 |
|
|
970 |
|
|
983 |
fputs($note,"$msg\n"); |
fputs($note,"$msg\n"); |
984 |
fclose($note); |
fclose($note); |
985 |
|
|
986 |
Logit($target,"added note $msg"); |
LogIt($target,"added note $msg"); |
987 |
|
|
988 |
} |
} |
989 |
|
|
1028 |
$file=basename($target); |
$file=basename($target); |
1029 |
|
|
1030 |
if (file_exists("$dir/.lock/$file")) { |
if (file_exists("$dir/.lock/$file")) { |
1031 |
Logit($target,"attempt to locked allready locked file!"); |
LogIt($target,"attempt to locked allready locked file!"); |
1032 |
} else { |
} else { |
1033 |
$lock=fopen("$dir/.lock/$file","w"); |
$lock=fopen("$dir/.lock/$file","w"); |
1034 |
fputs($lock,"$GLOBALS[gblUserName]\n"); |
fputs($lock,"$GLOBALS[gblUserName]\n"); |
1035 |
fclose($lock); |
fclose($lock); |
1036 |
|
|
1037 |
Logit($target,"file locked"); |
LogIt($target,"file locked"); |
1038 |
} |
} |
1039 |
|
|
1040 |
} |
} |
1061 |
$file=basename($target); |
$file=basename($target); |
1062 |
if (file_exists($dir."/.lock/$file")) { |
if (file_exists($dir."/.lock/$file")) { |
1063 |
unlink("$dir/.lock/$file"); |
unlink("$dir/.lock/$file"); |
1064 |
Logit($target,"file unlocked"); |
LogIt($target,"file unlocked"); |
1065 |
} else { |
} else { |
1066 |
Logit($target,"attempt to unlocked non-locked file!"); |
LogIt($target,"attempt to unlocked non-locked file!"); |
1067 |
} |
} |
1068 |
|
|
1069 |
} |
} |
1083 |
function try_rename($from,$to) { |
function try_rename($from,$to) { |
1084 |
# print "$from -> $to\n"; |
# print "$from -> $to\n"; |
1085 |
if (file_exists($from) && is_writeable(dirname($to))) { |
if (file_exists($from) && is_writeable(dirname($to))) { |
1086 |
rename($from,$to); |
return rename($from,$to); |
1087 |
|
} else { |
1088 |
|
return 0; |
1089 |
} |
} |
1090 |
} |
} |
1091 |
|
|
1092 |
function try_dir($todir) { |
function try_dir($todir) { |
1093 |
if (! file_exists($todir)) { |
if (! file_exists($todir)) { |
1094 |
mkdir($todir,0700); |
@mkdir($todir,0700); |
1095 |
} |
} |
1096 |
} |
} |
1097 |
|
|
1101 |
|
|
1102 |
# print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n"; |
# print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n"; |
1103 |
|
|
1104 |
try_rename("$fromdir/$fromfile","$todir/$tofile"); |
if (! try_rename("$fromdir/$fromfile","$todir/$tofile")) Error("Rename error","Can't rename file <tt>$fromfile</tt> to <tt>$tofile</tt>",1); |
1105 |
try_dir("$todir/.log"); |
try_dir("$todir/.log"); |
1106 |
try_rename("$fromdir/.log/$fromfile","$todir/.log/$tofile"); |
try_rename("$fromdir/.log/$fromfile","$todir/.log/$tofile"); |
1107 |
try_dir("$todir/.note"); |
try_dir("$todir/.note"); |
1135 |
|
|
1136 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1137 |
|
|
|
function ChangeLog($target,$msg) { |
|
|
|
|
|
global $gblFsRoot; |
|
|
$log=fopen("$gblFsRoot/.changelog","a+"); |
|
|
if (substr($target,0,strlen($gblFsRoot)) == $gblFsRoot) |
|
|
$target=substr($target,strlen($gblFsRoot),strlen($target)-strlen($gblFsRoot)); |
|
|
$msg=str_replace("\t"," ",$msg); |
|
|
fputs($log,time()."\t$target\t$GLOBALS[gblUserName]\t$msg\n"); |
|
|
fclose($log); |
|
|
|
|
|
} |
|
|
|
|
1138 |
function DisplayChangeLog($day) { |
function DisplayChangeLog($day) { |
1139 |
|
|
1140 |
global $gblFsRoot; |
global $gblFsRoot,$HTTP_SERVER_VARS; |
1141 |
|
|
1142 |
if (!file_exists("$gblFsRoot/.changelog")) return; |
if (!file_exists("$gblFsRoot/.changelog")) return; |
1143 |
$log=fopen("$gblFsRoot/.changelog","r"); |
$log=fopen("$gblFsRoot/.changelog","r"); |
1144 |
$logarr = array(); |
$logarr = array(); |
1160 |
$time = date("$GLOBALS[gblTimeFmt]", $e[0]); |
$time = date("$GLOBALS[gblTimeFmt]", $e[0]); |
1161 |
$dir = dirname($e[1]); |
$dir = dirname($e[1]); |
1162 |
$file = basename($e[1]); |
$file = basename($e[1]); |
1163 |
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"; |
print "<tr><td$cl>$date</td><td$cl>$time</td><td$cl><a href=\"$HTTP_SERVER_VARS[PHP_SELF]?D=".urlencode($dir)."\">$dir</a>/$file</td><td$cl>$e[2]</td><td$cl>$e[3]</td></tr>\n"; |
1164 |
} |
} |
1165 |
print "</table>"; |
print "</table>"; |
1166 |
print "<p>".GifIcon(up)." Back to <a href=$GLOBALS[PHP_SELF]>front page</a>.</p>"; |
print "<p>".GifIcon(up)." Back to <a href=$HTTP_SERVER_VARS[PHP_SELF]>front page</a>.</p>"; |
1167 |
} |
} |
1168 |
|
|
1169 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1170 |
|
|
1171 |
function Download($path) { |
function Download($path,$force=0) { |
1172 |
global $HTTP_USER_AGENT; |
global $HTTP_SERVER_VARS,$mime_type; |
1173 |
$file=basename($path); |
|
1174 |
|
// default transfer-encoding |
1175 |
|
$encoding = "binary"; |
1176 |
|
|
1177 |
|
// known transfer encodings |
1178 |
|
$encoding_ext = array( |
1179 |
|
"gz" => "x-gzip", |
1180 |
|
"Z" => "x-compress", |
1181 |
|
); |
1182 |
|
|
1183 |
|
$file = basename($path); |
1184 |
$size = filesize($path); |
$size = filesize($path); |
1185 |
//header("Content-Type: application/octet-stream"); |
|
1186 |
header("Content-Type: application/force-download"); |
$ext_arr = explode(".",$file); |
1187 |
header("Content-Length: $size"); |
$ext = array_pop($ext_arr); |
1188 |
|
if ($encoding_ext[$ext]) { |
1189 |
|
$encoding = $encoding_ext[$ext]; |
1190 |
|
$ext = array_pop($ext_arr); |
1191 |
|
} |
1192 |
|
|
1193 |
|
if ($force || !isset($mime_type[$ext])) { |
1194 |
|
header("Content-Type: application/force-download"); |
1195 |
|
} else { |
1196 |
|
header("Content-Type: $mime_type[$ext]"); |
1197 |
|
} |
1198 |
|
|
1199 |
// IE5.5 just downloads index.php if we don't do this |
// IE5.5 just downloads index.php if we don't do this |
1200 |
if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) { |
if(preg_match("/MSIE 5.5/", $HTTP_SERVER_VARS[HTTP_USER_AGENT])) { |
1201 |
header("Content-Disposition: filename=$file"); |
header("Content-Disposition: filename=$file"); |
1202 |
} else { |
} else { |
1203 |
header("Content-Disposition: attachment; filename=$file"); |
header("Content-Disposition: attachment; filename=$file"); |
1204 |
} |
} |
1205 |
header("Content-Transfer-Encoding: binary"); |
|
1206 |
|
header("Content-Transfer-Encoding: $encoding"); |
1207 |
$fh = fopen($path, "r"); |
$fh = fopen($path, "r"); |
1208 |
fpassthru($fh); |
fpassthru($fh); |
1209 |
} |
} |
1293 |
$groups_arr = array(); |
$groups_arr = array(); |
1294 |
$perm_arr = array(); |
$perm_arr = array(); |
1295 |
|
|
|
$error=0; |
|
|
|
|
1296 |
$tr_arr = array(); |
$tr_arr = array(); |
1297 |
|
|
1298 |
while (! feof($fp_conf)) { |
while (! feof($fp_conf)) { |
1360 |
} |
} |
1361 |
|
|
1362 |
if ($error) { |
if ($error) { |
1363 |
Error("Trustee error",$error); |
Error("Trustee error",$error,1); |
1364 |
} else { |
} else { |
1365 |
include("$trustee_php"); |
include("$trustee_php"); |
1366 |
} |
} |
1450 |
return($return); |
return($return); |
1451 |
} |
} |
1452 |
|
|
1453 |
|
////////////////////////////////////////////////////////////////// |
1454 |
|
|
1455 |
|
function readMime() { |
1456 |
|
global $mime_type; |
1457 |
|
|
1458 |
|
if (! isset($gblMimeTypes)) { |
1459 |
|
$gblMimeTypes = "/etc/mime.types"; |
1460 |
|
} |
1461 |
|
|
1462 |
|
$mime = @fopen($gblMimeTypes,"r"); |
1463 |
|
|
1464 |
|
if (! $mime) Error("Can't read MIME types","<tt>$gblMimeTypes</tt> file not found. You can setup other <tt>mime.types</tt> file using <tt>\$gblMimeTypes</tt> in <tt>$realm_config</tt>"); |
1465 |
|
|
1466 |
|
while($line = fgets($mime,80)) { |
1467 |
|
if (substr($line,0,1) == "#") continue; // skip comment |
1468 |
|
$arr = preg_split("/[\s\t]+/",$line); |
1469 |
|
$type = array_shift($arr); |
1470 |
|
while ($ext = array_shift($arr)) { |
1471 |
|
$mime_type[$ext] = $type; |
1472 |
|
} |
1473 |
|
} |
1474 |
|
|
1475 |
|
fclose($mime); |
1476 |
|
} |
1477 |
|
|
1478 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1479 |
// MAIN PROGRAM |
// MAIN PROGRAM |
1481 |
$gblFilePerms = 0640 ; // default for new files |
$gblFilePerms = 0640 ; // default for new files |
1482 |
$gblDirPerms = 0750 ; // default for new dirs |
$gblDirPerms = 0750 ; // default for new dirs |
1483 |
|
|
1484 |
|
$STYLE = $HTTP_GET_VARS[STYLE]; |
1485 |
if (isset($STYLE) && $STYLE == "get") { |
if (isset($STYLE) && $STYLE == "get") { |
1486 |
include("$html/docman.css"); |
include("$html/docman.css"); |
1487 |
exit; |
exit; |
1500 |
if (! isset($fsRealmDir)) { |
if (! isset($fsRealmDir)) { |
1501 |
$fsRealmDir = "$gblIncDir/realm"; |
$fsRealmDir = "$gblIncDir/realm"; |
1502 |
} |
} |
1503 |
$realm_config = "$fsRealmDir/$realm.conf"; |
|
1504 |
|
// try to add dir to script name to realm var |
1505 |
|
if (is_dir("$fsRealmDir/$realm/".dirname($HTTP_SERVER_VARS[SCRIPT_NAME]))) { |
1506 |
|
$realm .= "/".dirname($HTTP_SERVER_VARS[SCRIPT_NAME]); |
1507 |
|
$realm_sep = "/"; |
1508 |
|
} else { |
1509 |
|
$realm_sep = "."; |
1510 |
|
} |
1511 |
|
|
1512 |
|
$realm_config = $fsRealmDir."/".$realm.$realm_sep."conf"; |
1513 |
|
|
1514 |
// read user-defined configuration |
// read user-defined configuration |
1515 |
if (file_exists($realm_config)) { |
if (file_exists($realm_config)) { |
1542 |
exit ; |
exit ; |
1543 |
} |
} |
1544 |
|
|
1545 |
|
if (!is_dir($gblRepositoryDir)) Error("Repository dir not found","Can't find repository directory <tt>$gblRepositoryDir</tt>. Please fix that in <tt>$realm_config</tt> variable <tt>\$gblRepositoryDir</tt>.",1); |
1546 |
|
|
1547 |
// trustee (ACL) file configuration |
// trustee (ACL) file configuration |
1548 |
$trustee_conf="$gblIncDir/realm/$realm.trustee"; |
$trustee_conf="$fsRealmDir/$realm".$realm_sep."trustee"; |
1549 |
// compiled version of trustee file |
// compiled version of trustee file |
1550 |
$trustee_php="$gblRepositoryDir/.trustee.php"; |
$trustee_php="$gblRepositoryDir/.trustee.php"; |
1551 |
// get ACL informations |
// get ACL informations |
1566 |
isset($relogin) && $secHash == $relogin) { |
isset($relogin) && $secHash == $relogin) { |
1567 |
header("WWW-authenticate: basic realm=\"$realm\"") ; |
header("WWW-authenticate: basic realm=\"$realm\"") ; |
1568 |
header("HTTP/1.0 401 Unauthorized") ; |
header("HTTP/1.0 401 Unauthorized") ; |
1569 |
Error("401 Unauthorized","No trespassing !"); |
Error("401 Unauthorized","No trespassing !",0,1); |
|
exit ; |
|
1570 |
} |
} |
1571 |
|
|
1572 |
|
// read mime.types |
1573 |
|
readMime(); |
1574 |
|
|
1575 |
// get current directory relative to $gblFsRoot |
// get current directory relative to $gblFsRoot |
1576 |
$relDir = $DIR ; // from POST |
$relDir = $DIR ; // from POST |
1577 |
if ($relDir == "") { // not defined in POST ? |
if ($relDir == "") { // not defined in POST ? |
1600 |
$fsDir = $gblFsRoot . $relDir ; // current directory |
$fsDir = $gblFsRoot . $relDir ; // current directory |
1601 |
if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ; |
if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ; |
1602 |
|
|
1603 |
if (isset($GLOBALS["HTTPS"]) && $GLOBALS["HTTPS"] == "on") { |
if (isset($HTTP_SERVER_VARS["HTTPS"]) && $HTTP_SERVER_VARS["HTTPS"] == "on") { |
1604 |
$webRoot = "https://"; |
$webRoot = "https://"; |
1605 |
} else { |
} else { |
1606 |
$webRoot = "http://"; |
$webRoot = "http://"; |
1607 |
} |
} |
1608 |
$webRoot .= $GLOBALS["HTTP_HOST"] . $relScriptDir; |
$webRoot .= $HTTP_SERVER_VARS["HTTP_HOST"] . $relScriptDir; |
1609 |
|
|
1610 |
$FN=stripSlashes($FN); |
// take variables from server |
1611 |
|
$FN=stripSlashes($HTTP_POST_VARS["FN"]); |
1612 |
|
$DIR=stripSlashes($HTTP_POST_VARS["DIR"]); |
1613 |
|
$RELPATH=stripSlashes($HTTP_POST_VARS["RELPATH"]); |
1614 |
|
$T=stripSlashes($HTTP_POST_VARS["T"]); |
1615 |
|
$CONFIRM=stripSlashes($HTTP_POST_VARS["CONFIRM"]); |
1616 |
|
|
1617 |
|
// get |
1618 |
|
$A=stripSlashes($HTTP_GET_VARS["A"]); |
1619 |
|
$D=stripSlashes($HTTP_GET_VARS["D"]); |
1620 |
|
|
1621 |
|
// if (isset($F)) Error("Document manager system error","variable $F shouldn't be set here (re-check old code)",1); |
1622 |
|
// $F=stripSlashes($HTTP_SERVER_VARS["PATH_INFO"]); |
1623 |
|
$F=stripSlashes($HTTP_GET_VARS["F"]); |
1624 |
|
|
1625 |
switch ($POSTACTION) { |
switch ($HTTP_POST_VARS["POSTACTION"]) { |
1626 |
case "UPLOAD" : |
case "UPLOAD" : |
1627 |
|
$FN_name=stripSlashes($HTTP_POST_FILES["FN"]["tmp_name"]); |
1628 |
|
$FN=stripSlashes($HTTP_POST_FILES["FN"]["name"]); |
1629 |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
1630 |
if (strstr($FN_name,"/")) |
|
1631 |
Error("Non-conforming filename") ; |
$source = $FN_name ; |
|
// TODO : should rather check for escapeshellcmds |
|
|
// but maybe RFC 18xx asserts safe filenames .... |
|
|
$source = $FN ; |
|
1632 |
if (! file_exists($source)) { |
if (! file_exists($source)) { |
1633 |
Error("You must select file with browse to upload it!"); |
Error("You must select file with browse to upload it!"); |
1634 |
} |
} |
1635 |
|
|
1636 |
|
$FILENAME = $HTTP_POST_VARS["FILENAME"]; |
1637 |
|
if (strstr($FILENAME,"/")) |
1638 |
|
Error("Upload error","Non-conforming filename. Filename <tt>$FILENAME</tt> has slashes (<tt>/</tt>) in it.") ; |
1639 |
if (! isset($FILENAME)) { // from update file |
if (! isset($FILENAME)) { // from update file |
1640 |
$target = "$fsDir/$FN_name" ; |
$target = "$fsDir/".basename($FN); |
1641 |
} else { |
} else { |
1642 |
$target = "$fsDir/$FILENAME"; |
$target = "$fsDir/$FILENAME"; |
1643 |
} |
} |
1659 |
copy($source,$target) ; |
copy($source,$target) ; |
1660 |
chmod($target,$gblFilePerms) ; |
chmod($target,$gblFilePerms) ; |
1661 |
clearstatcache() ; |
clearstatcache() ; |
|
Logit($target,"uploaded"); |
|
1662 |
if (isset($FILENAME)) { |
if (isset($FILENAME)) { |
1663 |
|
LogIt($target,"check-in",trperm_r | trperm_w); |
1664 |
Unlock($target); |
Unlock($target); |
1665 |
|
} else { |
1666 |
|
LogIt($target,"uploaded",trperm_r | trperm_w); |
1667 |
} |
} |
|
ChangeLog($target,"updated"); |
|
1668 |
break ; |
break ; |
1669 |
|
|
1670 |
case "SAVE" : |
case "SAVE" : |
1681 |
fwrite($fh,$FILEDATA) ; |
fwrite($fh,$FILEDATA) ; |
1682 |
fclose($fh) ; |
fclose($fh) ; |
1683 |
clearstatcache() ; |
clearstatcache() ; |
1684 |
Logit($path,"saved changes"); |
LogIt($path,"saved changes",trperm_r); |
|
ChangeLog($path,"saved changes"); |
|
1685 |
break ; |
break ; |
1686 |
|
|
1687 |
case "CREATE" : |
case "CREATE" : |
1694 |
case "D" : // create a directory |
case "D" : // create a directory |
1695 |
if ( ! @mkdir($path,$gblDirPerms) ) |
if ( ! @mkdir($path,$gblDirPerms) ) |
1696 |
Error("Mkdir failed",$relPath) ; // eg. if it exists |
Error("Mkdir failed",$relPath) ; // eg. if it exists |
1697 |
|
else |
1698 |
|
LogIt($path."/","dir created",trperm_w); |
1699 |
clearstatcache() ; |
clearstatcache() ; |
1700 |
break ; |
break ; |
1701 |
case "F" : // create a new file |
case "F" : // create a new file |
1708 |
if ($fh) { |
if ($fh) { |
1709 |
fputs($fh,"\n"); |
fputs($fh,"\n"); |
1710 |
fclose($fh) ; |
fclose($fh) ; |
1711 |
LogIt($path,"file created"); |
LogIt($path,"file created",trperm_r | trperm_w); |
1712 |
} else { |
} else { |
1713 |
Error("Creation of file $relPath failed -- $path"); |
Error("Creation of file $relPath failed -- $path"); |
1714 |
} |
} |
1715 |
$tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ; |
$tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ; |
1716 |
header("Location: " . $tstr) ; |
header("Location: " . $tstr) ; |
|
ChangeLog($target,"created"); |
|
1717 |
exit ; |
exit ; |
1718 |
} |
} |
1719 |
break ; |
break ; |
1735 |
|
|
1736 |
// if ( ! @unlink($path) ) { |
// if ( ! @unlink($path) ) { |
1737 |
if ( ! rename($path,"$dir/.del/$file") ) { |
if ( ! rename($path,"$dir/.del/$file") ) { |
1738 |
|
LogIt($path,"file delete failed"); |
1739 |
Error("File delete failed", $tstr . $path) ; |
Error("File delete failed", $tstr . $path) ; |
|
Logit($path,"file delete failed"); |
|
|
exit ; |
|
1740 |
} else { |
} else { |
1741 |
Logit($path,"file deleted"); |
LogIt($path,"file deleted",trperm_w); |
1742 |
MoveTo("$dir/.log/$file","$dir/.del/.log/"); |
MoveTo("$dir/.log/$file","$dir/.del/.log/"); |
1743 |
MoveTo("$dir/.note/$file","$dir/.del/.note/"); |
MoveTo("$dir/.note/$file","$dir/.del/.note/"); |
1744 |
MoveTo("$dir/.lock/$file","$dir/.del/.lock/"); |
MoveTo("$dir/.lock/$file","$dir/.del/.lock/"); |
1745 |
} |
} |
1746 |
} |
} else { // delete directory |
1747 |
else { // delete directory |
if ( ! @rrmdir($fsDir) ) { |
1748 |
if ( ! @rrmdir($fsDir) ) { |
Error("Rmdir failed", $tstr . $fsDir) ; |
1749 |
Error("Rmdir failed", $tstr . $fsDir) ; |
} else { |
1750 |
} |
LogIt($path,"dir deleted",trperm_w); |
1751 |
else { |
$relDir = dirname($relDir) ; // move up |
1752 |
$relDir = dirname($relDir) ; // move up |
} |
|
} |
|
1753 |
} |
} |
1754 |
break ; |
break ; |
1755 |
|
|
1759 |
if (substr($FN,0,4) != ".del") break ; |
if (substr($FN,0,4) != ".del") break ; |
1760 |
$file=substr($FN,4,strlen($FN)-4); |
$file=substr($FN,4,strlen($FN)-4); |
1761 |
|
|
1762 |
Logit("$fsDir/.del/$file","undeleted"); |
LogIt("$fsDir/.del/$file","undeleted",trperm_w); |
1763 |
MoveTo("$fsDir/.del/$file","$fsDir/"); |
MoveTo("$fsDir/.del/$file","$fsDir/"); |
1764 |
MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/"); |
MoveTo("$fsDir/.del/.log/$file","$fsDir/.log/"); |
1765 |
MoveTo("$fsDir/.del/.note/$file","$fsDir/.note/"); |
MoveTo("$fsDir/.del/.note/$file","$fsDir/.note/"); |
1770 |
case "RENAME" : |
case "RENAME" : |
1771 |
if ( $CONFIRM != "on" ) break ; |
if ( $CONFIRM != "on" ) break ; |
1772 |
|
|
1773 |
Logit("$fsDir/$FN","renamed $FN to $NEWNAME"); |
$NEWNAME=stripSlashes($HTTP_POST_VARS["NEWNAME"]); |
1774 |
|
LogIt("$fsDir/$FN","renamed $FN to $NEWNAME",trperm_r); |
1775 |
safe_rename($fsDir,$FN,$NEWNAME); |
safe_rename($fsDir,$FN,$NEWNAME); |
1776 |
break ; |
break ; |
1777 |
|
|
1778 |
case "NOTE" : |
case "NOTE" : |
1779 |
|
$NOTE=stripSlashes($HTTP_POST_VARS["NOTE"]); |
1780 |
WriteNote("$fsDir/$FN","$NOTE"); |
WriteNote("$fsDir/$FN","$NOTE"); |
1781 |
break ; |
break ; |
1782 |
|
|
1812 |
if (!is_writeable($gblFsRoot . $relDir)) |
if (!is_writeable($gblFsRoot . $relDir)) |
1813 |
Error("Write access denied",$relDir) ; |
Error("Write access denied",$relDir) ; |
1814 |
$text = "Use this page to upload a single " ; |
$text = "Use this page to upload a single " ; |
1815 |
$text .= "file to <B>$HTTP_HOST</B>." ; |
$text .= "file to <B>$realm</B>." ; |
1816 |
StartHTML("(Upload Page)", $text) ; |
StartHTML("(Upload Page)", $text) ; |
1817 |
UploadPage($gblFsRoot, $relDir) ; |
UploadPage($gblFsRoot, $relDir) ; |
1818 |
EndHTML() ; |
EndHTML() ; |
1819 |
exit ; |
exit ; |
1820 |
case "E" : |
case "E" : |
|
$F=stripSlashes($F); |
|
1821 |
// detail of $relDir/$F |
// detail of $relDir/$F |
1822 |
if (is_file("$gblFsRoot/$relDir/$F") || is_dir("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ; |
if (is_file("$gblFsRoot/$relDir/$F") || is_dir("$gblFsRoot/$relDir/$F")) DetailPage($gblFsRoot, $relDir, $F) ; |
1823 |
exit ; |
exit ; |
1829 |
case "Co" : |
case "Co" : |
1830 |
// checkout |
// checkout |
1831 |
Lock("$gblFsRoot/$relDir/$F"); |
Lock("$gblFsRoot/$relDir/$F"); |
1832 |
Download("$gblFsRoot/$relDir/$F"); |
Download("$gblFsRoot/$relDir/$F",1); |
1833 |
exit; |
exit; |
1834 |
case "Ci" : |
case "Ci" : |
1835 |
$F=stripSlashes($F); |
$F=stripSlashes($F); |
1837 |
if (!is_writeable($gblFsRoot . $relDir)) |
if (!is_writeable($gblFsRoot . $relDir)) |
1838 |
Error("Write access denied",$relDir) ; |
Error("Write access denied",$relDir) ; |
1839 |
$text = "Use this page to update a single " ; |
$text = "Use this page to update a single " ; |
1840 |
$text .= "file to <B>$HTTP_HOST</B>." ; |
$text .= "file to <B>$realm</B>." ; |
1841 |
StartHTML("(Update file Page)", $text) ; |
StartHTML("(Update file Page)", $text) ; |
1842 |
UploadPage($gblFsRoot, $relDir, $F) ; |
UploadPage($gblFsRoot, $relDir, $F) ; |
1843 |
EndHTML() ; |
EndHTML() ; |
1845 |
case "V" : |
case "V" : |
1846 |
// view |
// view |
1847 |
LogIt("$gblFsRoot/$relDir/$F","viewed"); |
LogIt("$gblFsRoot/$relDir/$F","viewed"); |
1848 |
if ($gblForceDownload) { |
Download("$gblFsRoot/$relDir/$F",$gblForceDownload); |
|
Download("$gblFsRoot/$relDir/$F"); |
|
|
} else { |
|
|
header("Content-Disposition: attachment; filename=$F" ); |
|
|
Header("Location: $webRoot".urlpath("$relDir/$F")); |
|
|
} |
|
1849 |
exit; |
exit; |
1850 |
case "Ch" : |
case "Ch" : |
1851 |
StartHTML("(File changes)","All changes chronologicaly..."); |
StartHTML("(File changes)","All changes chronologicaly..."); |
1867 |
$title = "You should define \$title variable with page title"; |
$title = "You should define \$title variable with page title"; |
1868 |
include($inc_file); |
include($inc_file); |
1869 |
StartHTML($title, $text) ; |
StartHTML($title, $text) ; |
1870 |
print "<p>".GifIcon(up)." Back to <a href=$GLOBALS[PHP_SELF]>front page</a>.</p>"; |
print "<p>".GifIcon(up)." Back to <a href=$HTTP_SERVER_VARS[PHP_SELF]>front page</a>.</p>"; |
1871 |
EndHTML() ; |
EndHTML() ; |
1872 |
exit ; |
exit ; |
1873 |
} |
} |
1876 |
Navigate($gblFsRoot,$relDir) ; |
Navigate($gblFsRoot,$relDir) ; |
1877 |
exit ; |
exit ; |
1878 |
|
|
1879 |
Error("Whooah!","By cartesian logic, this never happens") ; |
Error("Whooah!","By cartesian logic, this never happens",1) ; |
1880 |
?> |
?> |