Skip to content

Commit

Permalink
Add support for creating symbolic links in File Manager #629 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Rostovtsev committed Oct 3, 2018
1 parent 007debe commit 5d56b54
Show file tree
Hide file tree
Showing 23 changed files with 81 additions and 9 deletions.
34 changes: 34 additions & 0 deletions extensions/file-manager/create_symlink.cgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/perl

#
# Authentic Theme (https://github.com/authentic-theme/authentic-theme)
# Copyright Ilia Rostovtsev <[email protected]>
# Licensed under MIT (https://github.com/authentic-theme/authentic-theme/blob/master/LICENSE)
#
use strict;

use File::Basename;

our (%in, %text, $cwd, $path);

require(dirname(__FILE__) . '/file-manager-lib.pm');

my $path_urlized = urlize($path);

if (!$in{'name'}) {
redirect("list.cgi?path=$path_urlized&module=$in{'module'}");
}

my $is_symlink = (-l "$cwd/$in{'name'}_symlink");
if ($is_symlink || -d "$cwd/$in{'name'}_symlink" || -e "$cwd/$in{'name'}_symlink" || -d "$cwd/$in{'name'}_symlink") {
print_error(
(
text('filemanager_create_object_exists',
html_escape("$in{'name'}_symlink"),
html_escape($path), ($is_symlink ? $text{'theme_xhred_global_symbolic'} : $text{'theme_xhred_global_target'})
)
));
} else {
symlink_file("$cwd/$in{'name'}", "$cwd/$in{'name'}_symlink");
redirect("list.cgi?path=$path_urlized&module=$in{'module'}");
}
12 changes: 6 additions & 6 deletions extensions/file-manager/file-manager.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lang/ca.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/cz.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -955,4 +955,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/da.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/de.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -947,4 +947,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/en.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/es.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/fr.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/id.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -958,4 +958,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/it.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/ja_JP.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -953,4 +953,6 @@ theme_xhred_find_in_config_files_result_found_multi= $2のファイルに$3の
theme_xhred_find_in_config_files_results_found= $2のファイルに$3の検索結果が見つかりました

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/nl.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/no.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -814,4 +814,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/pl.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/pt.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -956,4 +956,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/ro_RO.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -954,4 +954,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/ru.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -959,4 +959,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/sq.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -967,4 +967,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/sv.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -953,4 +953,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 2 additions & 0 deletions lang/zh_CN.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -953,4 +953,6 @@ theme_xhred_find_in_config_files_result_found_multi=$1 results found in $2 file
theme_xhred_find_in_config_files_results_found=$1 results found in $2 files for $3

theme_xhred_filemanager_context_symlink=Create new symbolic link
theme_xhred_global_symbolic=Symbolic link
theme_xhred_global_target=Target
settings_sysinfo_max_servers=Maximum virtual servers to show
2 changes: 1 addition & 1 deletion theme.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
desc=Authentic Theme
longdesc=Webmin/Usermin/Virtualmin/Cloudmin theme based on Bootstrap and Font Awesome (https://github.com/authentic-theme/authentic-theme)
version=19.20-beta5
mversion=02
mversion=03
depends=1.89109 1.74109
webmin=1
usermin=1
4 changes: 2 additions & 2 deletions unauthenticated/css/bundle.min.css

Large diffs are not rendered by default.

0 comments on commit 5d56b54

Please sign in to comment.