[opencms-dev] Disappearing nav links...[Scanned]
Jon Mayes
jon.mayes at pegasus-homes.co.uk
Fri Jan 13 17:27:37 CET 2006
All,
I'm still having a problem with this... For example if I log in as
'Director', browse through the site pages, log out, log in again as a
different user (e.g. "Sales"), then when I browse to sections I've
already visited, the login element still shows that I'm logged in as
'Director', and the links within the site still reflect this (as certain
folders are restricted access).
Here's the code for my login element:
<code>
<%@ page session="false"
import="java.util.*,org.opencms.jsp.*,org.opencms.file.*" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%
//get the required OpenCms Object
CmsJspActionElement cms = new CmsJspActionElement(pageContext,
request, response);
CmsObject cmso = cms.getCmsObject();
//variables to catch the parameters from the request
String username = "";
String password = "";
String action = request.getParameter("action");
String requestedResource =
request.getParameter("requestedResource");
//catch the parameters if the user is trying to log in
if ( "login".equals(action) ) {
username = request.getParameter("username");
password = request.getParameter("password");
//log in the user
cmso.loginWebUser(username, password);
//out.println(cms.link(requestedResource));
response.sendRedirect(cms.link("/test2"));
} else if ( "logout".equals(action) ) {
request.getSession().invalidate();
cmso.loginUser("Guest","");
response.sendRedirect(cms.link("/test2"));
} else if (cms.user("name") != null && !"".equals(cms.user("name")) &&
!"guest".equals(cms.user("name").toLowerCase())) {
%>
<div class="login_element">
<form method="post">
Logged in as: <b><%= cms.user("name") %></b><br/>
<input type=hidden name=action value="logout"><input type=submit
value="Logout">
</form>
</div>
<%
} else {
%>
<div class="login_element">
<form method="post">
<input name="username" size="15" value="<%=username!=null?username:""
%>"><br/>
<input name="password" size="15" type="password"><br/>
<input type="submit" value="Login"></td><td><input type="hidden"
name="action" value="login"><br/>
</form>
</div>
<% } %>
</code>
I feel that this is a problem with caching, but should I be setting
something different in the page properties, or in the code?
*scratches head* :)
Jon
_____
From: Jon Mayes
Sent: 04 January 2006 17:02
To: The OpenCms mailing list
Subject: [opencms-dev] Disappearing nav links...[Scanned]
Hi guys,
I'm using the webuser function to authenticate users for certain areas
of an intranet. I have an interesting problem whereby sometimes after
logging a webuser in, the links that are not shown to unauthenticated
users sometimes disappear when browsing through pages after logging in.
Presumably this is due to a previously cached version of the page being
used, but do you think this is an issue with the browser or is there
some caching setting that I should change within opencms to prevent this
from happening?
Thanks,
Jon
Jon Mayes
Marketing & Business Systems
Pegasus Retirement Homes plc
Tel:
Fax:
Email: jon.mayes at pegasus-homes.co.uk
For more information on Pegasus please visit our web site at
www.pegasus-homes.co.uk <http://www.pegasus-homes.co.uk/>
Privileged/Confidential information may be contained in this message.
If you are not the addressee indicated in this message (or responsible
for delivery of the message to such person), you may not copy or deliver
this message to anyone. In such case, you should destroy this message
and kindly notify the sender by reply email. Please advise immediately
if you or your employer does not consent to Internet email for messages
of this kind. Opinions, conclusions and other information in this
message that do not relate to the official business of my firm shall be
understood as neither given nor endorsed by it.
Jon Mayes
Marketing & Business Systems
Pegasus Retirement Homes plc
Tel:
Fax:
Email: jon.mayes at pegasus-homes.co.uk
For more information on Pegasus please visit our web site at www.pegasus-homes.co.uk
Privileged/Confidential information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of my firm shall be understood as neither given nor endorsed by it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060113/2c18ba46/attachment.htm>
More information about the opencms-dev
mailing list