prasathmani / tinyfilemanager

Single-file PHP file manager, browser and manage your files efficiently and easily with tinyfilemanager
https://tinyfilemanager.github.io
GNU General Public License v3.0
5k stars 1.67k forks source link

$global_readonly not working #753

Closed kc9ryt closed 1 year ago

kc9ryt commented 2 years ago

Hello, I am running v. 2.4.7 and $global_readonly = true does not seem to be working with auth turned off.

prasathmani commented 2 years ago

@kc9ryt , check this #583

shadowvfx commented 2 years ago

Full disclosure, I'm an idiot. I followed the link to issue 583 and I don't understand what it's getting at. Why doesn't setting global_readonly to true make it....read only? I am not a PHP expert, but I want to share a collection of files with a local club and I want them to be able to access the file directories, but NOT have any kind of editing privileges. I would prefer not needing a guest login or any login screen. Simply go to the directory and it will show a list of all files for browsing. I just want them to view the documents and download. All the file management stuff I can handle via FTP.

alex-reach commented 2 years ago

This in not working for me either @prasathmani . Or are we doing something wrong?

mrlawrencelam commented 2 years ago

Yes, this feature is seriously missing.

I want only the Administrator to be able to manage files (requires login).

But for public users, don't need to log in. They can go directly to the file list but can't edit/delete/upload files.

I tried pointing to the link tinymanager.php?fm_usr=user&fm_pwd=user123 but this doesn't work.

How can public users bypass the login form?

andymcca commented 2 years ago

$global_readonly isn't currently referenced anywhere in the PHP file apart from the initial definition.

To get this to work I think you just need to change the definition of FM_READONLY in line 396 to the following -

define('FM_READONLY', ($use_auth && !empty($readonly_users) && isset($_SESSION[FM_SESSION_ID]['logged']) && in_array($_SESSION[FM_SESSION_ID]['logged'], $readonly_users)) || $global_readonly);

prasathmani commented 1 year ago

This issue is addressed in the new release.