Author: michiel
Date: 2010-04-09 14:37:16 +0200 (Fri, 09 Apr 2010)
New Revision: 41818
Modified:
didactor/trunk/components/core/src/main/java/nl/didactor/security/Authentication.java
didactor/trunk/components/core/src/main/java/nl/didactor/security/UserContext.java
Log:
details
Modified:
didactor/trunk/components/core/src/main/java/nl/didactor/security/Authentication.java
===================================================================
---
didactor/trunk/components/core/src/main/java/nl/didactor/security/Authentication.java
2010-04-09 12:08:26 UTC (rev 41817)
+++
didactor/trunk/components/core/src/main/java/nl/didactor/security/Authentication.java
2010-04-09 12:37:16 UTC (rev 41818)
@@ -40,6 +40,7 @@
public static String REASON_KEY = "nl.didactor.security.reason";
public static String TRYCOUNT_KEY = "nl.didactor.security.trycount";
+ public static String PARAMETERS_KEY = "nl.didactor.security.parameters";
final List<AuthenticationComponent> securityComponents = new
CopyOnWriteArrayList<AuthenticationComponent>();
@@ -259,6 +260,16 @@
application = "login";
}
+ HttpSession session = request.getSession(true);
+ Map map = (Map) session.getAttribute(PARAMETERS_KEY);
+ if (map == null) {
+ map = new HashMap();
+ session.setAttribute(PARAMETERS_KEY, map);
+ }
+ map.putAll(request.getParameterMap());
+ map.putAll(loginInfo);
+
+
// Apparently not, so we ask the components if they can process the
login,
// maybe there was a post to the current page?
for (AuthenticationComponent ac : securityComponents) {
@@ -268,9 +279,9 @@
log.debug("" + ac + ".processLogin() -> " + uc);
}
if (uc != null) {
- HttpSession session = request.getSession(true);
- session.setAttribute(REASON_KEY, null);
-
request.getSession(true).setAttribute("didactor-logincomponent", ac.getName());
+ session.removeAttribute(PARAMETERS_KEY);
+ session.removeAttribute(REASON_KEY);
+ session.setAttribute("didactor-logincomponent",
ac.getName());
Integer usernumber = uc.getUserNumber();
Event event = new Event(uc.getIdentifier(), request, null,
null, null,
"LOGIN", usernumber != null ?
usernumber.toString() : null,
@@ -283,7 +294,6 @@
}
}
} catch (SecurityException se) {
- HttpSession session = request.getSession(true);
Locale locale = (Locale) request.getAttribute("locale");
if (locale == null) {
locale =
ContextProvider.getDefaultCloudContext().getDefaultLocale();
@@ -347,7 +357,7 @@
if (referUrl.toString().startsWith("/")) {
referUrl.insert(0, request.getContextPath());
}
- HttpSession session = request.getSession(true);
+
Integer trycount = (Integer)
session.getAttribute(TRYCOUNT_KEY);
if (trycount == null) {
trycount = 0;
Modified:
didactor/trunk/components/core/src/main/java/nl/didactor/security/UserContext.java
===================================================================
---
didactor/trunk/components/core/src/main/java/nl/didactor/security/UserContext.java
2010-04-09 12:08:26 UTC (rev 41817)
+++
didactor/trunk/components/core/src/main/java/nl/didactor/security/UserContext.java
2010-04-09 12:37:16 UTC (rev 41818)
@@ -65,7 +65,11 @@
if (i.hasNext()) {
nodeNumber = i.next().getNumber();
} else {
- log.debug("No people object with username '" + identifier +
"'", new Exception());
+ if (log.isTraceEnabled()) {
+ log.trace("No people object with username '" + identifier
+ "'", new Exception());
+ } else {
+ log.debug("No people object with username '" + identifier
+ "'");
+ }
}
} catch (Exception e) {
log.error(e);
@@ -111,14 +115,15 @@
}
+ @Override
protected void finalize() throws Throwable {
identifier = "FINALIZED " + identifier;
log.debug("Finalizing " + this);
super.finalize();
}
- public static Set<String> getRoles(MMObjectNode node) {
- Set<String> result = new HashSet<String>();
+ public static Set<String> getRoles(final MMObjectNode node) {
+ final Set<String> result = new HashSet<String>();
if (node != null) {
List<MMObjectNode> roles = node.getRelatedNodes("roles",
RelationStep.DIRECTIONS_DESTINATION);
for (MMObjectNode role : roles) {
@@ -143,14 +148,16 @@
/**
* From the org.mmbase.security.UserContext interface
*/
- @Override public String getIdentifier() {
+ @Override
+ public String getIdentifier() {
return identifier;
}
/**
* From the org.mmbase.security.UserContext interface
*/
- @Override public String getOwnerField() {
+ @Override
+ public String getOwnerField() {
return owner;
}
@@ -165,6 +172,7 @@
return Integer.valueOf(wrappedNode);
}
+ @Override
public String toString() {
return count + ":" + super.toString();
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs