Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 949 → Rev 950

/sun/hostadmiral/trunk/src/ak/hostadmiral/core/action/LoginAction.java
3,6 → 3,7
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import org.apache.struts.Globals;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
39,6 → 40,7
}
else {
request.getSession().setAttribute("user", user);
request.getSession().setAttribute(Globals.LOCALE_KEY, user.getLocale());
 
String origin = BackPath.findBackPath(request).getBackwardUrl();
if(origin == null || origin.length() <= 0) {
/sun/hostadmiral/trunk/src/ak/hostadmiral/core/action/UserAction.java
89,6 → 89,7
if(u.getBoss() != null)
showForm.set("boss", StringConverter.toString(u.getBoss().getId()));
showForm.set("superuser", u.getSuperuser());
showForm.set("locale", u.getLocale().toString());
showForm.set("enabled", u.getEnabled());
showForm.set("comment", u.getComment());
}
100,6 → 101,18
else
return mapping.findForward("view");
}
else if("partedit".equals(mapping.getParameter())) {
DynaActionForm theForm = (DynaActionForm)form;
Long userId = StringConverter.parseLong(theForm.get("id"));
User u = UserManager.getInstance().get(user, userId);
DynaActionForm showForm = (DynaActionForm)RequestUtilsX.populateActionForm(
this, request, "ak.hostadmiral.core.form.UserPartEditForm");
 
showForm.set("locale", u.getLocale().toString());
initUserList(request, user);
request.setAttribute("u", u);
return mapping.findForward("default");
}
else if("deleting".equals(mapping.getParameter())) {
DynaActionForm theForm = (DynaActionForm)form;
Long userId = StringConverter.parseLong(theForm.get("id"));
163,6 → 176,7
else
u.setBoss(user, UserManager.getInstance().get(user, bossId));
 
u.setLocaleName(user, (String)theForm.get("locale"));
u.setEnabled(user, (Boolean)theForm.get("enabled"));
u.setComment(user, (String)theForm.get("comment"));
}
172,7 → 186,7
 
if(password != null && !password.equals("")
&& u.editableBy(user) // more strong condition, because normal
&& u.mayChangePassword(user)) // user have to enter first the old password
&& u.partEditableBy(user)) // user have to enter first the old password
{
u.setPassword(user, password);
}
181,6 → 195,16
response.sendRedirect(BackPath.findBackPath(request).getBackwardUrl());
return null;
}
else if("partsubmit".equals(mapping.getParameter())) {
DynaActionForm theForm = (DynaActionForm)form;
Long userId = StringConverter.parseLong(theForm.get("id"));
User u = UserManager.getInstance().get(user, userId);
 
u.setLocaleName(user, (String)theForm.get("locale"));
UserManager.getInstance().save(user, u);
response.sendRedirect(BackPath.findBackPath(request).getBackwardUrl());
return null;
}
else {
throw new Exception("unknown mapping parameter");
}