Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Boris Niyazov
How to disable My Account
14. April 2008 22:05
Antwort

Boris Niyazov

Rang: Junior Member

Nachrichten: 27

Eintrittsdatum: 13. April 2008

Neue Beiträge

Hello there,

We are evaluating Liferay to use as an enterprise portal at the Columbia Law School. We're able to integrate it with our LDAP and would want to disable field modifications on My Account page, since the info is synchronized with LDAP I was trying to search the message board for that but without any success. Any help will be appreciated. We are using Liferay version 4.4.2

Boris
Victor Zorin
RE: How to disable My Account
16. April 2008 05:30
Antwort

Victor Zorin

Rang: Liferay Legend

Nachrichten: 1176

Eintrittsdatum: 14. April 2008

Neue Beiträge

If you need to secure your LDAP store:
- Use one-way synchronisation with LDAP
- Disable access to MyAccount for non-admin users. The easiest way is by modifying your theme templates, 5 minute job.
Leandro Del Sole da Silva
RE: How to disable My Account
16. April 2008 12:56
Antwort

Leandro Del Sole da Silva

Rang: Junior Member

Nachrichten: 98

Eintrittsdatum: 7. April 2008

Neue Beiträge

Victor Zorin, could you specify how to disable it?
What I must change for disable that?

In my case, I want to disable My places for the normal users...

Thanks
Victor Zorin
RE: How to disable My Account
17. April 2008 00:56
Antwort

Victor Zorin

Rang: Liferay Legend

Nachrichten: 1176

Eintrittsdatum: 14. April 2008

Neue Beiträge

Hi Leandro

Have a look at the look-and-feel theme that you are using.
It would usually have the file called 'init_custom.vm' that is located on '.../html/themes/{theme-name}/templates/' path, say for brochure it is 'ROOT.war\html\themes\brochure\templates\'.

To disable MyAccount, open this 'init_custom.vm' file for editing, and add the following line:
1#set($show_my_account=false)


This would disable showing of MyAccount option for everyone.
The default behavior for show_my_account variable is true for signed-in and false for not-signed-in.
If you need to make it current-URL or user-role dependent, some extra scripting would be required.

You do not have to restart Liferay, for the changes to take place, just hit the 'refresh' button on your browser.

Regards
Victor
Leandro Del Sole da Silva
RE: How to disable My Account
17. April 2008 04:45
Antwort

Leandro Del Sole da Silva

Rang: Junior Member

Nachrichten: 98

Eintrittsdatum: 7. April 2008

Neue Beiträge

Thank you Victor ! emoticon
Suresh Amala
RE: How to disable My Account
23. April 2008 03:02
Antwort

Suresh Amala

Rang: New Member

Nachrichten: 5

Eintrittsdatum: 1. April 2008

Neue Beiträge

Hello Victor

could you suggest the way to "Disable access to MyAccount for non-admin users".
Artur Linhart
RE: How to disable My Account
23. April 2008 07:37
Antwort

Artur Linhart

Rang: Expert

Nachrichten: 458

Eintrittsdatum: 13. September 2007

Neue Beiträge

Hello,

To know which variables are possible to use, go and look into the files

webapps\ROOT\html\themes\_unstyled\templates\init.vm

and

VelocityVariables.java (You need to download the source codes for it)

The *.vm are the files written in velocity, so You need to know the velocity syntax to get over it.

So, for example, You can modify the dock.vm from the original one:
1
2        #if ($show_my_account)
3            <li class="my-account">
4                <a href="$my_account_url">$my_account_text</a>
5            </li>
6        #end


to the following one:
1
2          #if ($permissionChecker.isOmniadmin())
3        #if ($show_my_account)
4            <li class="my-account">
5                <a href="$my_account_url">$my_account_text</a>
6            </li>
7        #end
8          #end


- You can use for example various methods from permission checker:

 1
 2public interface PermissionChecker {
 3
 4    public long getUserId();
 5
 6    public boolean hasPermission(
 7        long groupId, String name, long primKey, String actionId);
 8
 9    public boolean hasPermission(
10        long groupId, String name, String primKey, String actionId);
11
12    public boolean hasUserPermission(
13        long groupId, String name, String primKey, String actionId,
14        boolean checkAdmin);
15
16    public boolean isOmniadmin();
17
18    public boolean isCompanyAdmin(long companyId);
19
20    public boolean isCommunityAdmin(long groupId);
21
22    public boolean isCommunityOwner(long groupId);
23
24}
Jerry Niu
RE: How to disable My Account
23. April 2008 16:50
Antwort

Jerry Niu

LIFERAY STAFF

Rang: Expert

Nachrichten: 451

Eintrittsdatum: 21. Juni 2006

Neue Beiträge

The suggestions to remove it from the theme via hard coding and via dynamic elements does prevent a user from "clicking" something.

