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"); |
148 |
|
|
149 |
|
global $debug; |
150 |
|
if ($debug) print $debug; |
151 |
} // end function EndHTML |
} // end function EndHTML |
152 |
|
|
153 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
163 |
|
|
164 |
$exists = file_exists($fsPath) ; |
$exists = file_exists($fsPath) ; |
165 |
$ext = strtolower(strrchr($relPath,".")) ; |
$ext = strtolower(strrchr($relPath,".")) ; |
166 |
$editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ; |
$editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) && |
167 |
$writable = is_writeable($fsPath) ; |
check_perm($relPath,trperm_w); |
168 |
|
$writable = is_writeable($fsPath) && check_perm($relPath,trperm_w) ; |
169 |
|
$writable_dir = is_writeable($fsDir) && check_perm($relDir,trperm_w) ; |
170 |
$file_lock = CheckLock($fsPath); |
$file_lock = CheckLock($fsPath); |
171 |
|
|
172 |
if (!$editable && !$exists) |
if (!$editable && !$exists) |
173 |
Error("Creation unsupported for type",$relPath) ; |
Error("Creation denied","Can't create <tt>$relPath</tt>") ; |
174 |
if (!exists && !is_writeable($fsDir) ) |
if (!$exists && !$writable_dir ) |
175 |
Error("Creation denied",$relDir) ; |
Error("Creation denied","Can't write in directory <tt>$relDir</tt> while creating <tt>$relPath</tt>for which user has permissions.",1); |
176 |
|
|
177 |
$text = _("Use this page to view, modify or ") ; |
$text = _("Use this page to view, modify or ") ; |
178 |
if (is_dir($fsPath)) { |
if (is_dir($fsPath)) { |
205 |
$fstr = htmlentities( $fstr ) ; |
$fstr = htmlentities( $fstr ) ; |
206 |
?> |
?> |
207 |
|
|
208 |
<FORM ACTION="<?= $self ; ?>" METHOD="POST"> |
<FORM ACTION="<?= $self ?>" METHOD="POST"> |
209 |
<SPAN TITLE="Click [SAVE] to store updated contents."> |
<SPAN TITLE="Click [SAVE] to store updated contents."> |
210 |
<B>DOCUMENT CONTENTS</B> |
<B>DOCUMENT CONTENTS</B> |
211 |
</SPAN><BR> |
</SPAN><BR> |
576 |
function Navigate($fsRoot,$relDir) { |
function Navigate($fsRoot,$relDir) { |
577 |
|
|
578 |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
579 |
$gblIgnoreUnknownFileType, |
$gblIgnoreUnknownFileType, $gblRepositoryDir, |
580 |
|
$fsRealmDir, $realm, $realm_sep, |
581 |
$HTTP_GET_VARS, $html, $realm_config; |
$HTTP_GET_VARS, $html, $realm_config; |
582 |
|
|
583 |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
584 |
|
|
585 |
if ($relDir == "") $relDir = "/"; |
if ($relDir == "") $relDir = "/"; |
586 |
|
|
587 |
$fsDir = $fsRoot.$relDir."/"; // current directory |
$fsDir = $fsRoot.$relDir."/"; // current directory |
588 |
|
|
589 |
if (!is_dir($fsDir)) Error("Dir not found",$relDir) ; |
if (!is_dir($fsDir)) Error("Dir not found",$relDir,1) ; |
590 |
|
|
591 |
$hide_items=",$gblHide,"; |
$hide_items=",$gblHide,"; |
592 |
|
|
639 |
echo "<TABLE BORDER=0 CELLPADDING=2 |
echo "<TABLE BORDER=0 CELLPADDING=2 |
640 |
CELLSPACING=3 WIDTH=\"100%\">" ; |
CELLSPACING=3 WIDTH=\"100%\">" ; |
641 |
|
|
642 |
// updir bar |
// updir (parent) bar |
643 |
if (chopsl($fsDir) != chopsl($fsRoot)) { |
if (chopsl($fsDir) != chopsl($fsRoot)) { |
644 |
$parent = dirname($relDir) ; |
$parent = dirname($relDir) ; |
645 |
if ($parent == "") $parent = "/" ; |
if ($parent == "") $parent = "/" ; |
719 |
$dir = $dirList[$key]; |
$dir = $dirList[$key]; |
720 |
|
|
721 |
$info_url=self_args(array("A"=>"A=E", "F"=>"F=".urlencode($dir), "D"=>$D)); |
$info_url=self_args(array("A"=>"A=E", "F"=>"F=".urlencode($dir), "D"=>$D)); |
722 |
$dir_url=$self."?D=".urlencode($relDir."/".$dir); |
$dir_url=$self."?D=".urlencode(chopsl($relDir)."/".$dir); |
723 |
include("$html/Navigate-dirEntry.html"); |
include("$html/Navigate-dirEntry.html"); |
724 |
|
|
725 |
} // iterate over dirs |
} // iterate over dirs |
865 |
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR> |
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR> |
866 |
|
|
867 |
<? |
<? |
868 |
if (file_exists(".info.inc")) { |
|
869 |
|
if (file_exists("$fsRealmDir/$realm".$realm_sep."info.inc")) { |
870 |
print "<TR><TD></TD><TD COLSPAN=5>"; |
print "<TR><TD></TD><TD COLSPAN=5>"; |
871 |
include(".info.inc"); |
include("$fsRealmDir/$realm".$realm_sep."info.inc"); |
872 |
print "</TD></TR> |
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
873 |
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
} elseif (file_exists("$gblRepositoryDir/.info.inc")) { |
874 |
|
print "<TR><TD></TD><TD COLSPAN=5>"; |
875 |
|
include("$gblRepositoryDir/.info.inc"); |
876 |
|
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
877 |
} |
} |
878 |
|
|
879 |
|
|
880 |
?> |
?> |
881 |
|
|
882 |
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
915 |
// Error with sysadmin flag are reported to error_log or hidden from |
// Error with sysadmin flag are reported to error_log or hidden from |
916 |
// users |
// users |
917 |
|
|
918 |
function Error($title,$text="",$sysadmin=0) { |
function Error($title,$text="",$sysadmin=0,$no_404=0) { |
919 |
global $gblSeparateAdminMessages, |
global $gblSeparateAdminMessages, |
920 |
$gblMailAdminMessages,$realm, |
$gblMailAdminMessages,$realm, |
921 |
$HTTP_SERVER_VARS; |
$HTTP_SERVER_VARS; |
922 |
if (! headers_sent()) header("HTTP/1.0 404 Not Found"); |
if (! headers_sent() && ! $no_404) header("HTTP/1.0 404 Not Found"); |
923 |
if ($sysadmin) { |
if ($sysadmin) { |
924 |
if ($gblSeparateAdminMessages) { |
if ($gblSeparateAdminMessages) { |
925 |
$user="Your administrator "; |
$user="Your administrator "; |
1088 |
function try_rename($from,$to) { |
function try_rename($from,$to) { |
1089 |
# print "$from -> $to\n"; |
# print "$from -> $to\n"; |
1090 |
if (file_exists($from) && is_writeable(dirname($to))) { |
if (file_exists($from) && is_writeable(dirname($to))) { |
1091 |
rename($from,$to); |
return rename($from,$to); |
1092 |
|
} else { |
1093 |
|
return 0; |
1094 |
} |
} |
1095 |
} |
} |
1096 |
|
|
1097 |
function try_dir($todir) { |
function try_dir($todir) { |
1098 |
if (! file_exists($todir)) { |
if (! file_exists($todir)) { |
1099 |
mkdir($todir,0700); |
@mkdir($todir,0700); |
1100 |
} |
} |
1101 |
} |
} |
1102 |
|
|
1106 |
|
|
1107 |
# print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n"; |
# print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n"; |
1108 |
|
|
1109 |
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); |
1110 |
try_dir("$todir/.log"); |
try_dir("$todir/.log"); |
1111 |
try_rename("$fromdir/.log/$fromfile","$todir/.log/$tofile"); |
try_rename("$fromdir/.log/$fromfile","$todir/.log/$tofile"); |
1112 |
try_dir("$todir/.note"); |
try_dir("$todir/.note"); |
1217 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1218 |
|
|
1219 |
function chopsl($path) { |
function chopsl($path) { |
|
if (substr($path,strlen($path)-1,1) == "/") $path=substr($path,0,strlen($path)-1); |
|
1220 |
$path=str_replace("//","/",$path); |
$path=str_replace("//","/",$path); |
1221 |
|
if (substr($path,strlen($path)-1,1) == "/") $path=substr($path,0,strlen($path)-1); |
1222 |
return $path; |
return $path; |
1223 |
} |
} |
1224 |
|
|
1443 |
|
|
1444 |
function check_perm($path,$trperm) { |
function check_perm($path,$trperm) { |
1445 |
global $gblLogin,$HAVE_TRUSTEE; |
global $gblLogin,$HAVE_TRUSTEE; |
1446 |
print "<br>check_perm: <tt>$path</tt> test perm ".display_trustee($perm)."<br>\n"; |
|
1447 |
|
global $debug; |
1448 |
|
$debug.="<br>check_perm: <tt>$path</tt> test perm ".display_trustee($perm)."<br>\n"; |
1449 |
$return = ! $HAVE_TRUSTEE; |
$return = ! $HAVE_TRUSTEE; |
1450 |
if ($HAVE_TRUSTEE) { |
if ($HAVE_TRUSTEE) { |
1451 |
$perm = check_trustee($gblLogin,$path); |
$perm = check_trustee($gblLogin,$path); |
1452 |
print " d: $perm[deny] (".display_trustee($perm[deny]).") a: $perm[allow] (".display_trustee($perm[allow]).") perm: $trperm"; |
$debug.=" d: $perm[deny] (".display_trustee($perm[deny]).") a: $perm[allow] (".display_trustee($perm[allow]).") perm: $trperm"; |
1453 |
if ($perm[deny] & $trperm) $return=0; |
if ($perm[deny] & $trperm) $return=0; |
1454 |
elseif ($perm[allow] & $trperm) $return=1; |
elseif ($perm[allow] & $trperm) $return=1; |
1455 |
} |
} |
1456 |
print " return: $return<br>\n"; |
$debug.=" return: $return<br>\n"; |
1457 |
return($return); |
return($return); |
1458 |
} |
} |
1459 |
|
|
1483 |
} |
} |
1484 |
|
|
1485 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1486 |
|
|
1487 |
|
// check for invalid characters in filename and dirname (.. and /) |
1488 |
|
|
1489 |
|
function check_dirname($file) { |
1490 |
|
if (strstr($file,"..")) Error("Security violation","No parent dir <tt>..</tt> allowed in directory name <tt>$file</tt>",1); |
1491 |
|
} |
1492 |
|
|
1493 |
|
function check_filename($file) { |
1494 |
|
if (strstr($file,"..")) Error("Security violation","No parent dir <tt>..</tt> allowed in file name <tt>$file</tt>",1); |
1495 |
|
if (strstr($file,"/")) Error("Security violation","No slashes <tt>/</tt> allowed in file name <tt>$file</tt>",1); |
1496 |
|
} |
1497 |
|
|
1498 |
|
////////////////////////////////////////////////////////////////// |
1499 |
// MAIN PROGRAM |
// MAIN PROGRAM |
1500 |
|
|
1501 |
$gblFilePerms = 0640 ; // default for new files |
$gblFilePerms = 0640 ; // default for new files |
1502 |
$gblDirPerms = 0750 ; // default for new dirs |
$gblDirPerms = 0750 ; // default for new dirs |
1503 |
|
|
1504 |
|
$STYLE = $HTTP_GET_VARS[STYLE]; |
1505 |
if (isset($STYLE) && $STYLE == "get") { |
if (isset($STYLE) && $STYLE == "get") { |
1506 |
include("$html/docman.css"); |
include("$html/docman.css"); |
1507 |
exit; |
exit; |
1520 |
if (! isset($fsRealmDir)) { |
if (! isset($fsRealmDir)) { |
1521 |
$fsRealmDir = "$gblIncDir/realm"; |
$fsRealmDir = "$gblIncDir/realm"; |
1522 |
} |
} |
1523 |
$realm_config = "$fsRealmDir/$realm.conf"; |
|
1524 |
|
// try to add dir to script name to realm var |
1525 |
|
if (is_dir("$fsRealmDir/$realm/".dirname($HTTP_SERVER_VARS[SCRIPT_NAME]))) { |
1526 |
|
$realm .= dirname($HTTP_SERVER_VARS[SCRIPT_NAME]); |
1527 |
|
$realm_sep = "/"; |
1528 |
|
} else { |
1529 |
|
$realm_sep = "."; |
1530 |
|
} |
1531 |
|
|
1532 |
|
$realm_config = $fsRealmDir."/".$realm.$realm_sep."conf"; |
1533 |
|
|
1534 |
// read user-defined configuration |
// read user-defined configuration |
1535 |
if (file_exists($realm_config)) { |
if (file_exists($realm_config)) { |
1548 |
} |
} |
1549 |
|
|
1550 |
// if no password, or empty password logout |
// if no password, or empty password logout |
1551 |
|
$relogin = $HTTP_GET_VARS[relogin]; |
1552 |
|
$force_login = $HTTP_GET_VARS[force_login]; |
1553 |
if ( |
if ( |
1554 |
isset($gblLogin) && ( |
isset($gblLogin) && ( |
1555 |
!isset($relogin) || ( |
!isset($relogin) || ( |
1567 |
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); |
1568 |
|
|
1569 |
// trustee (ACL) file configuration |
// trustee (ACL) file configuration |
1570 |
$trustee_conf="$gblIncDir/realm/$realm.trustee"; |
$trustee_conf="$fsRealmDir/$realm".$realm_sep."trustee"; |
1571 |
// compiled version of trustee file |
// compiled version of trustee file |
1572 |
$trustee_php="$gblRepositoryDir/.trustee.php"; |
$trustee_php="$gblRepositoryDir/.trustee.php"; |
1573 |
// get ACL informations |
// get ACL informations |
1588 |
isset($relogin) && $secHash == $relogin) { |
isset($relogin) && $secHash == $relogin) { |
1589 |
header("WWW-authenticate: basic realm=\"$realm\"") ; |
header("WWW-authenticate: basic realm=\"$realm\"") ; |
1590 |
header("HTTP/1.0 401 Unauthorized") ; |
header("HTTP/1.0 401 Unauthorized") ; |
1591 |
Error("401 Unauthorized","No trespassing !"); |
Error("401 Unauthorized","No trespassing !",0,1); |
1592 |
} |
} |
1593 |
|
|
1594 |
|
|
1595 |
// read mime.types |
// read mime.types |
1596 |
readMime(); |
readMime(); |
1597 |
|
|
1598 |
// get current directory relative to $gblFsRoot |
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") { |
1599 |
$relDir = $DIR ; // from POST |
// take variables from server |
1600 |
if ($relDir == "") { // not defined in POST ? |
$FN=stripSlashes($HTTP_POST_VARS["FN"]); |
1601 |
$relDir = urldecode($D) ; // then use GET |
$DIR=stripSlashes($HTTP_POST_VARS["DIR"]); |
1602 |
} |
$RELPATH=stripSlashes($HTTP_POST_VARS["RELPATH"]); |
1603 |
|
$T=stripSlashes($HTTP_POST_VARS["T"]); |
1604 |
|
$CONFIRM=stripSlashes($HTTP_POST_VARS["CONFIRM"]); |
1605 |
|
|
1606 |
|
check_filename($FN); |
1607 |
|
check_dirname($DIR); |
1608 |
|
check_dirname($RELPATH); |
1609 |
|
|
1610 |
$relDir=stripSlashes($relDir); |
$relDir = $DIR; |
1611 |
|
} else { |
1612 |
|
// get |
1613 |
|
$A=stripSlashes($HTTP_GET_VARS["A"]); |
1614 |
|
$D=stripSlashes(urldecode($HTTP_GET_VARS["D"])); |
1615 |
|
$F=stripSlashes($HTTP_GET_VARS["F"]); |
1616 |
|
|
1617 |
if ($relDir == "/") $relDir = "" ; |
check_filename($F); |
1618 |
// default : website root = "" |
check_dirname($D); |
1619 |
|
|
1620 |
if (strstr($relDir,"..")) Error("No updirs allowed"); |
$relDir = $D; |
1621 |
|
} |
1622 |
|
|
1623 |
// full paths contain "fs" or "Fs". Paths realitve to root of |
if ($relDir == "/") $relDir = "" ; |
|
// website contain "rel" or "Rel". The script won't let you |
|
|
// edit anything above directory equal to http://server.com |
|
|
// i.e. below $gblFsRoot. |
|
1624 |
|
|
1625 |
$relScriptDir = dirname($SCRIPT_NAME) ; |
$relScriptDir = dirname($SCRIPT_NAME) ; |
1626 |
// i.e. /docman |
// i.e. /docman |
1627 |
|
|
1628 |
// start on server root |
// start on server root |
1629 |
$gblFsRoot = $gblRepositoryDir; |
$gblFsRoot = $gblRepositoryDir; |
1630 |
// i.e. /home/httpd/html |
// i.e. /home/httpd/repository |
1631 |
|
|
1632 |
$fsDir = $gblFsRoot . $relDir ; // current directory |
$fsDir = $gblFsRoot . $relDir ; // current directory |
1633 |
if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ; |
if ( !is_dir($fsDir) ) Error("Dir not found",$relDir,1) ; |
1634 |
|
|
1635 |
if (isset($HTTP_SERVER_VARS["HTTPS"]) && $HTTP_SERVER_VARS["HTTPS"] == "on") { |
if (isset($HTTP_SERVER_VARS["HTTPS"]) && $HTTP_SERVER_VARS["HTTPS"] == "on") { |
1636 |
$webRoot = "https://"; |
$webRoot = "https://"; |
1639 |
} |
} |
1640 |
$webRoot .= $HTTP_SERVER_VARS["HTTP_HOST"] . $relScriptDir; |
$webRoot .= $HTTP_SERVER_VARS["HTTP_HOST"] . $relScriptDir; |
1641 |
|
|
|
// take variables from server |
|
|
$FN=stripSlashes($HTTP_POST_VARS["FN"]); |
|
|
$DIR=stripSlashes($HTTP_POST_VARS["DIR"]); |
|
|
$RELPATH=stripSlashes($HTTP_POST_VARS["RELPATH"]); |
|
|
$T=stripSlashes($HTTP_POST_VARS["T"]); |
|
|
$CONFIRM=stripSlashes($HTTP_POST_VARS["CONFIRM"]); |
|
|
|
|
|
// get |
|
|
$A=stripSlashes($HTTP_GET_VARS["A"]); |
|
|
$D=stripSlashes($HTTP_GET_VARS["D"]); |
|
|
|
|
|
// if (isset($F)) Error("Document manager system error","variable $F shouldn't be set here (re-check old code)",1); |
|
|
// $F=stripSlashes($HTTP_SERVER_VARS["PATH_INFO"]); |
|
|
$F=stripSlashes($HTTP_GET_VARS["F"]); |
|
|
|
|
1642 |
switch ($HTTP_POST_VARS["POSTACTION"]) { |
switch ($HTTP_POST_VARS["POSTACTION"]) { |
1643 |
case "UPLOAD" : |
case "UPLOAD" : |
1644 |
$FN_name=stripSlashes($HTTP_POST_FILES["FN"]["tmp_name"]); |
$FN_name=stripSlashes($HTTP_POST_FILES["FN"]["tmp_name"]); |
1645 |
|
$FN=stripSlashes($HTTP_POST_FILES["FN"]["name"]); |
1646 |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
1647 |
if (strstr($FN_name,"/")) |
|
|
Error("Non-conforming filename") ; |
|
|
// TODO : should rather check for escapeshellcmds |
|
|
// but maybe RFC 18xx asserts safe filenames .... |
|
1648 |
$source = $FN_name ; |
$source = $FN_name ; |
1649 |
if (! file_exists($source)) { |
if (! file_exists($source)) { |
1650 |
Error("You must select file with browse to upload it!"); |
Error("You must select file with browse to upload it!"); |
1651 |
} |
} |
1652 |
|
|
1653 |
$FILENAME = $HTTP_POST_VARS["FILENAME"]; |
$FILENAME = $HTTP_POST_VARS["FILENAME"]; |
1654 |
|
check_filename($FILENAME); |
1655 |
|
|
1656 |
if (! isset($FILENAME)) { // from update file |
if (! isset($FILENAME)) { // from update file |
1657 |
$target = "$fsDir/$FN_name" ; |
$target = "$fsDir/".basename($FN); |
1658 |
} else { |
} else { |
1659 |
$target = "$fsDir/$FILENAME"; |
$target = "$fsDir/$FILENAME"; |
1660 |
} |
} |
1787 |
case "RENAME" : |
case "RENAME" : |
1788 |
if ( $CONFIRM != "on" ) break ; |
if ( $CONFIRM != "on" ) break ; |
1789 |
|
|
1790 |
|
$NEWNAME=stripSlashes($HTTP_POST_VARS["NEWNAME"]); |
1791 |
LogIt("$fsDir/$FN","renamed $FN to $NEWNAME",trperm_r); |
LogIt("$fsDir/$FN","renamed $FN to $NEWNAME",trperm_r); |
1792 |
safe_rename($fsDir,$FN,$NEWNAME); |
safe_rename($fsDir,$FN,$NEWNAME); |
1793 |
break ; |
break ; |
1794 |
|
|
1795 |
case "NOTE" : |
case "NOTE" : |
1796 |
|
$NOTE=stripSlashes($HTTP_POST_VARS["NOTE"]); |
1797 |
WriteNote("$fsDir/$FN","$NOTE"); |
WriteNote("$fsDir/$FN","$NOTE"); |
1798 |
break ; |
break ; |
1799 |
|
|
1820 |
// $A=Co : checkout file $D/$F |
// $A=Co : checkout file $D/$F |
1821 |
// $A=Ci : checkin file $D/$F |
// $A=Ci : checkin file $D/$F |
1822 |
// $A=V : view file (do nothing except log) |
// $A=V : view file (do nothing except log) |
1823 |
// $A=I : include file .$F.php from $gblFsRoot |
// $A=I : include file .$F.php from [$gblIncDir|realm]/include_php |
1824 |
// default : display directory $D |
// default : display directory $D |
1825 |
|
|
1826 |
switch ($A) { |
switch ($A) { |
1875 |
EndHTML() ; |
EndHTML() ; |
1876 |
exit; |
exit; |
1877 |
case "I" : |
case "I" : |
1878 |
$F=stripSlashes($F); |
if (! isset($F) || $F == "") |
1879 |
$inc_file="${gblFsRoot}/.${F}.php"; |
Error("Can't find file to include","Your request didn't specify file to include which should be in variable <tt>F</tt> like <tt>$HTTP_SERVER_VARS[REQUEST_URI]<b>&F=include_php_file</b></tt>",1); |
1880 |
if (!isset($F) || $F == "" || !file_exists($inc_file)) Error("Fatal error $inc_file"); // can't find file to include |
$inc_file="$fsRealmDir/$realm".$realm_sep.$F.".php"; |
1881 |
|
if (! file_exists($inc_file)) { |
1882 |
|
Error("Can't find file to include","Can't find include file <tt>$F.php</tt> in <tt>$fsRealmDir/$realm/</tt>. Meybe you should copy <tt>$gblIncDir/include_php/$F.php</tt> to <tt>$inc_file<tt> ?",1); |
1883 |
|
} |
1884 |
if (!is_readable($inc_file)) |
if (!is_readable($inc_file)) |
1885 |
Error("Read access to include file denied",".${F}.php"); |
Error("Read access to include file denied","Can't read PHP include file <tt>$inc_file</tt>. Fix permissions on it.",1); |
1886 |
$text = "Your include file should define \$text variable which holds this text and \$title variable which is page title"; |
$text = "Your include file should define \$text variable which holds this text and \$title variable which is page title"; |
1887 |
$title = "You should define \$title variable with page title"; |
$title = "You should define \$title variable with page title"; |
1888 |
include($inc_file); |
include($inc_file); |