From bdeab82f5d27d2019889573bd6dadd8be8827204 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 2 Mar 2013 19:11:33 -0800 Subject: [PATCH] Prompt user for user/connection deletion. --- guacamole/src/main/webapp/scripts/admin-ui.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/guacamole/src/main/webapp/scripts/admin-ui.js b/guacamole/src/main/webapp/scripts/admin-ui.js index 77b4a3eb4..ab131bced 100644 --- a/guacamole/src/main/webapp/scripts/admin-ui.js +++ b/guacamole/src/main/webapp/scripts/admin-ui.js @@ -542,9 +542,13 @@ GuacAdmin.addUser = function(name) { e.stopPropagation(); - GuacamoleService.Users.remove(GuacAdmin.selected_user); - deselect(); - GuacAdmin.reset(); + // Delete user upon confirmation + if (confirm("Are you sure you want to delete the user \"" + + name + "\"?")) { + GuacamoleService.Users.remove(GuacAdmin.selected_user); + deselect(); + GuacAdmin.reset(); + } }; @@ -808,9 +812,13 @@ GuacAdmin.addConnection = function(connection) { e.stopPropagation(); - GuacamoleService.Connections.remove(GuacAdmin.selected_connection); - deselect(); - GuacAdmin.reset(); + // Delete connection upon confirmation + if (confirm("Are you sure you want to delete the connection \"" + + connection.id + "\"?")) { + GuacamoleService.Connections.remove(GuacAdmin.selected_connection); + deselect(); + GuacAdmin.reset(); + } };