From: Olivier Lamy Date: Thu, 2 Feb 2012 20:43:44 +0000 (+0000) Subject: fix delete user X-Git-Tag: archiva-1.4-M3~1393 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4c520b014b85d7e3e9e82927b01e246d61af6036;p=archiva.git fix delete user git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1239832 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html index 8a38f6041..deb8bc9e4 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html @@ -39,7 +39,7 @@ {{else}} - + ${$.i18n.prop('delete')} diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js index c857b0a19..f98594e4b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js @@ -137,32 +137,6 @@ $(function() { }); }; - this.deleteUser=function() { - clearUserMessages(); - - var currentUser = this; - openDialogConfirm(function(){ - $.ajax("restServices/redbackServices/userService/deleteUser/"+encodeURIComponent(currentUser.username()), { - type: "GET", - dataType: 'json', - success: function(data) { - // FIXME i18n - window.redbackModel.usersViewModel.users.remove(currentUser); - displaySuccessMessage("user " + currentUser.username() + " deleted"); - }, - error: function(result) { - var obj = jQuery.parseJSON(result.responseText); - displayRedbackError(obj); - }, - complete: function() { - closeDialogConfirm(); - } - } - ); - } - ,"Ok", $.i18n.prop("cancel"), $.i18n.prop("user.delete.message") + ": " + currentUser.username()); - - }; this.update=function(){ var currentUser = this; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js index c70e6819b..8f51fc474 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js @@ -94,6 +94,33 @@ $(function() { }); }; + deleteUser=function(user){ + clearUserMessages(); + + var currentUser = user; + openDialogConfirm(function(){ + $.ajax("restServices/redbackServices/userService/deleteUser/"+encodeURIComponent(currentUser.username()), { + type: "GET", + dataType: 'json', + success: function(data) { + // FIXME i18n + displaySuccessMessage("user " + currentUser.username() + " deleted"); + self.users.remove(currentUser); + }, + error: function(result) { + var obj = jQuery.parseJSON(result.responseText); + displayRedbackError(obj); + }, + complete: function() { + closeDialogConfirm(); + } + } + ); + } + ,"Ok", $.i18n.prop("cancel"), $.i18n.prop("user.delete.message") + ": " + currentUser.username()); + + } + editUserBox=function(user) { clearUserMessages(); activateUsersEditTab();