mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2026-04-26 10:55:56 +03:00
[GH-ISSUE #536] Improvement suggestion - simple pluggable and overridable user auth #394
Labels
No labels
Feature
Feature
Is It Really an Issue?
Need More Info
Request
Security
bug
duplicate
enhancement
enhancement
help wanted
invalid
pull-request
question
suggestion
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tinyfilemanager#394
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @acerbis on GitHub (May 3, 2021).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/536
Thanks for the project.
You already include "config.php" by default, that allows the user to specify custom parameters (and this survives a new file manager release).
Would be extremely useful to be able to specify there, in the config.php, if needed, a custom function to authenticate the user and provide various flags on how to handle the user, all in a centralized point.
So in config.php one can specify a user-specialized function (instead of the default) in a simple and straightforward way.
$TINY_AUTH = myautfunction
so in the code you can call $TINY_AUTH($user, $pass)
the function could have this signature
function($user, $pass) {
... ... ...
$ret = array( 'auth' => 'OK' , 'readonly' => 'yes', 'limitedtothisdir' => '/home/myuser' , 'theme' => 'mytheme', 'allowzipping' => true ....)
return $ret
it would be nice
@acerbis commented on GitHub (May 3, 2021):
Basically, you can have in tinymanager.php something like at beginning
and then modify the authentication part as
that can work as a drop in replacement for the current code and keep the overall simplicity.
if one wishes, one can change $TINY_AUTH in included config.php to specify a custom function.
This can be implemented with interfaces etc. but I like this simple functional style in line with the overall fileman spirit.
Future improvements:
$TINY_AUTH can, instead of returning a boolean, return a full array with many user parameters (authenticated?, homedir, readonly , theme, open for extension...etc.etc.)
@prasathmani commented on GitHub (May 3, 2021):
@acerbis thank you for your valuable input.