[GH-ISSUE #120] User's subfolder problem #84

Closed
opened 2026-03-02 15:55:36 +03:00 by kerem · 5 comments
Owner

Originally created by @panverger on GitHub (Jan 19, 2019).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/120

When you set specific directory for user direct link is not formed correct
I added a new line under 143 and now is ok
Check it yourself
// clean $root_url
$root_url = fm_clean_path($root_url);

New line
$root_url = isset($directories_users[$_SESSION[FM_SESSION_ID]['logged']]) ? $root_url.'fm/'.$directories_users[$_SESSION[FM_SESSION_ID]['logged']] : $root_url;

Originally created by @panverger on GitHub (Jan 19, 2019). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/120 When you set specific directory for user direct link is not formed correct I added a new line under 143 and now is ok Check it yourself // clean $root_url $root_url = fm_clean_path($root_url); New line **$root_url = isset($directories_users[$_SESSION[FM_SESSION_ID]['logged']]) ? $root_url.'fm/'.$directories_users[$_SESSION[FM_SESSION_ID]['logged']] : $root_url**;
kerem 2026-03-02 15:55:36 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@panverger commented on GitHub (Jan 20, 2019):

final solution - adding these lines all are ok

if (isset($_SESSION[FM_SESSION_ID]['logged'])) {
$wd = dirname($_SERVER['PHP_SELF']);
$wd = ltrim($wd, '/');
$root_url = !empty($directories_users[$_SESSION[FM_SESSION_ID]['logged']]) ? $root_url. $wd. '/'.$directories_users[$_SESSION[FM_SESSION_ID]['logged']] : $root_url;
}

<!-- gh-comment-id:455849205 --> @panverger commented on GitHub (Jan 20, 2019): **final solution - adding these lines all are ok** if (isset($_SESSION[FM_SESSION_ID]['logged'])) { $wd = dirname($_SERVER['PHP_SELF']); $wd = ltrim($wd, '/'); $root_url = !empty($directories_users[$_SESSION[FM_SESSION_ID]['logged']]) ? $root_url. $wd. '/'.$directories_users[$_SESSION[FM_SESSION_ID]['logged']] : $root_url; }
Author
Owner

@prasathmani commented on GitHub (Jan 20, 2019):

@panverger added your solution. It will work for normal flow(using DOCUMENT_ROOT),
Problem still exist on flowing cases,

  • Using different $root_path

    $root_path = $_SERVER['DOCUMENT_ROOT'].'my-folder';

  • If users directories configured outside the tinyfilemanager.php folder
$directories_users = array(
     'demo' => '../demo-folder'
);
<!-- gh-comment-id:455859310 --> @prasathmani commented on GitHub (Jan 20, 2019): @panverger added your solution. It will work for normal flow(using `DOCUMENT_ROOT`), Problem still exist on flowing cases, - Using different `$root_path` >`$root_path = $_SERVER['DOCUMENT_ROOT'].'my-folder';` - If users directories configured outside the tinyfilemanager.php folder ``` $directories_users = array( 'demo' => '../demo-folder' ); ```
Author
Owner

@panverger commented on GitHub (Jan 20, 2019):

Thank's a lot. It's a very useful code. I'll be using this file while teaching my class. Every student has his own folder where he can save his exercises.

<!-- gh-comment-id:455881013 --> @panverger commented on GitHub (Jan 20, 2019): Thank's a lot. It's a very useful code. I'll be using this file while teaching my class. Every student has his own folder where he can save his exercises.
Author
Owner

@simon511000 commented on GitHub (Jan 20, 2019):

Hey @panverger ! I also recommend agora, my technology teacher uses it

<!-- gh-comment-id:455890588 --> @simon511000 commented on GitHub (Jan 20, 2019): Hey @panverger ! I also recommend [agora](https://www.agora-project.net/index.php?curTrad=english), my technology teacher uses it
Author
Owner

@prasathmani commented on GitHub (Jan 21, 2019):

Closing the ticket as the primary problem solved and with known issues.

<!-- gh-comment-id:456046018 --> @prasathmani commented on GitHub (Jan 21, 2019): Closing the ticket as the primary problem solved and with known issues.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#84
No description provided.