Feature #14211
closedcalculate and display filepermissions in filelist
0%
Description
To me it seems that calculation and information of filepermissions needs some improvements.
--------------
t3lib_basicfilefunctions::getTotalFileInfo
---------------
I am not sure on this one, it is not getting the right values in my installation but probably is correct with safe_mode enabled.
----------------
fileList::dirData
----------------
...
$icon = $theFile['writable'] ? 'gfx/i/_icon_'.$webpath.'folders_ro.gif' : $icon;
...
- the key should be "writeable" not "writable"
- probably should go other way around
I tried to work on patches but never got the result like expected. Will look into this again, maybe somebody has an idea.
(issue imported from #M171)
Files
Updated by Hans J about 20 years ago
This bug exist also in latest 3.7. cvs.
I suggest to use is_writeable and is_readable instead. In class.t3lib_basicfilefunc.php line 157+158:
$info['writeable'] = ($info['perms']&2 || ($theuser==$info['owner'] && $info['perms']&128));
$info['readable'] = ($info['perms']&4 || ($theuser==$info['owner'] && $info['perms']&256));
should be changed to
$info['writeable'] = is_writeable($wholePath);
$info['readable'] = is_readable($wholePath);
The second one is a typo in line 418 (should be writeable).
Updated by Michael Stucki about 20 years ago
The attached patch will fix the problem.
I'm almost sure that this works well but please test it anyway! If you both can confirm that the patch works, it can make it into 3.7.
@ juggler: The 1st issue you mentioned (count files) seems to be fixed already in 3.7.
@case2020: "writeable" is not correct, this is the wrong one! :-)
Updated by Alexander Opitz about 15 years ago
Why ist writable and readable negated?
$info['writable'] = !@is_writable($wholePath);
$info['readable'] = !@is_readable($wholePath);
This is also mentioned by Rene Fritz in his class.tx_dam.php
Updated by Benni Mack over 14 years ago
Hey Stucki.
could you please enlighten us if this was on purpose?
$info['writable'] = !@is_writable($wholePath);
$info['readable'] = !@is_readable($wholePath);
If so, then please comment this in the source code; and then we can close this issue.
Updated by Jigal van Hemert over 14 years ago
Added comments about odd logic in patch.
Updated by Benni Mack over 14 years ago
Committed documentation change to trunk (rev. 7884)