If they have the URL, they can still get to the page.

My suggestion is to add the LDAP sync on a daily basis to update Liferay with the latest LDAP information about a user.

Secondly, I would programmatically add the role check to the my accounts page and prevent them from changing the data in the first place. You can do this in the code by extending the my accounts portlet. You can also prevent "role" from accessing the portlet.
Bryan Cheung
RE: How to disable My Account
23. April 2008 20:09
Antwort

Bryan Cheung

LIFERAY STAFF

Rang: Expert

Nachrichten: 359

Eintrittsdatum: 26. August 2004

Neue Beiträge

Boris Niyazov:
Hello there,

We are evaluating Liferay to use as an enterprise portal at the Columbia Law School. We're able to integrate it with our LDAP and would want to disable field modifications on My Account page, since the info is synchronized with LDAP I was trying to search the message board for that but without any success. Any help will be appreciated. We are using Liferay version 4.4.2

Boris


Hey Boris,

I almost attended CLS had I not been sidetracked by this whole open source software thing. emoticon I hope you guys decide to use Liferay - what are the decision factors for you?
Boris Niyazov
RE: How to disable My Account
26. April 2008 19:04
Antwort

Boris Niyazov

Rang: Junior Member

Nachrichten: 27

Eintrittsdatum: 13. April 2008

Neue Beiträge

Yes, Jerry, you're right - hiding My Account from the drop down does not generally prevent users getting to it. For example, they can get their via directory portlet and modify the content. I thought that My Account portlet can be configured to make it only viewable and not editable by ordinary users (by the means of assigning access modes for different roles) but I can't see that option, at least in the version 4.4.2 that I installed, and I am not sure why it wasn't done. So, I guess we'll have to follow your suggestion of extending the portlet code.

Your suggestion of daily syncing with LDAP does not look very attractive to us though - we prefer real time updates, and consider triggering liferay data updates when LDAP account is updated/removed. Does liferay have any utility out of the box that would do the background user account update or it has to be developed? Or maybe someone already done that.

Thanks
Artur Linhart
RE: How to disable My Account
2. Mai 2008 03:03
Antwort

Artur Linhart

Rang: Expert

Nachrichten: 458

Eintrittsdatum: 13. September 2007

Neue Beiträge

Hello,

if there will be no other chance, You can modify the JSP in such a way the user will not be able to modify some specified fields from the "My Account" portlet fields... This should be not very time-consuming operation. You can find all the actions related to the "My Account" in struts-config.xml if searching for string "my_account". There You can find the mapping to the java actions and find the related JSPs in tiles-def.xml (use the forward name from the struts-config.xml file). If You have the JSP You can modify it to obtain the requested functionality. The JSP can be used in more portlets/actions, so there should be performed the modifications which will not cause the problems in the various usage contexts - but I could imagine, this will be possible to implement in Your case, because You want the user is unable to edit his fields independently on the context where the JSP is shown.

It's not the solution, only pointer to the way :-)

with regards, Archie
Victor Zorin
RE: How to disable My Account
2. Mai 2008 04:26
Antwort

Victor Zorin

Rang: Liferay Legend

Nachrichten: 1176

Eintrittsdatum: 14. April 2008

Neue Beiträge

Boris Niyazov:
hiding My Account from the drop down does not generally prevent users getting to it. For example, they can get their via directory portlet and modify the content. I thought that My Account portlet can be configured to make it only viewable and not editable by ordinary users ...

This is true, but rather than modifying JSP it is easier to disable MyAccount portlet completely by commenting it out from liferay-portlet.xml file. This way it is no longer going be available to anyone. Administrator would still able to apply necessary modifications to user details using Admin tools.
Friedrich Heinzinger
RE: How to disable My Account
6. August 2010 01:12
Antwort

Friedrich Heinzinger

Rang: New Member

Nachrichten: 1

Eintrittsdatum: 6. August 2010

Neue Beiträge

Hi,

I know this is an old thread but it describes exactly my problem.

Using LR 5.2.3

When I disable the "My Account" the usual way, that is using <include>false</include> in liferay-portlet.xml, it shows no effect at all. This works with other portlets, for example with "My Pages".
When I disable the whole "My Account"-portlet tag, it gets not accessible: when accessed it displays an error something like "...no-permission.." (The link in the control panel and in the dock to "My Account" are still there).

So either way: I have do remove the menu item from the theme. Is this correct?
And I would also have to remove the menu-item from the control panel... ?!?, since I want to have it removed completely.

I managed to remove the menu-item from my own theme, but not from the "classic"-theme. I tried modifying "init_custom.vm" in "classic" and "_unstyled" (only because "classic" didn't work) without success. Is there something I missed?

I couldn't find any hint in the controlpanel-theme for these menu-items (on the left). Where would I have to remove the "My Account"-link?

Thanks for any inputs.
F.