90 |
if ($fsDocumentRoot == "") Error("Configuration error","Can't get SCRIPT_FILENAME from your web server. Please set <tt>\$fsDocumentRoot</tt> in <tt>\$</tt>",1); |
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 = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; |
$gblLogin = HTTP_SERVER_VAR("PHP_AUTH_USER"); |
94 |
$gblPasswd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; |
$gblPasswd = HTTP_SERVER_VAR("PHP_AUTH_PW"); |
95 |
|
|
96 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
97 |
|
|
155 |
|
|
156 |
function DetailPage($fsRoot,$relDir,$fn) { |
function DetailPage($fsRoot,$relDir,$fn) { |
157 |
|
|
158 |
global $gblEditable, $gblImages, $webRoot, $html, $HTTP_SERVER_VARS ; |
global $gblEditable, $gblImages, |
159 |
|
$gblDateFmt, $gblTimeFmt, |
160 |
|
$webRoot, $html, |
161 |
|
$HTTP_SERVER_VARS ; |
162 |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
$self = $HTTP_SERVER_VARS["PHP_SELF"] ; |
163 |
|
|
164 |
$relPath = $relDir . "/" . $fn ; |
$relPath = $relDir . "/" . $fn ; |
191 |
echo "<H3>" . $relDir . "/" . $fn . "</H3>" ; |
echo "<H3>" . $relDir . "/" . $fn . "</H3>" ; |
192 |
if ($exists) { // get file info |
if ($exists) { // get file info |
193 |
$fsize = filesize($fsPath) ; |
$fsize = filesize($fsPath) ; |
194 |
$fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ; |
$fmodified = date("$gblDateFmt $gblTimeFmt", filemtime($fsPath)) ; |
195 |
$faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ; |
$faccessed = date("$gblDateFmt $gblTimeFmt", fileatime($fsPath)) ; |
196 |
$fuid=fileowner($fsPath); |
$fuid=fileowner($fsPath); |
197 |
$fgid=filegroup($fsPath); |
$fgid=filegroup($fsPath); |
198 |
$userinfo = posix_getpwuid($fuid); |
$userinfo = posix_getpwuid($fuid); |
581 |
|
|
582 |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
583 |
$gblIgnoreUnknownFileType, $gblRepositoryDir, |
$gblIgnoreUnknownFileType, $gblRepositoryDir, |
584 |
$gblLogin, |
$gblLogin, $gblUserName, $gblDateFmt, $gblTimeFmt, |
585 |
$fsRealmDir, $realm, $realm_sep, |
$fsRealmDir, $realm, $realm_sep, |
586 |
$html, $realm_config, |
$html, $realm_config, |
587 |
$HTTP_GET_VARS, $HTTP_SERVER_VARS; |
$HTTP_GET_VARS, $HTTP_SERVER_VARS; |
596 |
global $debug; |
global $debug; |
597 |
$debug .= "[$gblLogin|$relDir] before >"; |
$debug .= "[$gblLogin|$relDir] before >"; |
598 |
|
|
599 |
if (! check_perm($relDir,(trperm_b | trperm_r))) |
if (! check_perm($relDir,trperm_b)) |
600 |
Error("Access denied","User <tt>$gblLogin</tt> tried to access <tt>$relDir</tt> without valid trustee.",1); |
Error("Access denied","User <tt>$gblLogin</tt> tried to access <tt>$relDir</tt> without valid trustee.",1); |
601 |
$debug .= "< afeter"; |
$debug .= "< afeter"; |
602 |
|
|
819 |
$ext = strtolower(strrchr($file,".")) ; |
$ext = strtolower(strrchr($file,".")) ; |
820 |
|
|
821 |
if ($file_lock) { |
if ($file_lock) { |
822 |
if ($file_lock == $GLOBALS[gblUserName]) { |
if ($file_lock == $gblUserName) { |
823 |
$b.="<A HREF=\"$self?A=Ci&D=".urlencode($relDir)."&F=".urlencode($file); |
$b.="<A HREF=\"$self?A=Ci&D=".urlencode($relDir)."&F=".urlencode($file); |
824 |
$b.="\" TITLE=\"Checkin (update) file on server\">" ; |
$b.="\" TITLE=\"Checkin (update) file on server\">" ; |
825 |
$file_url_html=$b; |
$file_url_html=$b; |
847 |
} |
} |
848 |
} |
} |
849 |
|
|
850 |
$mod = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]",$mod); |
$mod = date("$gblDateFmt $gblTimeFmt",$mod); |
851 |
|
|
852 |
include("$html/Navigate-fileEntry.html"); |
include("$html/Navigate-fileEntry.html"); |
853 |
|
|
959 |
|
|
960 |
function LogIt($target,$msg, $changelog=0) { |
function LogIt($target,$msg, $changelog=0) { |
961 |
|
|
962 |
|
global $gblDateFmt, $gblTimeFmt, $gblUserName, $gblFsRoot; |
963 |
|
|
964 |
$dir=dirname($target); |
$dir=dirname($target); |
965 |
if (! file_exists($dir."/.log")) { |
if (! file_exists($dir."/.log")) { |
966 |
if (! @mkdir($dir."/.log",0700)) Error("docman installation problem","can't create log directory <tt>$dir/.log</tt>",1); |
if (! @mkdir($dir."/.log",0700)) Error("docman installation problem","can't create log directory <tt>$dir/.log</tt>",1); |
968 |
$file=basename($target); |
$file=basename($target); |
969 |
|
|
970 |
$log=fopen("$dir/.log/$file","a+"); |
$log=fopen("$dir/.log/$file","a+"); |
971 |
fputs($log,date("$GLOBALS[gblDateFmt]\t$GLOBALS[gblTimeFmt]"). |
fputs($log,date("$gblDateFmt\t$gblTimeFmt"). |
972 |
"\t$GLOBALS[gblUserName]\t$msg\n"); |
"\t$gblUserName\t$msg\n"); |
973 |
fclose($log); |
fclose($log); |
974 |
|
|
975 |
if (! $changelog) return; |
if (! $changelog) return; |
976 |
|
|
|
global $gblFsRoot; |
|
977 |
$log=fopen("$gblFsRoot/.changelog","a+"); |
$log=fopen("$gblFsRoot/.changelog","a+"); |
978 |
if (substr($target,0,strlen($gblFsRoot)) == $gblFsRoot) |
if (substr($target,0,strlen($gblFsRoot)) == $gblFsRoot) |
979 |
$target=substr($target,strlen($gblFsRoot),strlen($target)-strlen($gblFsRoot)); |
$target=substr($target,strlen($gblFsRoot),strlen($target)-strlen($gblFsRoot)); |
980 |
$msg=str_replace("\t"," ",$msg); |
$msg=str_replace("\t"," ",$msg); |
981 |
fputs($log,time()."\t$target\t$GLOBALS[gblUserName]\t$msg\n"); |
fputs($log,time()."\t$target\t$gblUserName\t$msg\n"); |
982 |
fclose($log); |
fclose($log); |
983 |
|
|
984 |
// FIX: implement e-mail notification based on $changelog |
// FIX: implement e-mail notification based on $changelog |
1038 |
|
|
1039 |
function Lock($target) { |
function Lock($target) { |
1040 |
|
|
1041 |
|
global $gblUserName; |
1042 |
|
|
1043 |
$target=stripSlashes($target); |
$target=stripSlashes($target); |
1044 |
$dir=dirname($target); |
$dir=dirname($target); |
1045 |
if (! file_exists($dir."/.lock")) { |
if (! file_exists($dir."/.lock")) { |
1051 |
LogIt($target,"attempt to locked allready locked file!"); |
LogIt($target,"attempt to locked allready locked file!"); |
1052 |
} else { |
} else { |
1053 |
$lock=fopen("$dir/.lock/$file","w"); |
$lock=fopen("$dir/.lock/$file","w"); |
1054 |
fputs($lock,"$GLOBALS[gblUserName]\n"); |
fputs($lock,"$gblUserName\n"); |
1055 |
fclose($lock); |
fclose($lock); |
1056 |
|
|
1057 |
LogIt($target,"file locked"); |
LogIt($target,"file locked"); |
1100 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1101 |
|
|
1102 |
function safe_rename($fromdir,$fromfile,$tofile) { |
function safe_rename($fromdir,$fromfile,$tofile) { |
1103 |
|
|
1104 |
|
global $gblNumBackups; |
1105 |
|
|
1106 |
function try_rename($from,$to) { |
function try_rename($from,$to) { |
1107 |
# print "$from -> $to\n"; |
# print "$from -> $to\n"; |
1108 |
if (file_exists($from) && is_writeable(dirname($to))) { |
if (file_exists($from) && is_writeable(dirname($to))) { |
1132 |
try_dir("$todir/.lock"); |
try_dir("$todir/.lock"); |
1133 |
try_rename("$fromdir/.lock/$fromfile","$todir/.lock/$tofile"); |
try_rename("$fromdir/.lock/$fromfile","$todir/.lock/$tofile"); |
1134 |
try_dir("$todir/.bak"); |
try_dir("$todir/.bak"); |
1135 |
for($i=0;$i<=$GLOBALS[gblNumBackups];$i++) { |
for($i=0;$i<=$gblNumBackups;$i++) { |
1136 |
try_rename("$fromdir/.bak/$i/$fromfile","$todir/.bak/$i/$tofile"); |
try_rename("$fromdir/.bak/$i/$fromfile","$todir/.bak/$i/$tofile"); |
1137 |
} |
} |
1138 |
} |
} |
1160 |
|
|
1161 |
function DisplayChangeLog($day) { |
function DisplayChangeLog($day) { |
1162 |
|
|
1163 |
global $gblFsRoot,$HTTP_SERVER_VARS; |
global $gblFsRoot, $gblDateFmt, $gblTimeFmt, |
1164 |
|
$HTTP_SERVER_VARS; |
1165 |
|
|
1166 |
|
$self = $HTTP_SERVER_VARS["PHP_SELF"]; |
1167 |
|
|
1168 |
if (!file_exists("$gblFsRoot/.changelog")) return; |
if (!file_exists("$gblFsRoot/.changelog")) return; |
1169 |
$log=fopen("$gblFsRoot/.changelog","r"); |
$log=fopen("$gblFsRoot/.changelog","r"); |
1182 |
print "<table border=0 width=100%>\n"; |
print "<table border=0 width=100%>\n"; |
1183 |
while ($e = array_shift($logarr)) { |
while ($e = array_shift($logarr)) { |
1184 |
$cl=$cl1; $cl1=$cl2; $cl2=$cl; |
$cl=$cl1; $cl1=$cl2; $cl2=$cl; |
1185 |
$date = date("$GLOBALS[gblDateFmt]", $e[0]); |
$date = date($gblDateFmt, $e[0]); |
1186 |
$time = date("$GLOBALS[gblTimeFmt]", $e[0]); |
$time = date($gblTimeFmt, $e[0]); |
1187 |
$dir = dirname($e[1]); |
$dir = dirname($e[1]); |
1188 |
$file = basename($e[1]); |
$file = basename($e[1]); |
1189 |
print "<tr><td$cl>$date</td><td$cl>$time</td><td$cl><a href=\"$HTTP_SERVER_VARS[PHP_SELF]?D=".urlencode($dir)."\">$dir</a>/$file</td><td$cl>$e[2]</td><td$cl>$e[3]</td></tr>\n"; |
print "<tr><td$cl>$date</td><td$cl>$time</td><td$cl><a href=\"$HTTP_SERVER_VARS[PHP_SELF]?D=".urlencode($dir)."\">$dir</a>/$file</td><td$cl>$e[2]</td><td$cl>$e[3]</td></tr>\n"; |
1190 |
} |
} |
1191 |
print "</table>"; |
print "</table>"; |
1192 |
print "<p>".GifIcon(up)." Back to <a href=$HTTP_SERVER_VARS[PHP_SELF]>front page</a>.</p>"; |
print "<p>".GifIcon("up")." Back to <a href=\"$self\">front page</a>.</p>"; |
1193 |
} |
} |
1194 |
|
|
1195 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1405 |
} |
} |
1406 |
|
|
1407 |
// helper function |
// helper function |
1408 |
function unroll_perm($u,$t,$user,$perm) { |
function unroll_perm($u,$t,$perm,$one_level) { |
1409 |
|
|
1410 |
// check user FIX |
if ($t & trmask_one_level && !$one_level) return $perm; |
|
if ($t & trmask_not && ($u==$user)) continue; |
|
|
if (!($t & trmask_not) && ($u!=$user)) continue; |
|
1411 |
|
|
1412 |
if ($t & trmask_deny) { |
if ($t & trmask_deny) { |
1413 |
if ($t & trmask_clear) { |
if ($t & trmask_clear) { |
1424 |
}// end of helper function |
}// end of helper function |
1425 |
|
|
1426 |
function check_trustee($user,$path) { |
function check_trustee($user,$path) { |
1427 |
global $trustees; |
global $trustees,$HAVE_TRUSTEE; |
1428 |
$perm['allow'] = 0; |
$perm['allow'] = 0; |
1429 |
$perm['deny'] = 0; |
$perm['deny'] = 0; |
1430 |
|
|
1431 |
if (! isset($trustees)) Error("Trustees not found","Can't find in-memory trustee structure \$trustees. Probably bug in code. Contact <tt>dpavlin@rot13.org</tt>",1); |
// do we use trustees? |
1432 |
|
if (! $HAVE_TRUSTEE) return $perm; |
1433 |
|
|
1434 |
|
if (! isset($trustees)) Error("Trustees not found","Can't find in-memory trustee structure <tt>\$trustees</tt>. Probably bug in code. Contact <tt>dpavlin@rot13.org</tt>",1); |
1435 |
|
|
1436 |
global $debug; |
global $debug; |
1437 |
$debug .= "<br>check_trustee $path ... "; |
$debug .= "<br>check_trustee $path ... "; |
1442 |
$tmppath.=array_shift($path_arr); |
$tmppath.=array_shift($path_arr); |
1443 |
$debug.= ">> $tmppath "; |
$debug.= ">> $tmppath "; |
1444 |
|
|
|
# clear one level flag |
|
|
$perm['allow'] &= ~trmask_one_level; |
|
|
$perm['deny'] &= ~trmask_one_level; |
|
|
|
|
1445 |
if (! isset($trustees[$tmppath])) continue; |
if (! isset($trustees[$tmppath])) continue; |
1446 |
$tr = $trustees[$tmppath]; |
$tr = $trustees[$tmppath]; |
1447 |
|
|
1448 |
|
$one_level = (!count($path_arr)); |
1449 |
|
$debug.=" O($one_level) "; |
1450 |
|
|
1451 |
if (isset($tr)) { |
if (isset($tr)) { |
1452 |
// first apply trustee for all |
// first apply trustee for all |
1453 |
if (isset($tr['*'])) { |
if (isset($tr['*'])) { |
1454 |
$perm = unroll_perm($user,$tr['*'],$user, $perm); |
$perm = unroll_perm($user,$tr['*'],$perm, $one_level); |
1455 |
unset($tr['*']); |
unset($tr['*']); |
1456 |
} |
} |
1457 |
// then apply group policies |
// then apply not and group policies |
1458 |
foreach ($tr as $g=>$t) { |
foreach ($tr as $g=>$t) { |
1459 |
if ($t & trmask_group && in_group($user,$g)) { |
if ($t & trmask_not && $g != $user) { |
1460 |
|
$t = $t & ~trmask_not; |
1461 |
|
$perm = unroll_perm($user,$t,$perm, $one_level); |
1462 |
|
unset($tr[$g]); |
1463 |
|
|
1464 |
|
} elseif ($t & trmask_group && in_group($user,$g)) { |
1465 |
// resolv user |
// resolv user |
1466 |
$t = $t & ~trmask_group; |
$t = $t & ~trmask_group; |
1467 |
$perm = unroll_perm($user,$t,$user, $perm); |
$perm = unroll_perm($user,$t,$perm, $one_level); |
1468 |
unset($tr[$g]); |
unset($tr[$g]); |
1469 |
} |
} |
1470 |
} |
} |
1471 |
// then apply user policy |
// then apply user policy |
1472 |
if (isset($tr[$user])) { |
if (isset($tr[$user])) { |
1473 |
$perm = unroll_perm($user,$tr[$user],$user, $perm); |
$perm = unroll_perm($user,$tr[$user],$perm,$one_level); |
1474 |
unset($tr[$user]); |
unset($tr[$user]); |
1475 |
} |
} |
1476 |
} |
} |
1545 |
// [replacement for register_globals in php.ini] |
// [replacement for register_globals in php.ini] |
1546 |
|
|
1547 |
function HTTP_GET_VAR($var) { |
function HTTP_GET_VAR($var) { |
1548 |
global $HTTP_GET_VARS, $GLOBALS; |
global $HTTP_GET_VARS, ${$var}; |
1549 |
if (isset($HTTP_GET_VARS[$var])) { |
if (isset($HTTP_GET_VARS[$var])) { |
1550 |
$GLOBALS[$var] = stripSlashes($HTTP_GET_VARS[$var]); |
$$var = stripSlashes($HTTP_GET_VARS[$var]); |
1551 |
return $GLOBALS[$var]; |
return $$var; |
1552 |
} |
} |
1553 |
} |
} |
1554 |
|
|
1555 |
function HTTP_POST_VAR($var) { |
function HTTP_POST_VAR($var) { |
1556 |
global $HTTP_GET_VARS, $GLOBALS; |
global $HTTP_POST_VARS, ${$var}; |
1557 |
if (isset($HTTP_GET_VARS[$var])) { |
if (isset($HTTP_POST_VARS[$var])) { |
1558 |
$GLOBALS[$var] = stripSlashes($HTTP_GET_VARS[$var]); |
$$var = $HTTP_POST_VARS[$var]; |
1559 |
return $GLOBALS[$var]; |
return $$var; |
1560 |
|
} |
1561 |
|
} |
1562 |
|
|
1563 |
|
function HTTP_SERVER_VAR($var) { |
1564 |
|
global $HTTP_SERVER_VARS, ${$var}; |
1565 |
|
if (isset($HTTP_SERVER_VARS[$var])) { |
1566 |
|
$$var = $HTTP_SERVER_VARS[$var]; |
1567 |
|
return $$var; |
1568 |
} |
} |
1569 |
} |
} |
1570 |
|
|
1587 |
// location of master docman configuration file |
// location of master docman configuration file |
1588 |
$docman_conf = "/etc/docman.conf"; |
$docman_conf = "/etc/docman.conf"; |
1589 |
if (! file_exists($docman_conf)) { |
if (! file_exists($docman_conf)) { |
1590 |
$error = "Can't find master configuration file $docman_conf. See docman2/doc/upgrade.html#docman_conf for more informations"; |
$error = "Can't find master configuration file <tt>$docman_conf</tt>. See <tt>docman2/doc/upgrade.html#docman_conf</tt> for more informations"; |
1591 |
|
|
1592 |
error_log("docman: $error"); |
error_log("docman: $error"); |
1593 |
Error("docman not installed completly",$error); |
Error("docman not installed completly",$error); |
1675 |
// read mime.types |
// read mime.types |
1676 |
readMime(); |
readMime(); |
1677 |
|
|
1678 |
|
HTTP_POST_VAR("FN"); |
1679 |
|
|
1680 |
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") { |
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") { |
1681 |
// take variables from server |
// take variables from server |
1682 |
if (HTTP_POST_VAR("FN")) check_filename($FN); |
if (HTTP_POST_VAR("FN")) |
1683 |
|
check_filename($FN); |
1684 |
if (HTTP_POST_VAR("DIR")) { |
if (HTTP_POST_VAR("DIR")) { |
1685 |
check_dirname($DIR); |
check_dirname($DIR); |
1686 |
$relDir = $DIR; |
$relDir = $DIR; |
1687 |
} else { |
} else { |
1688 |
trigger_error("Can't get DIR",E_USER_WARNING); |
trigger_error("Can't get DIR",E_USER_WARNING); |
1689 |
|
$relDir = "/"; |
1690 |
} |
} |
1691 |
if (HTTP_POST_VAR("RELPATH")) check_dirname($RELPATH); |
if (HTTP_POST_VAR("RELPATH")) check_dirname($RELPATH); |
1692 |
HTTP_POST_VAR("T"); |
HTTP_POST_VAR("T"); |
1693 |
HTTP_POST_VAR("CONFIRM"); |
HTTP_POST_VAR("CONFIRM"); |
|
|
|
1694 |
} else { |
} else { |
1695 |
// get |
// get |
1696 |
HTTP_GET_VAR("A"); |
HTTP_GET_VAR("A"); |
1735 |
Error("You must select file with browse to upload it!"); |
Error("You must select file with browse to upload it!"); |
1736 |
} |
} |
1737 |
|
|
1738 |
$FILENAME = $HTTP_POST_VARS["FILENAME"]; |
if (HTTP_POST_VAR("FILENAME")) check_filename($FILENAME); |
|
check_filename($FILENAME); |
|
1739 |
|
|
1740 |
if (! isset($FILENAME)) { // from update file |
if (! isset($FILENAME)) { // from update file |
1741 |
$target = "$fsDir/".basename($FN); |
$target = "$fsDir/".basename($FN); |
1748 |
if (! file_exists($dir."/.bak")) { |
if (! file_exists($dir."/.bak")) { |
1749 |
mkdir($dir."/.bak",0700); |
mkdir($dir."/.bak",0700); |
1750 |
} |
} |
1751 |
if (! file_exists($dir."/.bak/$GLOBALS[gblNumBackups]")) { |
if (! file_exists($dir."/.bak/$gblNumBackups")) { |
1752 |
mkdir($dir."/.bak/$GLOBALS[gblNumBackups]",0700); |
mkdir($dir."/.bak/$gblNumBackups",0700); |
1753 |
} |
} |
1754 |
$file=basename($target); |
$file=basename($target); |
1755 |
for($i=$GLOBALS[gblNumBackups]-1;$i>0;$i--) { |
for($i=$gblNumBackups-1;$i>0;$i--) { |
1756 |
MoveTo("$dir/.bak/$i/$file","$dir/.bak/".($i+1)."/"); |
MoveTo("$dir/.bak/$i/$file","$dir/.bak/".($i+1)."/"); |
1757 |
} |
} |
1758 |
MoveTo($target,$dir."/.bak/1/"); |
MoveTo($target,$dir."/.bak/1/"); |
1778 |
if (!($writable || (!$exists && $legaldir))) |
if (!($writable || (!$exists && $legaldir))) |
1779 |
Error("Write denied",$RELPATH) ; |
Error("Write denied",$RELPATH) ; |
1780 |
$fh = fopen($path, "w") ; |
$fh = fopen($path, "w") ; |
1781 |
$FILEDATA=stripSlashes($FILEDATA); |
HTTP_POST_VAR("FILEDATA"); |
1782 |
fwrite($fh,$FILEDATA) ; |
fwrite($fh,$FILEDATA) ; |
1783 |
fclose($fh) ; |
fclose($fh) ; |
1784 |
clearstatcache() ; |
clearstatcache() ; |
1787 |
|
|
1788 |
case "CREATE" : |
case "CREATE" : |
1789 |
// we know $fsDir exists |
// we know $fsDir exists |
1790 |
if ($FN == "") break; // no filename! |
if (! check_perm($relDir, trperm_w)) |
1791 |
|
Error("Write access denied","You don't have permission to write in <tt>$relDir</tt>"); |
1792 |
|
if ($T == "D") $type = "directory"; |
1793 |
|
else $type ="file"; |
1794 |
|
if ($FN == "") Error("Can't create $type","You must enter name of $type to create it."); |
1795 |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
if (!is_writeable($fsDir)) Error("Write denied",$relDir) ; |
1796 |
$path = $fsDir . "/" . $FN ; // file or dir to create |
$path = $fsDir . "/" . $FN ; // file or dir to create |
1797 |
$relPath = $relDir . "/" . $FN ; |
$relPath = $relDir . "/" . $FN ; |
1817 |
} else { |
} else { |
1818 |
Error("Creation of file $relPath failed -- $path"); |
Error("Creation of file $relPath failed -- $path"); |
1819 |
} |
} |
1820 |
$tstr = "$PHP_SELF?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ; |
$tstr = $HTTP_SERVER_VARS["PHP_SELF"]."?A=E&D=".urlencode($relDir)."&F=".urlencode($FN) ; |
1821 |
header("Location: " . $tstr) ; |
header("Location: " . $tstr) ; |
1822 |
exit ; |
exit ; |
1823 |
} |
} |
1896 |
|
|
1897 |
// common to all POSTs : redirect to directory view ($relDir) |
// common to all POSTs : redirect to directory view ($relDir) |
1898 |
if (isset($POSTACTION)) { |
if (isset($POSTACTION)) { |
1899 |
$tstr = $PHP_SELF . "?D=" . urlencode($relDir) ; |
$tstr = $HTTP_SERVER_VARS["PHP_SELF"]."?D=".urlencode($relDir); |
1900 |
header("Location: " . $tstr) ; |
header("Location: ".$tstr) ; |
1901 |
exit ; |
exit ; |
1902 |
} |
} |
1903 |
|
|