87 |
$realm="$HTTP_HOST"; // FIX |
$realm="$HTTP_HOST"; // FIX |
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 = $PHP_AUTH_USER; |
166 |
$file_lock = CheckLock($fsPath); |
$file_lock = CheckLock($fsPath); |
167 |
|
|
168 |
if (!$editable && !$exists) |
if (!$editable && !$exists) |
169 |
Error(_("Creation unsupported for type"),$relPath) ; |
Error("Creation unsupported for type",$relPath) ; |
170 |
if (!exists && !is_writeable($fsDir) ) |
if (!exists && !is_writeable($fsDir) ) |
171 |
Error(_("Creation denied"),$relDir) ; |
Error("Creation denied",$relDir) ; |
172 |
|
|
173 |
$text = _("Use this page to view, modify or ") ; |
$text = _("Use this page to view, modify or ") ; |
174 |
if (is_dir($fsPath)) { |
if (is_dir($fsPath)) { |
930 |
|
|
931 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
932 |
|
|
933 |
function Error($title,$text="") { |
// Error with sysadmin flag are reported to error_log or hidden from |
934 |
StartHTML("(".$title.")",$text) ; |
// users |
935 |
echo "<P ALIGN=center>Hit your Browser's Back Button.</P>" ; |
|
936 |
EndHTML() ; |
function Error($title,$text="",$sysadmin=0) { |
937 |
|
global $gblSeparateAdminMessages, |
938 |
|
$gblMailAdminMessages,$realm, |
939 |
|
$HTTP_SERVER_VARS; |
940 |
|
if ($sysadmin) { |
941 |
|
if ($gblSeparateAdminMessages) { |
942 |
|
$user="Your administrator "; |
943 |
|
if ($gblMailAdminMessages) { |
944 |
|
mail($HTTP_SERVER_VARS["SERVER_ADMIN"], "docman $realm error message: $title", strip_tags($text)); |
945 |
|
$user.="<tt>".$HTTP_SERVER_VARS["SERVER_ADMIN"]."</tt> "; |
946 |
|
} |
947 |
|
$user.="has been notified about error" ; |
948 |
|
StartHTML("($title)",$user); |
949 |
|
echo "<P ALIGN=center>Hit your Browser's Back Button.</P>" ; |
950 |
|
EndHTML(); |
951 |
|
error_log("docman $realm: ".strip_tags($text)); |
952 |
|
} else { |
953 |
|
StartHTML("ADMIN: ".$title,$text) ; |
954 |
|
echo "<P ALIGN=center>Hit your Browser's Back Button.</P>" ; |
955 |
|
EndHTML(); |
956 |
|
} |
957 |
|
} else { |
958 |
|
StartHTML("(".$title.")",$text) ; |
959 |
|
echo "<P ALIGN=center>Hit your Browser's Back Button.</P>" ; |
960 |
|
EndHTML() ; |
961 |
|
} |
962 |
exit ; |
exit ; |
963 |
} // end function Error |
} // end function Error |
964 |
|
|
|
////////////////////////////////////////////////////////////////// |
|
|
|
|
965 |
function LogIt($target,$msg, $changelog=0) { |
function LogIt($target,$msg, $changelog=0) { |
966 |
|
|
967 |
$dir=dirname($target); |
$dir=dirname($target); |
968 |
if (! file_exists($dir."/.log")) { |
if (! file_exists($dir."/.log")) { |
969 |
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); |
970 |
} |
} |
971 |
$file=basename($target); |
$file=basename($target); |
972 |
|
|
1290 |
$groups_arr = array(); |
$groups_arr = array(); |
1291 |
$perm_arr = array(); |
$perm_arr = array(); |
1292 |
|
|
|
$error=0; |
|
|
|
|
1293 |
$tr_arr = array(); |
$tr_arr = array(); |
1294 |
|
|
1295 |
while (! feof($fp_conf)) { |
while (! feof($fp_conf)) { |
1357 |
} |
} |
1358 |
|
|
1359 |
if ($error) { |
if ($error) { |
1360 |
Error("Trustee error",$error); |
Error("Trustee error",$error,1); |
1361 |
} else { |
} else { |
1362 |
include("$trustee_php"); |
include("$trustee_php"); |
1363 |
} |
} |
1505 |
exit ; |
exit ; |
1506 |
} |
} |
1507 |
|
|
1508 |
|
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); |
1509 |
|
|
1510 |
// trustee (ACL) file configuration |
// trustee (ACL) file configuration |
1511 |
$trustee_conf="$gblIncDir/realm/$realm.trustee"; |
$trustee_conf="$gblIncDir/realm/$realm.trustee"; |
1512 |
// compiled version of trustee file |
// compiled version of trustee file |
1826 |
Navigate($gblFsRoot,$relDir) ; |
Navigate($gblFsRoot,$relDir) ; |
1827 |
exit ; |
exit ; |
1828 |
|
|
1829 |
Error("Whooah!","By cartesian logic, this never happens") ; |
Error("Whooah!","By cartesian logic, this never happens",1) ; |
1830 |
?> |
?> |