Project

General

Profile

Actions

Feature #14211

closed

calculate and display filepermissions in filelist

Added by Peter Niederlag over 20 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Must have
Category:
Backend API
Target version:
-
Start date:
2004-06-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
4.3
Tags:
Complexity:
Sprint Focus:

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

0000171-is_writable.diff (9.54 KB) 0000171-is_writable.diff Administrator Admin, 2004-09-19 15:09
171_trunk.diff (1.16 KB) 171_trunk.diff Administrator Admin, 2010-06-10 21:04
Actions #1

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).

Actions #2

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! :-)

Actions #4

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

Actions #5

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.

Actions #6

Updated by Jigal van Hemert over 14 years ago

Added comments about odd logic in patch.

Actions #7

Updated by Benni Mack over 14 years ago

Committed documentation change to trunk (rev. 7884)

Actions #8

Updated by Susanne Moog over 13 years ago

  • Target version deleted (4.4.0)
Actions

Also available in: Atom PDF