UserDatabase udb = UserDatabaseManager.getInstance().getUserDatabase(currentUser.getRealm());
for (int i = 0; accounts != null && i < accounts.length; i++) {
User user = udb.getAccount(accounts[i]);
if(udb.supportsAccountCreation()) {
try {
udb.deleteAccount(user);
CoreServlet.getServlet().fireCoreEvent(new CoreEvent(this, CoreEventConstants.USER_REMOVED, null, null, CoreEvent.STATE_SUCCESSFUL)
.addAttribute(CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_ID, user.getPrincipalName())
.addAttribute(CoreAttributeConstants.EVENT_ATTR_FULL_NAME, user.getFullname()));
} catch (Exception e) {
CoreServlet.getServlet().fireCoreEvent(new CoreEvent(this, CoreEventConstants.USER_REMOVED, null, null, e)