diff --git a/files.php b/files.php
index b357151..4fa9550 100644
--- a/files.php
+++ b/files.php
@@ -53,15 +53,8 @@ function fileManager_dir($directory, $return_link, $first_call=true) {
$fileAtts = "";
if ($serverType=="Linux") {
-
- //$ownerInfo = posix_getpwuid(fileowner($link));
- $ownerInfo = "ME";
-
$chmodInfo = substr(sprintf('%o', fileperms($link)), -4);
-
- if ($ownerInfo!="nobody"&&(substr($chmodInfo, -1)!=2&&substr($chmodInfo, -1)!=3&&substr($chmodInfo, -1)!=6&&substr($chmodInfo, -1)!=7)) {
- $fileAtts = "
";
- }
+ $fileAtts = ''.$chmodInfo.'';
}
$fileManager = "
";
$fileManager .= "- / [ROOT] ".$fileAtts."";
@@ -84,17 +77,26 @@ function fileManager_dir($directory, $return_link, $first_call=true) {
$dirRep = str_replace("\\","/",$directory);
$link = str_replace("[link]", "$dirRep/" . urlencode($this_file), $return_link);
$link = str_replace("//","/",$link);
- $fileAtts = "";
- if ($serverType=="Linux") {
- //$ownerInfo = posix_getpwuid(fileowner($link));
- $chmodInfo = substr(sprintf('%o', fileperms($link)), -4);
- if ($ownerInfo!="nobody"&&(substr($chmodInfo, -1)!=2&&substr($chmodInfo, -1)!=3&&substr($chmodInfo, -1)!=6&&substr($chmodInfo, -1)!=7)) {
- $fileAtts = "
";
+
+ $restrictedFile=false;
+ for ($i=0;$i " . htmlspecialchars($this_file) . " ".$fileAtts."";
- $fileManager .= fileManager_dir("$directory/$this_file", $return_link , false);
- $fileManager .= " ";
+
+ $fileAtts = "";
+ if ($serverType=="Linux") {
+ $chmodInfo = substr(sprintf('%o', fileperms($link)), -4);
+ $fileAtts = ''.$chmodInfo.'';
+ }
+ if ($_SESSION['userLevel'] == 10 || ($_SESSION['userLevel'] < 10 && $restrictedFile==false)) {
+ $fileManager .= "- " . htmlspecialchars($this_file) . " ".$fileAtts."";
+ $fileManager .= fileManager_dir("$directory/$this_file", $return_link , false);
+ $fileManager .= "
";
+ } else {
+ $fileManager .= "- [HIDDEN] ".$fileAtts."
";
+ }
} else {
// File
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
@@ -112,21 +114,13 @@ function fileManager_dir($directory, $return_link, $first_call=true) {
if ($_SESSION['userLevel'] == 10 || ($_SESSION['userLevel'] < 10 && $restrictedFile==false)) {
$fileAtts = "";
if ($serverType=="Linux") {
- //$ownerInfo = posix_getpwuid(fileowner($link));
$chmodInfo = substr(sprintf('%o', fileperms($link)), -4);
- if ($ownerInfo!="nobody"&&(substr($chmodInfo, -1)!=2&&substr($chmodInfo, -1)!=3&&substr($chmodInfo, -1)!=6&&substr($chmodInfo, -1)!=7)) {
- $fileAtts = "
";
- }
+ $fileAtts = ''.$chmodInfo.'';
}
$fileManager .= "- " . htmlspecialchars($this_file) . " ".$fileAtts."
";
} else {
- if ($_SESSION['userLevel'] == 0) {
- $fileAtts = "
";
- $fileManager .= "- [HIDDEN] ".$fileAtts."
";
- } else {
- $fileAtts = "
";
- $fileManager .= "- " . htmlspecialchars($this_file) . " ".$fileAtts."
";
- }
+ $fileAtts = "
";
+ $fileManager .= "- [HIDDEN] ".$fileAtts."
";
}
}
}