HtmlTableWidget userListComponent = (HtmlTableWidget) getWidgetManager(session).getWidget("USERLIST");
for (String selectedRow : selected.getSelected().keySet()) {
int row = Integer.parseInt(selectedRow);
row = row + userListComponent.getPage() * userListComponent.getRowsPerPage();
ZeroUser selectedUser = ((DefaultTableModel<ZeroUser>) userListComponent.getModel()).get(row);
if (selectedUser != null) {
if (!user.checkAuthorisation(
new Permission(UserModule.AUTH_USER, selectedUser.getUserGroup().getGroupKey()),
new Permission(UserModule.AUTH_USER_EDIT, "", false))) {
view.setMessage(new Message("zero.message.user.delete_no_permission", Message.MSG_ERROR, selectedUser.getUsername()));
return new ModelAndView(view, null);
}
} else {
log.debug("username not found");
}
}
for (String selectedRow : selected.getSelected().keySet()) {
int row = Integer.parseInt(selectedRow);
row = row + userListComponent.getPage() * userListComponent.getRowsPerPage();
ZeroUser selectedUser = ((DefaultTableModel<ZeroUser>) userListComponent.getModel()).get(row);
if (selectedUser != null) {
selectedUser = userDao.findById(selectedUser.getId(), true);
selectedUser.setDeleted(false);
selectedUser.setModificationDate(new Date());
selectedUser.setLastModifiedBy((ZeroUser) getUser());
userDao.makePersistent(selectedUser);
} else {
log.debug("username not found");
}
}