掲示板

Which DB table holds LDAP config? [SOLVED]

thumbnail
12年前 に Natalie D によって更新されました。

Which DB table holds LDAP config? [SOLVED]

Junior Member 投稿: 55 参加年月日: 12/02/06 最新の投稿
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
12年前 に Hitoshi Ozawa によって更新されました。

RE: Which DB table holds LDAP config?

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
In PortletPreferences in xml format.

If you're going to program, it's the PortletPreferencesLocalServiceUtil
thumbnail
12年前 に Natalie D によって更新されました。

RE: Which DB table holds LDAP config?

Junior Member 投稿: 55 参加年月日: 12/02/06 最新の投稿
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
12年前 に Hitoshi Ozawa によって更新されました。

RE: Which DB table holds LDAP config?

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
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
12年前 に Natalie D によって更新されました。

RE: Which DB table holds LDAP config?

Junior Member 投稿: 55 参加年月日: 12/02/06 最新の投稿
Hitoshi Ozawa:

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


Do you know which API serves this purpose?
thumbnail
12年前 に Hitoshi Ozawa によって更新されました。

RE: Which DB table holds LDAP config? (回答)

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
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
12年前 に Natalie D によって更新されました。

RE: Which DB table holds LDAP config?

Junior Member 投稿: 55 参加年月日: 12/02/06 最新の投稿
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
12年前 に Natalie D によって更新されました。

RE: Which DB table holds LDAP config? (回答)

Junior Member 投稿: 55 参加年月日: 12/02/06 最新の投稿
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
12年前 に Hitoshi Ozawa によって更新されました。

RE: Which DB table holds LDAP config?

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Table's name is not portletpreferences but portalpreferences.


Thanks, just updated the wiki. emoticon
12年前 に Roshan Qureshi によって更新されました。

RE: Which DB table holds LDAP config?

Regular Member 投稿: 159 参加年月日: 10/08/24 最新の投稿
Thanks Hitoshi for your detail explanation.
thumbnail
10年前 に Eduardo Pantoja Ramírez によって更新されました。

RE: Which DB table holds LDAP config?

New Member 投稿: 8 参加年月日: 13/08/24 最新の投稿
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
10年前 に Ahmed Hasan によって更新されました。

RE: Which DB table holds LDAP config?

Expert 投稿: 306 参加年月日: 07/04/13 最新の投稿
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
11年前 に Marc Grünewald によって更新されました。

RE: Which DB table holds LDAP config?

Junior Member 投稿: 45 参加年月日: 12/03/20 最新の投稿
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
11年前 に Natalie D によって更新されました。

RE: Which DB table holds LDAP config?

Junior Member 投稿: 55 参加年月日: 12/02/06 最新の投稿
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
11年前 に Marc Grünewald によって更新されました。

RE: Which DB table holds LDAP config?

Junior Member 投稿: 45 参加年月日: 12/03/20 最新の投稿
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
11年前 に Luis Mas によって更新されました。

RE: Which DB table holds LDAP config?

Regular Member 投稿: 146 参加年月日: 09/05/18 最新の投稿
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