mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Checkpoint of client Guest access implementation
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2140 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -135,6 +135,23 @@ public class LoginBean
|
||||
* @return The username string from login dialog
|
||||
*/
|
||||
public String getUsername()
|
||||
{
|
||||
// this value may have been set by a servlet filter via a cookie
|
||||
// check for this by detecting a special value in the session
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
Map session = context.getExternalContext().getSessionMap();
|
||||
|
||||
String username = (String)session.get(AuthenticationHelper.SESSION_USERNAME);
|
||||
if (username != null)
|
||||
{
|
||||
session.remove(AuthenticationHelper.SESSION_USERNAME);
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
return this.username;
|
||||
}
|
||||
|
||||
public String getUsernameInternal()
|
||||
{
|
||||
return this.username;
|
||||
}
|
||||
@@ -446,6 +463,12 @@ public class LoginBean
|
||||
this.authenticationService.invalidateTicket(user.getTicket());
|
||||
}
|
||||
|
||||
// Request that the username cookie state is removed - this is not
|
||||
// possible from JSF - so instead we setup a session variable
|
||||
// which will be detected by the login.jsp/Portlet as appropriate.
|
||||
session = context.getExternalContext().getSessionMap();
|
||||
session.put(AuthenticationHelper.SESSION_INVALIDATED, true);
|
||||
|
||||
// set language to last used
|
||||
if (this.language != null && this.language.length() != 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user