Feature #14211
closed
calculate and display filepermissions in filelist
Added by Peter Niederlag over 20 years ago.
Updated over 13 years ago.
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
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).
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! :-)
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
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.
Added comments about odd logic in patch.
Committed documentation change to trunk (rev. 7884)
- Target version deleted (
4.4.0)
Also available in: Atom
PDF