<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>I've been trying to
fix this bug all night and it's beate me.</FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>I need
help</FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>I'm basically
checking if someone is logged into the site based on OpenCMS with this
code:</FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2><%@ page
import="java.util.*,<BR>
com.opencms.flex.jsp.*,<BR>
com.opencms.file.*,<BR>
com.opencms.file.CmsUser" %></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2><%
</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2>com.opencms.flex.jsp.CmsJspActionElement cms = new
com.opencms.flex.jsp.CmsJspActionElement(pageContext, request,
response);<BR>CmsObject cmso = cms.getCmsObject();<BR>boolean validated =
false;<BR>try { </FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>
Vector userGroups = cmso.getDirectGroupsOfUser(cms.user("name"));
<BR> CmsGroup thisGroup;</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>
for (Enumeration allGroups = userGroups.elements();
allGroups.hasMoreElements();) {<BR>
thisGroup =
(CmsGroup)allGroups.nextElement();<BR>
if
(thisGroup.getName().equals("Users")){<BR>
validated = true;<BR>
}<BR> }</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>} catch (Exception
ex) {<BR> out.println("Error logging in");<BR>}</FONT></SPAN></DIV>
<DIV> </DIV><SPAN class=203490200-22062004>
<DIV><BR><FONT face=Arial size=2>if (!validated) { <BR>
out.println("redirecting to " +
cms.link("/RGLIntranet/login.jsp"));<BR>
//response.sendRedirect("<SPAN
class=203490200-22062004>/</SPAN>RGLIntranet/login.jsp</FONT><FONT face=Arial
size=2>");<BR>}<BR>%></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV></SPAN><SPAN class=203490200-22062004><FONT face=Arial size=2>As you can
see if they are not logged in as a user they are redirected to a login
page.</FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>The problem is, if I
uncomment the redirect line I get some kind of inclusion loop error, but if I
leave the line commented out it works perfectly.</FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>I've checked the
login page to see if it is calling a template or anything but it isn't so I dont
know why it's complaining about an inclusion loop.</FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial size=2>Anyone have any
ideas? </FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2>Cheers,</FONT></SPAN></DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=203490200-22062004><FONT face=Arial
size=2>M@.</FONT></SPAN></DIV>
<DIV> </DIV></BODY></HTML>