mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
eventmanager: don't modify in place fs events paths
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -1239,10 +1239,11 @@ func getUserForEventAction(user dataprovider.User) (dataprovider.User, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func replacePathsPlaceholders(paths []string, replacer *strings.Replacer) []string {
|
func replacePathsPlaceholders(paths []string, replacer *strings.Replacer) []string {
|
||||||
for idx := range paths {
|
results := make([]string, 0, len(paths))
|
||||||
paths[idx] = util.CleanPath(replaceWithReplacer(paths[idx], replacer))
|
for _, p := range paths {
|
||||||
|
results = append(results, util.CleanPath(replaceWithReplacer(p, replacer)))
|
||||||
}
|
}
|
||||||
return util.RemoveDuplicates(paths, false)
|
return util.RemoveDuplicates(results, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func executeDeleteFileFsAction(conn *BaseConnection, item string, info os.FileInfo) error {
|
func executeDeleteFileFsAction(conn *BaseConnection, item string, info os.FileInfo) error {
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
<script src="{{.StaticURL}}/vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
|
<script src="{{.StaticURL}}/vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("body").on("click", ".add_new_group_field_btn", function () {
|
$("body").on("click", ".add_new_group_field_btn", function () {
|
||||||
var index = $(".form_field_groups_outer").find("form_field_groups_outer_row").length;
|
var index = $(".form_field_groups_outer").find(".form_field_groups_outer_row").length;
|
||||||
while (document.getElementById("idGroup"+index) != null){
|
while (document.getElementById("idGroup"+index) != null){
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("body").on("click", ".add_new_fs_path_pattern_field_btn", function () {
|
$("body").on("click", ".add_new_fs_path_pattern_field_btn", function () {
|
||||||
var index = $(".form_field_fs_paths_outer").find("form_field_fs_paths_outer_row").length;
|
var index = $(".form_field_fs_paths_outer").find(".form_field_fs_paths_outer_row").length;
|
||||||
while (document.getElementById("idFsPathPattern"+index) != null){
|
while (document.getElementById("idFsPathPattern"+index) != null){
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
@@ -573,7 +573,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("body").on("click", ".add_new_action_field_btn", function () {
|
$("body").on("click", ".add_new_action_field_btn", function () {
|
||||||
var index = $(".form_field_action_outer").find("form_field_action_outer_row").length;
|
var index = $(".form_field_action_outer").find(".form_field_action_outer_row").length;
|
||||||
while (document.getElementById("idActionName"+index) != null){
|
while (document.getElementById("idActionName"+index) != null){
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user