Fórumok

Which DB table holds LDAP config? [SOLVED]

thumbnail
Natalie D, módosítva 12 év-val korábban

Which DB table holds LDAP config? [SOLVED]

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2012.02.06. Legújabb bejegyzések
Hi all
Does somebody know in which database table Liferay stores LDAP configuration?

Of course initial configuration is being read from portal-ext.properties, but any further changes inside Liferay's ControlPanel override those from portal-ext.properties.
thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config?

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
In PortletPreferences in xml format.

If you're going to program, it's the PortletPreferencesLocalServiceUtil
thumbnail
Natalie D, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config?

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2012.02.06. Legújabb bejegyzések
Hitoshi Ozawa:
In PortletPreferences in xml format.

If you're going to program, it's the PortletPreferencesLocalServiceUtil


Thanks Hitoshi for extremely fast response - but what if I would like to modify property ldap.user.custom.mappings? Is PortletPreferencesLocalServiceUtil a good way to go?

To be honest, I would like to set this property permanently, but changes from portal-ext.properties have no effect - probably due to existing ldap configuration created inside Control Panel.

Natalie
thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config?

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
To be honest, I would like to set this property permanently, but changes from portal-ext.properties have no effect - probably due to existing ldap configuration created inside Control Panel.


So, what you really want to do is to delete the setting you've made in the database and allow portal-ext.properties to become effective once again.
There's an utility to handle xml but that's too complicated and time wasting. A lot easier just deleting the database setting using the API.
thumbnail
Natalie D, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config?

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2012.02.06. Legújabb bejegyzések
Hitoshi Ozawa:

... A lot easier just deleting the database setting using the API.


Do you know which API serves this purpose?
thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config? (Válasz)

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
It the same API. Look in the database table to see if there's may be some other settings in the xml document. If there isn't you can delete it.

If there is, (now don't tell anybody I told you this because this is a hack and may not work), but if you can take your Liferay server down,
take it down and try deleting the LDAP settings from the xml. AFAIK, xml contents aren't dependent of other entities. (I do this on my development
server, but I drop and recreate Liferay database once a month.)

If this is your production server, probably not a good idea to hack it.

EDIT:
http://www.liferay.com/community/wiki/-/wiki/Main/LDAP

Liferay is ignoring the values in my portal-ext.properties file #
• Ive been changing the values in my portal-ext.properties file, but those changes arent reflected in the portal.. what is going on? Property values can also be set via the GUI/website. Once you "save" properties via the GUI/website, those settings will be saved in the database and those take precedence. In this case,
◦ 1) continue to use the GUI/website to set your property values.
◦ 2) manually remove those saved values from the database. WARNING.. this will remove all your saved values for authentication and you will either be using the default values, or your custom values in portal-ext.properties (if they exist). find the "portletpreferences" table, the record you want to delete will have the following values:
◦ plid=0
◦ portletid=LIFERAY_PORTAL
◦ the "preferences" field will start with "<portlet-preferences><preference><name>ldap.base.dn</name>"
thumbnail
Natalie D, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config?

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2012.02.06. Legújabb bejegyzések
Hitoshi Ozawa:
It the same API. Look in the database table to see if there's may be some other settings in the xml document. If there isn't you can delete it.

If there is, (now don't tell anybody I told you this because this is a hack and may not work), but if you can take your Liferay server down,
take it down and try deleting the LDAP settings from the xml. AFAIK, xml contents aren't dependent of other entities. (I do this on my development
server, but I drop and recreate Liferay database once a month.)


I'm not sure this is a good way to go...

You may bu suprised, but the only thing I want to do is synchronize custom (expando) attributes with LDAP fields.

I know it should be as easy as setting ldap.user.custom.mappings.0 and ldap.contact.custom.mappings.0 but the problems are existing LDAP servers added from ControlPanel.
thumbnail
Natalie D, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config? (Válasz)

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2012.02.06. Legújabb bejegyzések
Natalie D:
Hitoshi Ozawa:
It the same API. Look in the database table to see if there's may be some other settings in the xml document. If there isn't you can delete it.

If there is, (now don't tell anybody I told you this because this is a hack and may not work), but if you can take your Liferay server down,
take it down and try deleting the LDAP settings from the xml. AFAIK, xml contents aren't dependent of other entities. (I do this on my development
server, but I drop and recreate Liferay database once a month.)


You may bu suprised, but the only thing I want to do is synchronize custom (expando) attributes with LDAP fields.

I know it should be as easy as setting ldap.user.custom.mappings.0 and ldap.contact.custom.mappings.0 but the problems are existing LDAP servers added from ControlPanel.



I've finally did it! But it is unecessary complicated. And when I imagine that this task should be as easy as adding one textfield for ldap.user.custom.mappings property on the page: Control Panel -> Portal Settings -> Authentication -> LDAP. Ehh!

And I have found a mistake on wiki page:

