CMD_FILE_MANAGER: action=parent_tree to include directory symlinks

Version 1.61.4

Feature
Finished

The ~/public_html symlink is very often used for quick nagivation to the domain's public_html directory. In Evolution, the top-level of directories is obtained with the request: CMD_FILE_MANAGER?json=yes&filemanager_du=0&action=parent_tree&path=%2F but because a symlink is a file when lstat is used, it was not shown in the list. This change will include a symlink, if it points to a directory, in the result, but will add "islink" and "linkpath" in the output, eg: [ { "path": "/.php", "dirs": 0, "files": 10, "files_size": 0 }, { "path": "/admin_backups", "dirs": 0, "files": 0, "files_size": 0 }, { "path": "/user_backups", "dirs": 0, "files": 0, "files_size": 0 }, { "path": "/.ssh", "dirs": 0, "files": 1, "files_size": 0 }, { "path": "/public_html", "dirs": 5, "files": 7, "files_size": 12477,"islink": "1", "linkpath": "./domains/domain.com/public_html" }, { "path": "/domains", "dirs": 3, "files": 0, "files_size": 0 }, { "path": "/imap", "dirs": 1, "files": 0, "files_size": 0 }, { "path": "/.trash", "dirs": 2, "files": 0, "files_size": 0 } ] where "islink' == 1 allows the skin to indicate that it's a symlink, rather than showing it as a full "directory" (eg: add a red arrow or some other indication on the icon) ---- EVO1966

Interested to try DirectAdmin? Get a 30-day Free Trial!