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,1) ; |
if (!is_dir($fsDir)) Error("Dir not found",$relDir,1) ; |
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 |
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 |
1443 |
|
|
1444 |
global $debug; |
global $debug; |
1445 |
$debug.="<br>check_perm: <tt>$path</tt> test perm ".display_trustee($perm)."<br>\n"; |
$debug.="<br>check_perm: <tt>$path</tt> test perm ".display_trustee($perm)."<br>\n"; |
1446 |
|
|
1447 |
$return = ! $HAVE_TRUSTEE; |
$return = ! $HAVE_TRUSTEE; |
1448 |
if ($HAVE_TRUSTEE) { |
if ($HAVE_TRUSTEE) { |
1449 |
$perm = check_trustee($gblLogin,$path); |
$perm = check_trustee($gblLogin,$path); |
1546 |
} |
} |
1547 |
|
|
1548 |
// if no password, or empty password logout |
// if no password, or empty password logout |
|
$relogin = $HTTP_GET_VARS[relogin]; |
|
|
$force_login = $HTTP_GET_VARS[force_login]; |
|
1549 |
if ( |
if ( |
1550 |
isset($gblLogin) && ( |
isset($gblLogin) && ( |
1551 |
!isset($relogin) || ( |
!isset($relogin) || ( |
1569 |
// get ACL informations |
// get ACL informations |
1570 |
$HAVE_TRUSTEE = init_trustee(); |
$HAVE_TRUSTEE = init_trustee(); |
1571 |
|
|
1572 |
|
// take additional login vars |
1573 |
|
$relogin = $HTTP_GET_VARS[relogin]; |
1574 |
|
$force_login = $HTTP_GET_VARS[force_login]; |
1575 |
|
|
1576 |
if (strtolower($gblLogin) == "anonymous" || !isset($gblPasswd)) { |
if (strtolower($gblLogin) == "anonymous" || !isset($gblPasswd)) { |
1577 |
$perm = check_trustee($gblLogin,$path); |
$perm = check_trustee("anonymous",$path); |
1578 |
// browsing must be explicitly allowed for root directory |
// browsing must be explicitly allowed for root directory |
1579 |
// of repository for anonymous user to work! |
// of repository for anonymous user to work! |
1580 |
if ($perm[allow] & trperm_b) { |
if ($perm[allow] & trperm_b) { |
1620 |
$relDir = $D; |
$relDir = $D; |
1621 |
} |
} |
1622 |
|
|
|
if ($relDir == "/") $relDir = "" ; |
|
|
|
|
1623 |
$relScriptDir = dirname($SCRIPT_NAME) ; |
$relScriptDir = dirname($SCRIPT_NAME) ; |
1624 |
// i.e. /docman |
// i.e. /docman |
1625 |
|
|
1628 |
// i.e. /home/httpd/repository |
// i.e. /home/httpd/repository |
1629 |
|
|
1630 |
$fsDir = $gblFsRoot . $relDir ; // current directory |
$fsDir = $gblFsRoot . $relDir ; // current directory |
1631 |
if ( !is_dir($fsDir) ) Error("Dir not found",$relDir,1) ; |
if ( !is_dir($fsDir) ) Error("Dir not found","Can't find <tt>$relDir</tt> which points to <tt>$fsDir</tt>",1) ; |
1632 |
|
|
1633 |
if (isset($HTTP_SERVER_VARS["HTTPS"]) && $HTTP_SERVER_VARS["HTTPS"] == "on") { |
if (isset($HTTP_SERVER_VARS["HTTPS"]) && $HTTP_SERVER_VARS["HTTPS"] == "on") { |
1634 |
$webRoot = "https://"; |
$webRoot = "https://"; |
1824 |
switch ($A) { |
switch ($A) { |
1825 |
case "U" : |
case "U" : |
1826 |
// upload to $relDir |
// upload to $relDir |
1827 |
|
if (! check_perm($relDir, trperm_w)) |
1828 |
|
Error("Write access denied","You don't have permission to write in <tt>$relDir</tt>"); |
1829 |
if (!is_writeable($gblFsRoot . $relDir)) |
if (!is_writeable($gblFsRoot . $relDir)) |
1830 |
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); |
1831 |
$text = "Use this page to upload a single " ; |
$text = "Use this page to upload a single " ; |
1832 |
$text .= "file to <B>$realm</B>." ; |
$text .= "file to <B>$realm</B>." ; |
1833 |
StartHTML("(Upload Page)", $text) ; |
StartHTML("(Upload Page)", $text) ; |