78 |
// from where to include auth_*.php modules? |
// from where to include auth_*.php modules? |
79 |
$gblIncDir = "/home/httpd/docman"; |
$gblIncDir = "/home/httpd/docman"; |
80 |
|
|
81 |
|
// do we want to force download? (default is 0 for backward |
82 |
|
// compatibility, but it's defined as 1 in docman.conf for all |
83 |
|
// future applications! |
84 |
|
$gblForceDownload = 0; |
85 |
|
|
86 |
// username/password should not be system |
// username/password should not be system |
87 |
// usernames/passwords !! |
// usernames/passwords !! |
88 |
|
|
133 |
|
|
134 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
135 |
|
|
136 |
|
$gblVersion = "1.8-dev"; |
137 |
|
|
138 |
function StartHTML($title,$text="") { |
function StartHTML($title,$text="") { |
139 |
|
|
140 |
$title = "Document Manager " . $title ; |
$title = "Document Manager " . $title ; |
145 |
<HTML> |
<HTML> |
146 |
<HEAD> |
<HEAD> |
147 |
<TITLE><?= $host . " " . $title ?></TITLE> |
<TITLE><?= $host . " " . $title ?></TITLE> |
148 |
<META NAME="description" CONTENT="PHP port of AnyPortal Site Manager"> |
<META NAME="description" CONTENT="Document Manager"> |
149 |
<META NAME="keywords" CONTENT="site manager, web site maintenance"> |
<META NAME="keywords" CONTENT="site manager, web site maintenance"> |
150 |
<META NAME="robots" CONTENT="noindex"> |
<META NAME="robots" CONTENT="noindex"> |
151 |
<META HTTP-EQUIV="expires" CONTENT="0"> |
<META HTTP-EQUIV="expires" CONTENT="0"> |
164 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
165 |
|
|
166 |
function EndHTML() { |
function EndHTML() { |
167 |
|
|
168 |
|
global $gblDateFmt, $gblTimeFmt, $gblUserName, $PHP_SELF, $gblPw, $gblVersion; |
169 |
|
|
170 |
?> |
?> |
171 |
|
|
172 |
<HR> |
<HR> |
173 |
<P CLASS=FTR> |
<P CLASS=FTR> |
174 |
<B><?= date($GLOBALS[gblDateFmt]) ?> - |
<B><?= date($gblDateFmt) ?> - |
175 |
<?= date($GLOBALS[gblTimeFmt]) ?> - |
<?= date($gblTimeFmt) ?> - |
176 |
<?= $GLOBALS[gblUserName] ?> |
<?= $gblUserName ?> |
177 |
<small> [<a href="<?= $GLOBALS["PHP_SELF"] ?>?relogin=<?= $GLOBALS[gblPw] ?>">logout</a>]</small> |
<small> [<a href="<?= $PHP_SELF ?>?relogin=<?= $gblPw ?>">logout</a>]</small> |
178 |
</B> |
</B> |
179 |
<BR>ANYPORTAL(php) Site Manager |
<BR><small> |
180 |
<br><small> |
Document Manager <?= $gblVersion ?>, based on ANYPORTAL(php) Site Manager |
181 |
|
<br> |
182 |
© 1999 by <A HREF="http://www.anyportal.com">ANYPORTAL</A>, |
© 1999 by <A HREF="http://www.anyportal.com">ANYPORTAL</A>, |
183 |
© 2000 by <A HREF="http://da.nger.org">d@nger.org</A>, |
© 2000 by <A HREF="http://da.nger.org">d@nger.org</A>, |
184 |
© 2000 by <A HREF="http://www.rot13.org/~dpavlin/">DbP</A> |
© 2000 by <A HREF="http://www.rot13.org/~dpavlin/">DbP</A> |
1178 |
|
|
1179 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1180 |
|
|
1181 |
|
function Download($path) { |
1182 |
|
global $HTTP_USER_AGENT; |
1183 |
|
$file=basename($path); |
1184 |
|
$size = filesize($path); |
1185 |
|
//header("Content-Type: application/octet-stream"); |
1186 |
|
header("Content-Type: application/force-download"); |
1187 |
|
header("Content-Length: $size"); |
1188 |
|
// IE5.5 just downloads index.php if we don't do this |
1189 |
|
if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) { |
1190 |
|
header("Content-Disposition: filename=$file"); |
1191 |
|
} else { |
1192 |
|
header("Content-Disposition: attachment; filename=$file"); |
1193 |
|
} |
1194 |
|
header("Content-Transfer-Encoding: binary"); |
1195 |
|
$fh = fopen($path, "r"); |
1196 |
|
fpassthru($fh); |
1197 |
|
} |
1198 |
|
|
1199 |
|
|
1200 |
|
////////////////////////////////////////////////////////////////// |
1201 |
|
|
1202 |
// MAIN PROGRAM |
// MAIN PROGRAM |
1203 |
// ============ |
// ============ |
1204 |
// query parameters: capital letters |
// query parameters: capital letters |
1482 |
case "Co" : |
case "Co" : |
1483 |
// checkout |
// checkout |
1484 |
Lock("$gblFsRoot/$relDir/$F"); |
Lock("$gblFsRoot/$relDir/$F"); |
1485 |
header("Content-Disposition: attachment; filename=$F" ); |
Download("$gblFsRoot/$relDir/$F"); |
|
Header("Location: $webRoot".urlpath("$relDir/$F")); |
|
1486 |
exit; |
exit; |
1487 |
case "Ci" : |
case "Ci" : |
1488 |
$F=stripSlashes($F); |
$F=stripSlashes($F); |
1498 |
case "V" : |
case "V" : |
1499 |
// view |
// view |
1500 |
LogIt("$gblFsRoot/$relDir/$F","viewed"); |
LogIt("$gblFsRoot/$relDir/$F","viewed"); |
1501 |
header("Content-Disposition: attachment; filename=$F" ); |
if ($gblForceDownload) { |
1502 |
Header("Location: $webRoot".urlpath("$relDir/$F")); |
Download("$gblFsRoot/$relDir/$F"); |
1503 |
|
} else { |
1504 |
|
header("Content-Disposition: attachment; filename=$F" ); |
1505 |
|
Header("Location: $webRoot".urlpath("$relDir/$F")); |
1506 |
|
} |
1507 |
exit; |
exit; |
1508 |
case "Ch" : |
case "Ch" : |
1509 |
StartHTML("(File changes)","All changes chronologicaly..."); |
StartHTML("(File changes)","All changes chronologicaly..."); |