Merged V1.3 to HEAD(3126:3160)

svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3126 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3160 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3405 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-07-26 10:16:23 +00:00
parent e80158b922
commit 36f219edf1
7 changed files with 111 additions and 32 deletions

View File

@@ -180,11 +180,14 @@ public abstract class AbstractAuthenticationComponent implements AuthenticationC
*/
private String getUserName(Authentication authentication)
{
String username = authentication.getPrincipal().toString();
String username;
if (authentication.getPrincipal() instanceof UserDetails)
{
username = ((UserDetails) authentication.getPrincipal()).getUsername();
username = ((UserDetails)authentication.getPrincipal()).getUsername();
}
else
{
username = authentication.getPrincipal().toString();
}
return username;