Merged 5.2.N (5.2.1) to HEAD (5.2)

132027 mward: REPO-1503: password is now mandatory.
   First check in at my new desk!
   I've also removed the auto-generation of passwords (UUID) since this is no longer needed with a mandatory password field.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@132327 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-11-03 14:03:00 +00:00
parent 21356a4eaa
commit 0e5f80f4eb
2 changed files with 7 additions and 2 deletions

View File

@@ -297,8 +297,7 @@ public class PeopleImpl implements People
Map<QName, Serializable> props = person.toProperties();
MutableAuthenticationService mas = (MutableAuthenticationService) authenticationService;
String password = person.getPassword() == null ? UUID.randomUUID().toString() : person.getPassword();
mas.createAuthentication(person.getUserName(), password.toCharArray());
mas.createAuthentication(person.getUserName(), person.getPassword().toCharArray());
mas.setAuthenticationEnabled(person.getUserName(), person.isEnabled());
NodeRef nodeRef = personService.createPerson(props);
@@ -328,6 +327,7 @@ public class PeopleImpl implements People
checkRequiredField("firstName", person.getFirstName());
checkRequiredField("email", person.getEmail());
checkRequiredField("enabled", person.isEnabled());
checkRequiredField("password", person.getPassword());
}
private void checkRequiredField(String fieldName, Object fieldValue)