MNT-17199 - CSV user import: if password is left blank it should be randomly generated

Modified UserCSVUploadPost behaviour to use an empty string for password creation instead of the user's first name.
   Modified RepositoryAuthenticationDao > createUser behaviour to treat the case when the password is an empty string or null.
   Added a Unit test.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@136902 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2017-05-24 10:17:12 +00:00
parent 1f6c8d6535
commit b2d5de0078

View File

@@ -527,7 +527,7 @@ public class UserCSVUploadPost extends DeclarativeWebScript
// If no password was given, use their surname // If no password was given, use their surname
if (!user.containsKey(ContentModel.PROP_PASSWORD)) if (!user.containsKey(ContentModel.PROP_PASSWORD))
{ {
user.put(ContentModel.PROP_PASSWORD, user.get(ContentModel.PROP_LASTNAME)); user.put(ContentModel.PROP_PASSWORD, "");
} }
// Skip any user who looks like an example file heading // Skip any user who looks like an example file heading