Permalink
Browse files

Merge branch 'master' into 1.3

  • Loading branch information...
2 parents 37e7fe1 + c49fc14 commit 643ab2cd4906c052fc95664eafc8f93eb6ae7f2e hding committed May 6, 2011
@@ -242,7 +242,6 @@ public void loginImmediate()
{
if (loginImmediately())
{
- identity.setPreAuthenticated(true);
if (Events.exists())
Events.instance().raiseEvent(Identity.EVENT_POST_AUTHENTICATE, identity);
if (Events.exists())
@@ -82,7 +82,6 @@ public void setCredential()
field.setAccessible(true);
field.set(identity, SecurityAssociation.getSubject());
- identity.setPreAuthenticated(true);
if (Events.exists())
Events.instance().raiseEvent(Identity.EVENT_LOGIN_SUCCESSFUL);
@@ -93,6 +93,7 @@ public boolean checkDisabledUser()
{
FacesMessages.instance().clear();
FacesMessages.instance().add("User {0} has been disabled. Please check your email for a validation code, or contact server admin.", username);
+ identity.setPreAuthenticated(false);
identity.unAuthenticate();
return true;
}
@@ -103,6 +104,7 @@ public boolean checkDisabledUser()
@Observer(Identity.EVENT_LOGIN_SUCCESSFUL)
public void loginInSuccessful()
{
+ identity.setPreAuthenticated(true);
if (externalLogin() && !isNewUser() && !checkDisabledUser())
{
applyAuthentication();
@@ -115,18 +117,22 @@ public void spNegoExecute()
{
SpNegoIdentity spNegoIdentity = (SpNegoIdentity) Component.getInstance(SpNegoIdentity.class, ScopeType.SESSION);
spNegoIdentity.setCredential();
- return;
}
}
public String redirect()
{
- if (zanataInit.isSpNego() && isNewUser())
+ if (zanataInit.isSpNego() && identity.isLoggedIn() && isNewUser())
{
return "edit";
}
- if (zanataInit.isSpNego() && !isNewUser())
+ if (zanataInit.isSpNego() && identity.isLoggedIn() && !isNewUser())
+ {
+ return "home";
+ }
+
+ if (zanataInit.isSpNego() && !identity.isLoggedIn())
{
return "home";
}

0 comments on commit 643ab2c

Please sign in to comment.