Fórum

How restrict LDAP import

raghu N M, modificado 13 Anos atrás.

How restrict LDAP import

Junior Member Postagens: 27 Data de Entrada: 27/07/10 Postagens Recentes
Hello liferay development team,

I have two source to import users. One is LDAP and other sql server. LDAP has unwanted users that i don't want to import, all the users must match sql server.

Is there any way I can write a script to do this task.

Please help.

Thanks in advance,
Sincerely yours,
Raghu NM
thumbnail
Rahul Pande, modificado 13 Anos atrás.

RE: How restrict LDAP import

Expert Postagens: 310 Data de Entrada: 07/07/10 Postagens Recentes
Hi Raghhu,

As per my understanding you want only those user in your liferay database which are common in
LDAP and sql server. If this is the case you have to customize liferay import process.

For that you can you can refer following link.

LDAP Enhancement

Thanks & regards.
Rahul
raghu N M, modificado 13 Anos atrás.

RE: How restrict LDAP import

Junior Member Postagens: 27 Data de Entrada: 27/07/10 Postagens Recentes
Thanks Rahul. I have done all the procedure given in LDAP enhancements.
added
ext-spring.xml
under docroot/WEB-INF/ext-web/docroot/META-INF

<?xml version="1.0" encoding="UTF-8"?>

<beans
default-destroy-method="destroy"
default-init-method="afterPropertiesSet"
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
>
<bean id="com.liferay.portal.security.ldap.PortalLDAPImporterUtil" class="com.liferay.portal.security.ldap.PortalLDAPImporterUtil">
<property name="portalLDAPImporter">
<bean class="com.cookmedical.LDAP.CookPortalLDAPImporterImpl">
<property name="LDAPToPortalConverter" ref="ldapToPortalConverter" />
</bean>
</property>
</bean>
</beans>

but nothing is printing out. Find the attached war file. Please let me know if I am missing anything.
thumbnail
amit doshi, modificado 12 Anos atrás.

RE: How restrict LDAP import

Liferay Master Postagens: 550 Data de Entrada: 29/12/10 Postagens Recentes
Hi raghu,

I had done the similar things that you are looking for.

I used to take all the user's from Liferay into one liferayUser Array and then iterate the Liferayuser and compare with LDAPuser.
Both have one field common screenname using which we will be compare.



for (int i = 0; i &lt; liferayUsers.size(); i++)
		{
// here if the user does
			if (ldapUser.contains(liferayUsers.get(i).getScreenName()) )
			{
				
				result.add(liferayUsers.get(i).getScreenName());

			}
	
		}



And result will contains the array of common user in LDAP and mysql in my case.

Hope it helps.

Thanks & Regards,
Amit Doshi