[opencms-dev] Restrict Access to Pages by Web Users

James jim at futurate.com
Tue Nov 9 11:44:01 CET 2004


Hi,
 
I’ve put this script into the head of my jsp template in order to restrict
access to pages by users that are not logged in.
 
<%@ page import="com.opencms.flex.jsp.CmsJspActionElement,
com.opencms.file.CmsObject"
%>
 
<%
String LOGIN_PAGE = "/login.jsp";
 
CmsJspActionElement cmsjsp = new CmsJspActionElement( pageContext, request,
response );
CmsObject cms = cmsjsp.getCmsObject();
String currentUser = cmsjsp.user( "name" );
 
if( currentUser == null && "".equals( currentUser ) && "guest".equals(
currentUser.toLowerCase() )) {
  response.sendRedirect( LOGIN_PAGE );
}
%>
 
 
But nothing happens…
 
My login script works fine

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.789 / Virus Database: 534 - Release Date: 07/11/2004
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20041109/50b28aef/attachment.htm>


More information about the opencms-dev mailing list