Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
use sign in redirect for kerberos login
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Jan 27, 2012
1 parent 4379753 commit e7e8d7d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,15 @@ public class ZanataExternalLoginBean implements Serializable

private ApplicationConfiguration applicationConfiguration;

private UserRedirectBean userRedirectBean;

@Create
public void init()
{
identity = (ZanataIdentity) Component.getInstance(ZanataIdentity.class, ScopeType.SESSION);
identityStore = (ZanataJpaIdentityStore) Component.getInstance(ZanataJpaIdentityStore.class, ScopeType.APPLICATION);
applicationConfiguration = (ApplicationConfiguration) Component.getInstance(ApplicationConfiguration.class, ScopeType.APPLICATION);
userRedirectBean = (UserRedirectBean) Component.getInstance(UserRedirectBean.class, ScopeType.SESSION);
}


Expand Down Expand Up @@ -129,7 +132,14 @@ public String redirect()

if (applicationConfiguration.isKerberosAuth() && identity.isLoggedIn() && !isNewUser())
{
return "home";
if (userRedirectBean.isRedirect())
{
return "redirect";
}
else
{
return "home";
}
}

if (applicationConfiguration.isKerberosAuth() && !identity.isLoggedIn())
Expand Down
3 changes: 3 additions & 0 deletions server/zanata-war/src/main/webapp/WEB-INF/pages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<rule if-outcome="edit">
<redirect view-id="/profile/edit.xhtml" />
</rule>
<rule if-outcome="redirect">
<redirect url="#{userRedirect.url}" />
</rule>
<rule if-outcome="home">
<redirect view-id="/home.xhtml" />
</rule>
Expand Down

0 comments on commit e7e8d7d

Please sign in to comment.