Merged V4.1-BUG-FIX to HEAD

40484: ALF-15370: 'New Rule' page localisation breaks after any rule was created in Japanese
   40487: Merged BRANCHES/V4.1 to BRANCHES/DEV/4.1-BUG-FIX:
      40485: ALF-15453: Incorrect manage permissions working for a file/folder
   40490: ALF-15455: Pass through windows specific environment variables (will not be set on unix) to make ImageMagick work on Windows with Bitrock layout
   40492: Merged BRANCHES/DEV/BELARUS/V4.1-BUG-FIX-2012_08_15 to BRANCHES/DEV/V4.1-BUG-FIX
      40491: ALF-7803 : Tomcat 7??? "Submit Items" page isn't opened
             The duplicate cellpadding attibutes were removed from jsp.
   40495: Final part of achievable fix for ALF-12803 - No user feedback: Cannot transformed content with password. (Failure of synchronous rule causes upload to fail with unhelpful message)
    - cleaned up flash error message - but see comments on ALF-12803 for full resolution
   40522: ALF-12839 Share - Inconsistency in adding a user or a group into a group
   40525: ALF-12839 Share - Inconsistency in adding a user or a group into a group
      - fix unit test by adding the * added by javascript code
   40535: ALF-15455: Another attempt
   - Properly escape global variables so bitrock doesn't try to expand them
   - Force backslash paths on windows
   40539: ALF-15455: ImageMagick still not working on Windows because env variable setting was losing the system PATH
   - Did it ever work before?
   - Now, if variables are specified, the PATH is propagated from the parent environment. If a PATH is specified, it is prepended to the parent PATH.
   40554: New Russian translations from Gloria plus Bitrock configuration to enable them
   40559: ALF-15506: When deleting a file from the actions menu a message was not shown to indicate that the folder is being deleted.
   40590: ALF-15318: It was possible for a user with a disabled / expired account to log in via NTLM/SSO
   40591: Merged V4.1 to V4.1-BUG-FIX
      40485: ALF-15453: Incorrect manage pernissions working for a file/folder
      40545: Fixes a bug in the visibility of the Cloud Sync settings page on the user profile.
   40592: Merged V4.1 to V4.1-BUG-FIX (RECORD ONLY)
      40478: Merged BRANCHES/DEV/V4.1-BUG-FIX to BRANCHES/V4.1
         40153: ALF-13998: 'No items' error is highlighted in red, even that is not sever error.
         40361: ALF-15453: Incorrect manage permissions working for a file/folder
      40481: Merge issue in r40478 fixed
   40593: Merged V3.4-BUG-FIX to V4.1-BUG-FIX
      40503: Fix for ALF-14832 - Search by Tags is not working in WCMQS site


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@40594 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2012-08-19 14:12:51 +00:00
parent 6ee3bd50b4
commit 569c55eadc
5 changed files with 82 additions and 16 deletions

View File

@@ -18,9 +18,13 @@
*/
package org.alfresco.repo.security.authentication;
import net.sf.acegisecurity.AccountExpiredException;
import net.sf.acegisecurity.Authentication;
import net.sf.acegisecurity.CredentialsExpiredException;
import net.sf.acegisecurity.DisabledException;
import net.sf.acegisecurity.GrantedAuthority;
import net.sf.acegisecurity.GrantedAuthorityImpl;
import net.sf.acegisecurity.LockedException;
import net.sf.acegisecurity.UserDetails;
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import net.sf.acegisecurity.providers.dao.User;
@@ -51,6 +55,24 @@ public class AuthenticationContextImpl implements AuthenticationContext
{
try
{
// Apply the same validation that ACEGI would have to the user details - we may be going through a 'back
// door'.
if (!ud.isEnabled())
{
throw new DisabledException("User is disabled");
}
if (!ud.isAccountNonExpired())
{
throw new AccountExpiredException("User account has expired");
}
if (!ud.isAccountNonLocked())
{
throw new LockedException("User account is locked");
}
if (!ud.isCredentialsNonExpired())
{
throw new CredentialsExpiredException("User credentials have expired");
}
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(ud, "", ud
.getAuthorities());
auth.setDetails(ud);