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"); |
571 |
function Navigate($fsRoot,$relDir) { |
function Navigate($fsRoot,$relDir) { |
572 |
|
|
573 |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
574 |
$gblIgnoreUnknownFileType, |
$gblIgnoreUnknownFileType, $gblRepositoryDir, |
575 |
|
$fsRealmDir, $realm, $realm_sep, |
576 |
$HTTP_GET_VARS, $html, $realm_config; |
$HTTP_GET_VARS, $html, $realm_config; |
577 |
|
|
578 |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
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 ?>"> |
910 |
// Error with sysadmin flag are reported to error_log or hidden from |
// Error with sysadmin flag are reported to error_log or hidden from |
911 |
// users |
// users |
912 |
|
|
913 |
function Error($title,$text="",$sysadmin=0) { |
function Error($title,$text="",$sysadmin=0,$no_404=0) { |
914 |
global $gblSeparateAdminMessages, |
global $gblSeparateAdminMessages, |
915 |
$gblMailAdminMessages,$realm, |
$gblMailAdminMessages,$realm, |
916 |
$HTTP_SERVER_VARS; |
$HTTP_SERVER_VARS; |
917 |
if (! headers_sent()) header("HTTP/1.0 404 Not Found"); |
if (! headers_sent() && ! $no_404) header("HTTP/1.0 404 Not Found"); |
918 |
if ($sysadmin) { |
if ($sysadmin) { |
919 |
if ($gblSeparateAdminMessages) { |
if ($gblSeparateAdminMessages) { |
920 |
$user="Your administrator "; |
$user="Your administrator "; |
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)) { |
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); |
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); |
1570 |
} |
} |
1571 |
|
|
1572 |
// read mime.types |
// read mime.types |