-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.2.10 EE GA1, 6.2.X EE, 7.0.0 DXP GA1
-
Fix Version/s: 7.0.0 DXP FP2, 7.0.0 DXP SP1, 7.0.3 CE GA4, Master
-
Component/s: User Management
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Fix Priority:4
-
Git Pull Request:
The basic problem is that you can set the birthday of a user to a date in the future, so to reproduce the issue probably it is enough if you just run the attached groovy script.
Reproduction steps:
- Go to Control Panel -> Portal Settings -> Authentication -> LDAP
- Add an LDAP server and check the checkboxes beside enabled, required, Import Enabled, Export Enabled. (I used Apache DS)
- Create a user - it will be exported
- Run the attached groovy script (it is not the best, but it can be used to change the birthday of the user, you only need to specify the user's e-mail address) groovy.txt
Experienced behavior: After some time you will see the following exception in the log:
11:51:20,199 ERROR [liferay/scheduler_dispatch-1][PortalLDAPImporterImpl:725] Unable to import user cn=laci: null:null:{cn=cn: laci} com.liferay.portal.ContactBirthdayException at com.liferay.portal.service.impl.UserLocalServiceImpl.getBirthday(UserLocalServiceImpl.java:5779) at com.liferay.portal.service.impl.UserLocalServiceImpl.updateUser(UserLocalServiceImpl.java:5233) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175) at com.sun.proxy.$Proxy109.updateUser(Unknown Source) at com.liferay.portal.service.UserLocalServiceUtil.updateUser(UserLocalServiceUtil.java:3399) at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.updateUser(PortalLDAPImporterImpl.java:1276) at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importUser(PortalLDAPImporterImpl.java:954) at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAPByUser(PortalLDAPImporterImpl.java:715) at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:202) at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:138) at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:100) at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:39) at com.liferay.portlet.admin.messaging.LDAPImportMessageListener.doReceive(LDAPImportMessageListener.java:51) at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26) at sun.reflect.GeneratedMethodAccessor503.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67) at com.sun.proxy.$Proxy300.receive(Unknown Source) at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:77) at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72) at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71) at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682) at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593) at java.lang.Thread.run(Thread.java:745)
Expected behavior: You shouldn't be able to set the user's birthday to a date in the future