private static Logger log = Logger.getLogger(LoadAction.class);
@Override
public EditPanel createPanel(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
UserVO user = (UserVO)attributes.get("user");
boolean isActiveUser = false;
if(user.equals(activeUser))
isActiveUser = true;
boolean isLdapUser = user.getProfile().getLdapGroup() != null;
EditPanel panel = new EditPanel(Right.ADMINISTRATION_USERMANAGEMENT_WRITE, user);
if(user.getId() == null)
panel.setTitle(MessageUtil.message(request, "module.system.user.manage.headLine.create"));
else
{
panel.setTitle(MessageUtil.message(request, "module.system.user.manage.headLine.edit", user.getUserName()));
panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.system.user.manage.deleteUser.headLine", user.getUserName()));
panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.system.user.manage.deleteUser.question", user.getUserName()));
}
panel.addAction(Action.Type.DELETE, "/system/management/user/delete", !isActiveUser&&!isLdapUser);
panel.addAction(Action.Type.SAVE, "/system/management/user/save");