Siby Mathew:
Hi Ram,
If you only specify the LDAP config and disable the import properties, then liferay will try to import the user only when he logs in.
You may override UserLocalServiceImpl.authenticateByScreenName() using a hook.
At that point you have the screenname entered by the user.
You can check if its screenA, then call super.authenticateForBasic(), otherwise call super.authenticateByScreenName()
Hope this helps
Thanks,
Siby Mathew
Thanks Siby for the help.
My scenario is as follows:
I am using liferay 6.0.6 and i am importing the users from ldap at frequent intervals and on server startup.
i am doing the user authentication by screen name not email Address.
When it is trying to import all users from ldap,if user existed in
'User_ ' table it is updating that record.
If user(say
'X' imported from ldap) does not exists it is trying to add that user in DB.
if any other user in liferay table
'User_' has the same company id and emailAddress of user 'X' ,it is throwing the below error while adding 'X' in DB.
13:39:57,951 ERROR [JDBCExceptionReporter:234] Cannot insert duplicate key row in object 'dbo.User_' with unique index 'IX_615E9F7A'.13:39:57,953 ERROR [PortalLDAPImporterImpl:507] Unable to import user CN=Mikhail Popov,OU=Users,OU=OU_HMT: null:null:{samaccountname=sAMAccountName: erumpopo}
com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:190)
at com.liferay.portal.service.persistence.UserPersistenceImpl.updateImpl(UserPersistenceImpl.java:551)
at com.liferay.portal.service.persistence.UserPersistenceImpl.updateImpl(UserPersistenceImpl.java:1)
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:254)
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:274)
at com.liferay.portal.service.impl.MyUserLocalServiceImpl.addUser(MyUserLocalServiceImpl.java:422)
how can we filter the users while importing such that if the importing user has the same company id and emailAddress of the existing user in DB,we can exclude the importing of user.
Is it possible?
Please help me .
Thanks in advance
Ram A
Please sign in to flag this as inappropriate.