1) continue to use the GUI/website to set your property values.
2) manually remove those saved values from the database. WARNING.. this will remove all your saved values for authentication and you will either be using the default values, or your custom values in portal-ext.properties (if they exist). find the "portletpreferences" table, the record you want to delete will have the following values:


Table's name is not portletpreferences but portalpreferences.

Hitoshi - big thanks to You. Without Your help I would stuck for even more hours than 8h, that this task took me.

Natalie
thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config?

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
Table's name is not portletpreferences but portalpreferences.


Thanks, just updated the wiki. emoticon
Roshan Qureshi, módosítva 12 év-val korábban

RE: Which DB table holds LDAP config?

Regular Member Bejegyzések: 159 Csatlakozás dátuma: 2010.08.24. Legújabb bejegyzések
Thanks Hitoshi for your detail explanation.
thumbnail
Eduardo Pantoja Ramírez, módosítva 10 év-val korábban

RE: Which DB table holds LDAP config?

New Member Bejegyzések: 8 Csatlakozás dátuma: 2013.08.24. Legújabb bejegyzések
Hi to all,

I have an issue here, i don't know how i did it but i looked into the portalPreferences Table and i found that the expando values i mapped in the portal-ext.properties for the first time are also stored in the XML field of the portletPreferences and now, each time i try to change this preferences in the portal-ext.properties the portal is not updating this mappings, even new mappings to other expando fields are not being updated. i don't want to delete all the preferences from the database because i'm working with a poductive enviroment. What can i do to solve this!, please help me emoticon.
thumbnail
Ahmed Hasan, módosítva 10 év-val korábban

RE: Which DB table holds LDAP config?

Expert Bejegyzések: 306 Csatlakozás dátuma: 2007.04.13. Legújabb bejegyzések
Hi Sir,

Yes, this is an issue with Liferay and even you change in portal-ext.properties the entries in the table are not getting updated. They make it there during the first time the server is started. You can try changing these values from the admin UI. Hopefully, it should get reflected in the DB. Even if this is not helping you. you manually update the XML in the portalpreferences and portletpreferences table that contain the wrong values, save the record and restart the server. Hope this helps.


Yours truly,
Ahamed Hasan
Author, Liferay Portlet Cookbook
Marc Grünewald, módosítva 11 év-val korábban

RE: Which DB table holds LDAP config?

Junior Member Bejegyzések: 45 Csatlakozás dátuma: 2012.03.20. Legújabb bejegyzések
Hello Natalie,

hopefully you'll read this. Could you tell me how you mapped the Custom Fields? I seem to be to stupid to do it. Let's say I have a Custom Field "canSign" on User and want to map that to "whateverattribute" on my LDAP Server. Do you mind telling me how the code would look like?
I would really appreciate that.

Best Regards

Marc
thumbnail
Natalie D, módosítva 11 év-val korábban

RE: Which DB table holds LDAP config?

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2012.02.06. Legújabb bejegyzések
Hello Marc

It is as simply as setting inside portal-ext.properties:


#
# When importing and exporting users, the portal will use this mapping to
# connect LDAP user attributes and portal user's custom (expando) attributes.
#
ldap.user.custom.mappings.0=mobilePhone=mobileInLDAP\nlandlinePhone=telephoneNumberInLDAP\ndivision=departmentInLDAP


Unfortunately there is no way to set those via GUI (I mean Liferay Control Panel). It has to be done manually in portal-ext.properties before server's startup.
Best before adding the new LDAP server via GUI (otherwise You would have to set it up manually in the database's table: portalpreferences - as I described in previous posts).

Regards
Natalie
Marc Grünewald, módosítva 11 év-val korábban

RE: Which DB table holds LDAP config?

Junior Member Bejegyzések: 45 Csatlakozás dátuma: 2012.03.20. Legújabb bejegyzések
Hhm okay I see. I thought I'd have to somehow access the ExpandoTables from within the portal-ext to access the Users Custom Fields. Silly me, thanks a lot!

Cheers Marc
thumbnail
Luis Mas, módosítva 11 év-val korábban

RE: Which DB table holds LDAP config?

Regular Member Bejegyzések: 146 Csatlakozás dátuma: 2009.05.18. Legújabb bejegyzések
Natalie D:
Hello Marc

It is as simply as setting inside portal-ext.properties:


#
# When importing and exporting users, the portal will use this mapping to
# connect LDAP user attributes and portal user's custom (expando) attributes.
#
ldap.user.custom.mappings.0=mobilePhone=mobileInLDAP\nlandlinePhone=telephoneNumberInLDAP\ndivision=departmentInLDAP


Unfortunately there is no way to set those via GUI (I mean Liferay Control Panel). It has to be done manually in portal-ext.properties before server's startup.
Best before adding the new LDAP server via GUI (otherwise You would have to set it up manually in the database's table: portalpreferences - as I described in previous posts).

Regards
Natalie


I opened a ticket asking for this: http://issues.liferay.com/browse/LPS-30409