mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2026-04-26 10:55:56 +03:00
[GH-ISSUE #1363] Feature requesr #866
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#866
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 @softlab on GitHub (Dec 18, 2025).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1363
Hello!
Could you please add the ability to redefine usernames and passwords in an external PHP file?
In tinyfilemanager.php, you could wrap $use_auth, $auth_users, and $readonly_users with if (!isset(...)) {} checks, like this:
This would allow defining these variables externally without modifying the core file.
tinyfilemanager.php:
// Auth with login/password
// set true/false to enable/disable it
// Is independent from IP white- and blacklisting
if (!isset($use_auth)) {
$use_auth = true;
}
// Login user name and password
// Users: array('Username' => 'Password', 'Username2' => 'Password2', ...)
// Generate secure password hash - https://tinyfilemanager.github.io/docs/pwd.html
if (!isset($auth_users)) {
$auth_users = array(
'admin' => '$2y$10$/K.hjNr84lLNDt8fTXjoI.DBp6PpeyoJ.mGwrrLuCZfAwfSAGqhOW', //admin@123
'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345
);
}
// Readonly users
// e.g. array('users', 'guest', ...)
if (!isset($readonly_users)) {
$readonly_users = array(
'user'
);
}
Then later I could invoke filemanager.php from my index.php as follows:
password_hash('MyStrongPassword', PASSWORD_BCRYPT), 'user' => password_hash('AnotherPassword', PASSWORD_BCRYPT), ]; require __DIR__ . '/vendor/tinyfilemanager/tinyfilemanager.php'; Thank you very match, Yurii@prasathmani commented on GitHub (Dec 19, 2025):
github.com/prasathmani/tinyfilemanager@dd79258999/tinyfilemanager.php (L145)you can configure external config file - https://tinyfilemanager.github.io/config-sample.txt