mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2026-04-26 19:05:54 +03:00
[GH-ISSUE #1107] Wrong url after login #709
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#709
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 @ash-f on GitHub (Nov 13, 2023).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1107
The url will be redirected to $root_path after login, not Tiny File Manager itself.
Tiny File Manager location
/tfm/index.php
Configuration
Tiny File Manager 2.5.3 (offline version)
@PLJ020 commented on GitHub (May 16, 2024):
Had exact same problem and found that it's because after entering either correct or incorrect password redirect is wrong.
What worked for me was changing below:
if (isset($auth_users[$_POST['fm_usr']]) && isset($_POST['fm_pwd']) && password_verify($_POST['fm_pwd'],
$auth_users[$_POST['fm_usr']]) && verifyToken($_POST['token'])) {
$_SESSION[FM_SESSION_ID]['logged'] = $_POST['fm_usr'];
fm_set_msg(lng('You are logged in'));
fm_redirect(FM_ROOT_URL);
} else {
unset($_SESSION[FM_SESSION_ID]['logged']);
fm_set_msg(lng('Login failed. Invalid username or password'), 'error');
fm_redirect(FM_ROOT_URL);
To:
if (isset($auth_users[$_POST['fm_usr']]) && isset($_POST['fm_pwd']) && password_verify($_POST['fm_pwd'],
$auth_users[$_POST['fm_usr']]) && verifyToken($_POST['token'])) {
$_SESSION[FM_SESSION_ID]['logged'] = $_POST['fm_usr'];
fm_set_msg(lng('You are logged in'));
// fm_redirect(FM_ROOT_URL);
fm_redirect($_SERVER['REQUEST_URI']);
} else {
unset($_SESSION[FM_SESSION_ID]['logged']);
fm_set_msg(lng('Login failed. Invalid username or password'), 'error');
// fm_redirect(FM_ROOT_URL);
fm_redirect($_SERVER['REQUEST_URI']);
Note the problematic statement that's changed above is:
fm_redirect(FM_ROOT_URL) -> fm_redirect($_SERVER['REQUEST_URI'])
Reference:
github.com/prasathmani/tinyfilemanager@1f0c8538ed