mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fix delete user button in admin/users.lua for users with special character in name
This commit is contained in:
parent
9cbf4a89bd
commit
e1bfb6280b
1 changed files with 3 additions and 1 deletions
|
|
@ -118,7 +118,9 @@ end
|
|||
|
||||
local can_be_deleted = (key ~= "admin" and key ~= logged_user)
|
||||
|
||||
print ("<a href='#delete_user_dialog' role='button' class='add-on btn btn-sm btn-danger ".. (not can_be_deleted and 'disabled' or '') .."' data-bs-toggle='modal' id='delete_btn_" .. id_key .. "'><i class='fas fa-trash'></i></a><script> $('#delete_btn_" .. id_key .. "').on('mouseenter', function() { delete_user_alert.warning('" .. i18n("manage_users.confirm_delete_user", {user=key}) .. "'); $('#delete_dialog_username').val('" .. key .. "'); }); </script>")
|
||||
local id_key2 = id_key:gsub('[%p%c%s]', '')
|
||||
|
||||
print ("<a href='#delete_user_dialog' role='button' class='add-on btn btn-sm btn-danger ".. (not can_be_deleted and 'disabled' or '') .."' data-bs-toggle='modal' id='delete_btn_" .. id_key2 .. "'><i class='fas fa-trash'></i></a><script> $('#delete_btn_" .. id_key2 .. "').on('mouseenter', function() { delete_user_alert.warning('" .. i18n("manage_users.confirm_delete_user", {user=key}) .. "'); $('#delete_dialog_username').val('" .. key .. "'); }); </script>")
|
||||
|
||||
print ("\"}")
|
||||
num = num + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue