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> |
577 |
|
|
578 |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
579 |
$gblIgnoreUnknownFileType, $gblRepositoryDir, |
$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 |
|
|
|
if ($relDir == "") $relDir = "/"; |
|
|
|
|
585 |
$fsDir = $fsRoot.$relDir."/"; // current directory |
$fsDir = $fsRoot.$relDir."/"; // current directory |
586 |
|
|
587 |
if (!is_dir($fsDir)) Error("Dir not found",$relDir) ; |
if (!is_dir($fsDir)) Error("Dir not found",$relDir,1) ; |
588 |
|
|
589 |
$hide_items=",$gblHide,"; |
$hide_items=",$gblHide,"; |
590 |
|
|
637 |
echo "<TABLE BORDER=0 CELLPADDING=2 |
echo "<TABLE BORDER=0 CELLPADDING=2 |
638 |
CELLSPACING=3 WIDTH=\"100%\">" ; |
CELLSPACING=3 WIDTH=\"100%\">" ; |
639 |
|
|
640 |
// updir bar |
// updir (parent) bar |
641 |
if (chopsl($fsDir) != chopsl($fsRoot)) { |
if (chopsl($fsDir) != chopsl($fsRoot)) { |
642 |
$parent = dirname($relDir) ; |
$parent = dirname($relDir) ; |
643 |
if ($parent == "") $parent = "/" ; |
if ($parent == "") $parent = "/" ; |
717 |
$dir = $dirList[$key]; |
$dir = $dirList[$key]; |
718 |
|
|
719 |
$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)); |
720 |
$dir_url=$self."?D=".urlencode($relDir."/".$dir); |
$dir_url=$self."?D=".urlencode(chopsl($relDir)."/".$dir); |
721 |
include("$html/Navigate-dirEntry.html"); |
include("$html/Navigate-dirEntry.html"); |
722 |
|
|
723 |
} // iterate over dirs |
} // iterate over dirs |
864 |
|
|
865 |
<? |
<? |
866 |
|
|
867 |
if (file_exists("$gblRepositoryDir/.info.inc")) { |
if (file_exists("$fsRealmDir/$realm".$realm_sep."info.inc")) { |
868 |
|
print "<TR><TD></TD><TD COLSPAN=5>"; |
869 |
|
include("$fsRealmDir/$realm".$realm_sep."info.inc"); |
870 |
|
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
871 |
|
} elseif (file_exists("$gblRepositoryDir/.info.inc")) { |
872 |
print "<TR><TD></TD><TD COLSPAN=5>"; |
print "<TR><TD></TD><TD COLSPAN=5>"; |
873 |
include("$gblRepositoryDir/.info.inc"); |
include("$gblRepositoryDir/.info.inc"); |
874 |
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
875 |
} |
} |
876 |
|
|
877 |
|
|
878 |
?> |
?> |
879 |
|
|
880 |
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
902 |
global $html, $HTTP_SERVER_VARS; |
global $html, $HTTP_SERVER_VARS; |
903 |
|
|
904 |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
|
if ($relDir == "") $relDir = "/" ; |
|
|
|
|
905 |
include("$html/UploadPage.html"); |
include("$html/UploadPage.html"); |
906 |
|
|
907 |
} // end function UploadPage |
} // end function UploadPage |
911 |
// Error with sysadmin flag are reported to error_log or hidden from |
// Error with sysadmin flag are reported to error_log or hidden from |
912 |
// users |
// users |
913 |
|
|
914 |
function Error($title,$text="",$sysadmin=0) { |
function Error($title,$text="",$sysadmin=0,$no_404=0) { |
915 |
global $gblSeparateAdminMessages, |
global $gblSeparateAdminMessages, |
916 |
$gblMailAdminMessages,$realm, |
$gblMailAdminMessages,$realm, |
917 |
$HTTP_SERVER_VARS; |
$HTTP_SERVER_VARS; |
918 |
if (! headers_sent()) header("HTTP/1.0 404 Not Found"); |
if (! headers_sent() && ! $no_404) header("HTTP/1.0 404 Not Found"); |
919 |
if ($sysadmin) { |
if ($sysadmin) { |
920 |
if ($gblSeparateAdminMessages) { |
if ($gblSeparateAdminMessages) { |
921 |
$user="Your administrator "; |
$user="Your administrator "; |
1213 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1214 |
|
|
1215 |
function chopsl($path) { |
function chopsl($path) { |
|
if (substr($path,strlen($path)-1,1) == "/") $path=substr($path,0,strlen($path)-1); |
|
1216 |
$path=str_replace("//","/",$path); |
$path=str_replace("//","/",$path); |
1217 |
|
if (substr($path,strlen($path)-1,1) == "/") $path=substr($path,0,strlen($path)-1); |
1218 |
return $path; |
return $path; |
1219 |
} |
} |
1220 |
|
|
1371 |
}//init_trustee |
}//init_trustee |
1372 |
|
|
1373 |
function in_group($user,$group) { |
function in_group($user,$group) { |
1374 |
return in_array($groups[$group],$user); |
global $groups; |
1375 |
|
return in_array($user,$groups[$group]); |
1376 |
} |
} |
1377 |
|
|
1378 |
// helper function |
// helper function |
1379 |
function unroll_perm($u,$t,$user,$perm) { |
function unroll_perm($u,$t,$user,$perm) { |
1380 |
// check user |
|
1381 |
|
// check user FIX |
1382 |
if ($t & trmask_not && ($u==$user)) continue; |
if ($t & trmask_not && ($u==$user)) continue; |
1383 |
if (!($t & trmask_not) && ($u!=$user)) continue; |
if (!($t & trmask_not) && ($u!=$user)) continue; |
1384 |
|
|
1404 |
$path = "/"; |
$path = "/"; |
1405 |
while (count($path_arr)) { |
while (count($path_arr)) { |
1406 |
if (substr($path,strlen($path)-1,1) != "/") $path.="/"; |
if (substr($path,strlen($path)-1,1) != "/") $path.="/"; |
|
$path.=array_shift($path_arr); |
|
1407 |
$tr = $trustees[$path]; |
$tr = $trustees[$path]; |
|
|
|
1408 |
if (isset($tr)) { |
if (isset($tr)) { |
1409 |
// first apply trustee for all |
// first apply trustee for all |
1410 |
if (isset($tr['*'])) { |
if (isset($tr['*'])) { |
1412 |
unset($tr['*']); |
unset($tr['*']); |
1413 |
} |
} |
1414 |
// then apply group policies |
// then apply group policies |
1415 |
foreach ($tr as $u=>$t) { |
foreach ($tr as $g=>$t) { |
1416 |
if ($t & trmask_group && in_group($user,$u)) { |
if ($t & trmask_group && in_group($user,$g)) { |
1417 |
// resolv user |
// resolv user |
1418 |
$t = $t & ~trmask_group; |
$t = $t & ~trmask_group; |
1419 |
$u = $user; |
$perm = unroll_perm($user,$t,$user, $perm); |
1420 |
$perm = unroll_perm($u,$t,$user, $perm); |
unset($tr[$g]); |
|
unset($tr[$u]); |
|
1421 |
} |
} |
1422 |
} |
} |
1423 |
// then apply use policy |
// then apply user policy |
1424 |
if (isset($tr[$user])) { |
if (isset($tr[$user])) { |
1425 |
$perm = unroll_perm($user,$tr[$user],$user, $perm); |
$perm = unroll_perm($user,$tr[$user],$user, $perm); |
1426 |
unset($tr[$user]); |
unset($tr[$user]); |
1427 |
} |
} |
1428 |
|
$path.=array_shift($path_arr); |
1429 |
} |
} |
1430 |
|
|
1431 |
} |
} |
1438 |
|
|
1439 |
function check_perm($path,$trperm) { |
function check_perm($path,$trperm) { |
1440 |
global $gblLogin,$HAVE_TRUSTEE; |
global $gblLogin,$HAVE_TRUSTEE; |
1441 |
print "<br>check_perm: <tt>$path</tt> test perm ".display_trustee($perm)."<br>\n"; |
|
1442 |
|
global $debug; |
1443 |
|
$debug.="<br>check_perm: <tt>$path</tt> test perm ".display_trustee($perm)."<br>\n"; |
1444 |
|
|
1445 |
$return = ! $HAVE_TRUSTEE; |
$return = ! $HAVE_TRUSTEE; |
1446 |
if ($HAVE_TRUSTEE) { |
if ($HAVE_TRUSTEE) { |
1447 |
$perm = check_trustee($gblLogin,$path); |
$perm = check_trustee($gblLogin,$path); |
1448 |
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"; |
1449 |
if ($perm[deny] & $trperm) $return=0; |
if ($perm[deny] & $trperm) $return=0; |
1450 |
elseif ($perm[allow] & $trperm) $return=1; |
elseif ($perm[allow] & $trperm) $return=1; |
1451 |
} |
} |
1452 |
print " return: $return<br>\n"; |
$debug.=" return: $return<br>\n"; |
1453 |
return($return); |
return($return); |
1454 |
} |
} |
1455 |
|
|
1479 |
} |
} |
1480 |
|
|
1481 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1482 |
|
|
1483 |
|
// check for invalid characters in filename and dirname (.. and /) |
1484 |
|
|
1485 |
|
function check_dirname($file) { |
1486 |
|
if (strstr($file,"..")) Error("Security violation","No parent dir <tt>..</tt> allowed in directory name <tt>$file</tt>",1); |
1487 |
|
} |
1488 |
|
|
1489 |
|
function check_filename($file) { |
1490 |
|
if (strstr($file,"..")) Error("Security violation","No parent dir <tt>..</tt> allowed in file name <tt>$file</tt>",1); |
1491 |
|
if (strstr($file,"/")) Error("Security violation","No slashes <tt>/</tt> allowed in file name <tt>$file</tt>",1); |
1492 |
|
} |
1493 |
|
|
1494 |
|
////////////////////////////////////////////////////////////////// |
1495 |
// MAIN PROGRAM |
// MAIN PROGRAM |
1496 |
|
|
1497 |
$gblFilePerms = 0640 ; // default for new files |
$gblFilePerms = 0640 ; // default for new files |
1516 |
if (! isset($fsRealmDir)) { |
if (! isset($fsRealmDir)) { |
1517 |
$fsRealmDir = "$gblIncDir/realm"; |
$fsRealmDir = "$gblIncDir/realm"; |
1518 |
} |
} |
1519 |
$realm_config = "$fsRealmDir/$realm.conf"; |
|
1520 |
|
// try to add dir to script name to realm var |
1521 |
|
if (is_dir("$fsRealmDir/$realm/".dirname($HTTP_SERVER_VARS[SCRIPT_NAME]))) { |
1522 |
|
$realm .= dirname($HTTP_SERVER_VARS[SCRIPT_NAME]); |
1523 |
|
$realm_sep = "/"; |
1524 |
|
} else { |
1525 |
|
$realm_sep = "."; |
1526 |
|
} |
1527 |
|
|
1528 |
|
$realm_config = $fsRealmDir."/".$realm.$realm_sep."conf"; |
1529 |
|
|
1530 |
// read user-defined configuration |
// read user-defined configuration |
1531 |
if (file_exists($realm_config)) { |
if (file_exists($realm_config)) { |
1561 |
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); |
1562 |
|
|
1563 |
// trustee (ACL) file configuration |
// trustee (ACL) file configuration |
1564 |
$trustee_conf="$gblIncDir/realm/$realm.trustee"; |
$trustee_conf="$fsRealmDir/$realm".$realm_sep."trustee"; |
1565 |
// compiled version of trustee file |
// compiled version of trustee file |
1566 |
$trustee_php="$gblRepositoryDir/.trustee.php"; |
$trustee_php="$gblRepositoryDir/.trustee.php"; |
1567 |
// get ACL informations |
// get ACL informations |
1568 |
$HAVE_TRUSTEE = init_trustee(); |
$HAVE_TRUSTEE = init_trustee(); |
1569 |
|
|
1570 |
|
// take additional login vars |
1571 |
|
$relogin = $HTTP_GET_VARS[relogin]; |
1572 |
|
$force_login = $HTTP_GET_VARS[force_login]; |
1573 |
|
|
1574 |
if (strtolower($gblLogin) == "anonymous" || !isset($gblPasswd)) { |
if (strtolower($gblLogin) == "anonymous" || !isset($gblPasswd)) { |
1575 |
$perm = check_trustee($gblLogin,$path); |
$perm = check_trustee("anonymous",$path); |
1576 |
// browsing must be explicitly allowed for root directory |
// browsing must be explicitly allowed for root directory |
1577 |
// of repository for anonymous user to work! |
// of repository for anonymous user to work! |
1578 |
if ($perm[allow] & trperm_b) { |
if ($perm[allow] & trperm_b) { |
1586 |
isset($relogin) && $secHash == $relogin) { |
isset($relogin) && $secHash == $relogin) { |
1587 |
header("WWW-authenticate: basic realm=\"$realm\"") ; |
header("WWW-authenticate: basic realm=\"$realm\"") ; |
1588 |
header("HTTP/1.0 401 Unauthorized") ; |
header("HTTP/1.0 401 Unauthorized") ; |
1589 |
Error("401 Unauthorized","No trespassing !"); |
Error("401 Unauthorized","No trespassing !",0,1); |
1590 |
} |
} |
1591 |
|
|
1592 |
|
|
1593 |
// read mime.types |
// read mime.types |
1594 |
readMime(); |
readMime(); |
1595 |
|
|
1596 |
// get current directory relative to $gblFsRoot |
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") { |
1597 |
$relDir = $DIR ; // from POST |
// take variables from server |
1598 |
if ($relDir == "") { // not defined in POST ? |
$FN=stripSlashes($HTTP_POST_VARS["FN"]); |
1599 |
$relDir = urldecode($D) ; // then use GET |
$DIR=stripSlashes($HTTP_POST_VARS["DIR"]); |
1600 |
} |
$RELPATH=stripSlashes($HTTP_POST_VARS["RELPATH"]); |
1601 |
|
$T=stripSlashes($HTTP_POST_VARS["T"]); |
1602 |
$relDir=stripSlashes($relDir); |
$CONFIRM=stripSlashes($HTTP_POST_VARS["CONFIRM"]); |
1603 |
|
|
1604 |
if ($relDir == "/") $relDir = "" ; |
check_filename($FN); |
1605 |
// default : website root = "" |
check_dirname($DIR); |
1606 |
|
check_dirname($RELPATH); |
1607 |
if (strstr($relDir,"..")) Error("No updirs allowed"); |
|
1608 |
|
$relDir = $DIR; |
1609 |
// full paths contain "fs" or "Fs". Paths realitve to root of |
} else { |
1610 |
// website contain "rel" or "Rel". The script won't let you |
// get |
1611 |
// edit anything above directory equal to http://server.com |
$A=stripSlashes($HTTP_GET_VARS["A"]); |
1612 |
// i.e. below $gblFsRoot. |
$D=stripSlashes(urldecode($HTTP_GET_VARS["D"])); |
1613 |
|
$F=stripSlashes($HTTP_GET_VARS["F"]); |
1614 |
|
|
1615 |
|
check_filename($F); |
1616 |
|
check_dirname($D); |
1617 |
|
|
1618 |
|
$relDir = $D; |
1619 |
|
} |
1620 |
|
|
1621 |
$relScriptDir = dirname($SCRIPT_NAME) ; |
$relScriptDir = dirname($SCRIPT_NAME) ; |
1622 |
// i.e. /docman |
// i.e. /docman |
1623 |
|
|
1624 |
// start on server root |
// start on server root |
1625 |
$gblFsRoot = $gblRepositoryDir; |
$gblFsRoot = $gblRepositoryDir; |
1626 |
// i.e. /home/httpd/html |
// i.e. /home/httpd/repository |
1627 |
|
|
1628 |
$fsDir = $gblFsRoot . $relDir ; // current directory |
$fsDir = $gblFsRoot . $relDir ; // current directory |
1629 |
if ( !is_dir($fsDir) ) Error("Dir not found",$relDir) ; |
if ( !is_dir($fsDir) ) Error("Dir not found","Can't find <tt>$relDir</tt> which points to <tt>$fsDir</tt>",1) ; |
1630 |
|
|
1631 |
if (isset($HTTP_SERVER_VARS["HTTPS"]) && $HTTP_SERVER_VARS["HTTPS"] == "on") { |
if (isset($HTTP_SERVER_VARS["HTTPS"]) && $HTTP_SERVER_VARS["HTTPS"] == "on") { |
1632 |
$webRoot = "https://"; |
$webRoot = "https://"; |
1635 |
} |
} |
1636 |
$webRoot .= $HTTP_SERVER_VARS["HTTP_HOST"] . $relScriptDir; |
$webRoot .= $HTTP_SERVER_VARS["HTTP_HOST"] . $relScriptDir; |
1637 |
|
|
|
// 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"]); |
|
|
|
|
1638 |
switch ($HTTP_POST_VARS["POSTACTION"]) { |
switch ($HTTP_POST_VARS["POSTACTION"]) { |
1639 |
case "UPLOAD" : |
case "UPLOAD" : |
1640 |
$FN_name=stripSlashes($HTTP_POST_FILES["FN"]["tmp_name"]); |
$FN_name=stripSlashes($HTTP_POST_FILES["FN"]["tmp_name"]); |
1647 |
} |
} |
1648 |
|
|
1649 |
$FILENAME = $HTTP_POST_VARS["FILENAME"]; |
$FILENAME = $HTTP_POST_VARS["FILENAME"]; |
1650 |
if (strstr($FILENAME,"/")) |
check_filename($FILENAME); |
1651 |
Error("Upload error","Non-conforming filename. Filename <tt>$FILENAME</tt> has slashes (<tt>/</tt>) in it.") ; |
|
1652 |
if (! isset($FILENAME)) { // from update file |
if (! isset($FILENAME)) { // from update file |
1653 |
$target = "$fsDir/".basename($FN); |
$target = "$fsDir/".basename($FN); |
1654 |
} else { |
} else { |
1816 |
// $A=Co : checkout file $D/$F |
// $A=Co : checkout file $D/$F |
1817 |
// $A=Ci : checkin file $D/$F |
// $A=Ci : checkin file $D/$F |
1818 |
// $A=V : view file (do nothing except log) |
// $A=V : view file (do nothing except log) |
1819 |
// $A=I : include file .$F.php from $gblFsRoot |
// $A=I : include file .$F.php from [$gblIncDir|realm]/include_php |
1820 |
// default : display directory $D |
// default : display directory $D |
1821 |
|
|
1822 |
switch ($A) { |
switch ($A) { |
1823 |
case "U" : |
case "U" : |
1824 |
// upload to $relDir |
// upload to $relDir |
1825 |
|
if (! check_perm($relDir, trperm_w)) |
1826 |
|
Error("Write access denied","You don't have permission to write in <tt>$relDir</tt>"); |
1827 |
if (!is_writeable($gblFsRoot . $relDir)) |
if (!is_writeable($gblFsRoot . $relDir)) |
1828 |
Error("Write access denied",$relDir) ; |
Error("Write access denied","User <tt>$gblLogin</tt> has permission on <tt>$relDir</tt>, but directory is not writable",1); |
1829 |
$text = "Use this page to upload a single " ; |
$text = "Use this page to upload a single " ; |
1830 |
$text .= "file to <B>$realm</B>." ; |
$text .= "file to <B>$realm</B>." ; |
1831 |
StartHTML("(Upload Page)", $text) ; |
StartHTML("(Upload Page)", $text) ; |
1873 |
EndHTML() ; |
EndHTML() ; |
1874 |
exit; |
exit; |
1875 |
case "I" : |
case "I" : |
1876 |
$F=stripSlashes($F); |
if (! isset($F) || $F == "") |
1877 |
$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); |
1878 |
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"; |
1879 |
|
if (! file_exists($inc_file)) { |
1880 |
|
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); |
1881 |
|
} |
1882 |
if (!is_readable($inc_file)) |
if (!is_readable($inc_file)) |
1883 |
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); |
1884 |
$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"; |
1885 |
$title = "You should define \$title variable with page title"; |
$title = "You should define \$title variable with page title"; |
1886 |
include($inc_file); |
include($inc_file); |