Foros de discusión

SO : Can't send PM to others users if portlet not deployed in private pages

thumbnail
nicolas saubi, modificado hace 8 años.

SO : Can't send PM to others users if portlet not deployed in private pages

Junior Member Mensajes: 43 Fecha de incorporación: 28/10/09 Mensajes recientes
Related to : https://issues.liferay.com/browse/SOS-1465
Liferay 6.1.2 CE GA3

Hi,

we're encountering a problem with private messaging portlet (from SO).
We have forbidden the public and private pages of users (no members has access to [site]/user/name). Therefore, we have a page in our site which gives access to the private messaging portlet to users.

Fact is, users can only see the messages (and message is only sent) if they send it to themselfs. If we try to send a message to another person, nothing happens (no exception, no logs, success message is there but nothing happens in database).

If we allow private pages for users and deploy the private messaging portlet to each user's private page, then we can send PM to others users.

Would anyone know how (or where) we could modify the private messaging code in order to allow user A to PM user B without using private pages ? On our production site, there is no private pages for users, who btw don't have the power user role.

****************
EDIT :

If it's too much of an hassle to do it this way, another solution would be to :
- give back "power user" role to users : ok
- deploy for new users the private messaging portlet to private user page : how to ? I think it can be done by configuration, but don't know where.
- update database for users who already have private pages to give them the private messaging portlet (database request ? hook ?)
****************

Thanks in advance.
thumbnail
Ken David Duenwald, modificado hace 8 años.

RE: SO : Can't send PM to others users if portlet not deployed in private p

New Member Mensajes: 3 Fecha de incorporación: 28/01/11 Mensajes recientes
Hi Nicolas,

The private messaging portlet was specifically designed to be used on a user's private pages only. In the second to last comment of SOS-1465, it is mentioned that the portlet must be placed on a private page. This I believe was put in place in order to avoid the potential risk of people's private messages being visible to everyone on a public page.

Because of this, it is not advisable to modify the code to allow the private messaging portlet to be used on a public page. However, if you would like to present more information as to why you would prefer this specific use case, you're definitely more than welcome to do so here.

I did some research on how to give all existing and new users the private messaging portlet in their private pages in 6.1 and I came up with something similar to what was listed here.

Here are my steps:

1. Go to Control Panel
2. Create a Site Template (You can also use an existing Site Template if you wish)
3. Click on the Site Template and then click View Pages.
4. Add the private messaging portlet to a page. Save
5. Click User Groups in Control Panel
6. Add a User Group and select the Site Template with the private messaging portlet in the dropdown labelled "Private Pages". Save
7. Assign your existing users to the User Group
8. Click Portal Settings in Control Panel
9. In the Portal Settings menu, click Users and then Default User Associations
10. Type in the User group name under the User Groups field and Save
11. This will allow all new users to be part of that group and receive the site template

Feel free to try this out and see if this works for you.
thumbnail
nicolas saubi, modificado hace 8 años.

RE: SO : Can't send PM to others users if portlet not deployed in private p

Junior Member Mensajes: 43 Fecha de incorporación: 28/10/09 Mensajes recientes
Hi David and thanks for your reply,

I managed to work this out this way :
- added this in portal-ext.properties
## private messaging ##
default.user.private.layout.column-1=82,23,11,1_WAR_privatemessagingportlet

- updated database to set all users who already have private pages to get the privatemessagingportlet :
update layout set typesettings='layout-template-id=2_columns_ii
column-2=1_WAR_privatemessagingportlet,29,8
column-1=82,23,11,' where friendlyurl='/home' and privatelayout=true

This way users with private page already created get the private messaging portlet in their private page (we don't allow users to go to their private page, so we can set whatever portlet in it), and we give new users the portlet PM with the portal-ext property.

Hop !
thumbnail
Ken David Duenwald, modificado hace 8 años.

RE: SO : Can't send PM to others users if portlet not deployed in private p

New Member Mensajes: 3 Fecha de incorporación: 28/01/11 Mensajes recientes
Hi Nicholas,

Glad to hear that worked!