Fórum

How to disable users account configuration

Pierre-Olivier Kaplan, modificado 9 Anos atrás.

How to disable users account configuration

New Member Postagens: 2 Data de Entrada: 01/10/14 Postagens Recentes
Hello dear developpers,

I'm trying to prevent my portal users from accessing the account configuration. The link is given in the default sign-in portlet :



Is there a way to hide this link ? Or to disable the user account configuration ?

Thank you, best regards !
thumbnail
Hetal Jayesh Prajapati, modificado 9 Anos atrás.

RE: How to disable users account configuration

New Member Postagens: 12 Data de Entrada: 15/09/08 Postagens Recentes
Hi Pierre-Olivier Kapla,

You can do that with the use of hook. In hook you need to override login.jsp from login portlet.

Regards,
Hetal Prajapati
thumbnail
Jitendra Rajput, modificado 9 Anos atrás.

RE: How to disable users account configuration

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
Create hook and override login.jsp of Sign in portlet (/html/portlet/login/login.jsp) and override below snippet.

<c:when test="<%= themeDisplay.isSignedIn() %>">

		&lt;%
		String signedInAs = HtmlUtil.escape(user.getFullName());

		if (themeDisplay.isShowMyAccountIcon() &amp;&amp; (themeDisplay.getURLMyAccount() != null)) {
			String myAccountURL = String.valueOf(themeDisplay.getURLMyAccount());

			if (PropsValues.DOCKBAR_ADMINISTRATIVE_LINKS_SHOW_IN_POP_UP) {
				signedInAs = "<a href="\&quot;javascript:Liferay.Util.openWindow({dialog:" {destroyonhide: true}, title: '" + languageutil.get(pagecontext, "my-account") "', uri: htmlutil.escape(myaccounturl) "'});\">" + signedInAs + "</a>";
			}
			else {
				myAccountURL = HttpUtil.setParameter(myAccountURL, "controlPanelCategory", PortletCategoryKeys.MY);

				signedInAs = "<a href="\&quot;&quot;" + htmlutil.escape(myaccounturl) "\">" + signedInAs + "</a>";
			}
		}
		%&gt;

		&lt;%= LanguageUtil.format(pageContext, "you-are-signed-in-as-x", signedInAs, false) %&gt;
	</c:when>
Pierre-Olivier Kaplan, modificado 9 Anos atrás.

RE: How to disable users account configuration

New Member Postagens: 2 Data de Entrada: 01/10/14 Postagens Recentes
I went on that file, I found the code, and I removed this line :

<%= LanguageUtil.format(pageContext, "you-are-signed-in-as-x", signedInAs, false) %>

And it works ! Thanks both of you.

Best regards