%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.util.*" import="javax.servlet.http.HttpServletRequest" import="com.tootsville.user.*" import="org.starhope.appius.user.*" import="org.starhope.appius.mb.Messages" import="org.starhope.appius.except.*" import="org.starhope.appius.messaging.*" import="org.starhope.appius.types.AgeBracket.*" import="com.tootsville.WebUtil" %><% //---------- Universal Declarations: Place this on every page. /** * Parent/User object. On myAccount this should be declared User and on parent this should be declared Parent */ User sessionUser=null; /** * Error message list */ %><% //----------- Verify the session and create a User or Parent Object //----------- This should be placed on any of the 'logged in' sections on the website. String userID = ""; String userPassword = ""; String userType = ""; if (null!=session.getAttribute("sUserID") && null!=session.getAttribute("sUserPassword") && null!=session.getAttribute("sUserType") ) { userID=session.getAttribute("sUserID").toString(); userPassword=session.getAttribute("sUserPassword").toString(); userType=session.getAttribute("sUserType").toString(); } else { err.put("", Messages.login_invalid()); } boolean isUnder13 = true; if (sess.getVisitorRole()==VisitorRole.self) { sessionUser=WebUtil.verifyUserLogin(userID, userPassword); } else if (sess.getVisitorRole()==VisitorRole.parent) { pageContext.forward("/membership/parent/"); } if (null==sessionUser) { err.put("username", Messages.login_invalid()); } if (null!=sessionUser) { // determine whose email we need isUnder13 = (sessionUser.needsParent()); } else { err.put("username", Messages.login_invalid()); } %><% //----------- Error handling: Place this on every page. //----------- These errors are read and displayed by Header.jsp if (err.size() > 0) { session.setAttribute("sError", err); pageContext.forward ("/membership/"); } %>

