[seam-commits] Seam SVN: r7378 - trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Feb 6 04:50:26 EST 2008


Author: christian.bauer at jboss.com
Date: 2008-02-06 04:50:26 -0500 (Wed, 06 Feb 2008)
New Revision: 7378

Modified:
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiIdentity.java
Log:
Quick bugfix override for Shanes last commit

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiIdentity.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiIdentity.java	2008-02-06 05:20:45 UTC (rev 7377)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiIdentity.java	2008-02-06 09:50:26 UTC (rev 7378)
@@ -7,6 +7,7 @@
 package org.jboss.seam.wiki.core.action;
 
 import org.jboss.seam.Component;
+import org.jboss.seam.contexts.Contexts;
 import static org.jboss.seam.ScopeType.SESSION;
 import org.jboss.seam.annotations.AutoCreate;
 import org.jboss.seam.annotations.Install;
@@ -19,6 +20,8 @@
 import org.jboss.seam.security.Identity;
 import org.jboss.seam.wiki.core.model.*;
 
+import javax.security.auth.login.LoginException;
+
 /**
  * Need this until Drools fixes bugs and becomes usable/debuggable.
  *
@@ -33,6 +36,19 @@
     private User currentUser;
     private Integer currentAccessLevel;
 
+    // TODO: Override Shanes last commit, which introduced a bug, raising an "already logged in" message 
+    public String login() {
+        try {
+            authenticate();
+            if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGIN_SUCCESSFUL);
+            return "loggedIn";
+        }
+        catch (LoginException ex) {
+            if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGIN_FAILED, ex);
+            return null;
+        }
+    }
+
     // We don't care if a user is logged in, just check it...
     public void checkRestriction(String expr) {
         if (!evaluateExpression(expr)) {




More information about the seam-commits mailing list