mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-06-12 19:02:13 +02:00
Show ownership in numeric uid:gid when username and/or group are not available.
This commit is contained in:
parent
36ae5aa9e3
commit
6ac39a000d
|
@ -2025,8 +2025,18 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white
|
|||
}
|
||||
$perms = substr(decoct(fileperms($path . '/' . $f)), -4);
|
||||
if (function_exists('posix_getpwuid') && function_exists('posix_getgrgid')) {
|
||||
$owner = posix_getpwuid(fileowner($path . '/' . $f));
|
||||
$group = posix_getgrgid(filegroup($path . '/' . $f));
|
||||
$uid = fileowner($path . '/' . $f);
|
||||
$gid = filegroup($path . '/' . $f);
|
||||
if (posix_getpwuid($uid) == '') {
|
||||
$owner = array('name' => $uid);
|
||||
} else {
|
||||
$owner = posix_getpwuid($uid);
|
||||
}
|
||||
if (posix_getgrgid($gid) == '') {
|
||||
$group = array('name' => $gid);
|
||||
} else {
|
||||
$group = posix_getgrgid($gid);
|
||||
}
|
||||
} else {
|
||||
$owner = array('name' => '?');
|
||||
$group = array('name' => '?');
|
||||
|
@ -2078,8 +2088,18 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white
|
|||
$all_files_size += $filesize_raw;
|
||||
$perms = substr(decoct(fileperms($path . '/' . $f)), -4);
|
||||
if (function_exists('posix_getpwuid') && function_exists('posix_getgrgid')) {
|
||||
$owner = posix_getpwuid(fileowner($path . '/' . $f));
|
||||
$group = posix_getgrgid(filegroup($path . '/' . $f));
|
||||
$uid = fileowner($path . '/' . $f);
|
||||
$gid = filegroup($path . '/' . $f);
|
||||
if (posix_getpwuid($uid) == '') {
|
||||
$owner = array('name' => $uid);
|
||||
} else {
|
||||
$owner = posix_getpwuid($uid);
|
||||
}
|
||||
if (posix_getgrgid($gid) == '') {
|
||||
$group = array('name' => $gid);
|
||||
} else {
|
||||
$group = posix_getgrgid($gid);
|
||||
}
|
||||
} else {
|
||||
$owner = array('name' => '?');
|
||||
$group = array('name' => '?');
|
||||
|
|
Loading…
Reference in a new issue