%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"
import="java.util.*"
import="com.tootsville.user.*"
import="org.starhope.appius.except.*"
import="java.sql.Date"
import="org.starhope.util.*"
import="com.tootsville.*"
%><%
//---------- 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
*/
Toot approveChild=null;
/**
* Success message list
*/
/**
* Error message list
*/
String url = "/membership/";
if (null!=request.getParameter("link_id") && !request.getParameter("link_id").equals("")) {
try {
approveChild = Toot.getByApprovalCookie(request.getParameter("link_id"));
} catch (java.io.IOException e) {
err.put("invalidlink", "The link you followed is invalid. Please make sure you're following the link from "
+ "your e-mail notification. If you are having trouble please contact customer service.");
} catch (NotFoundException e) {
err.put("invalidlink", "The link you followed is invalid. Please make sure you're following the link from "
+ "your e-mail notification. If you are having trouble please contact customer service.");
}
if (null!=approveChild) {
try {
sess.loginAuth.setValue( approveChild.getParent().getID());
session.setAttribute("sUserType", WebUtil.PARENT);
session.setAttribute("sUserPassword", "approval");
approveChild.setApprovedDate (new Date (System.currentTimeMillis ()));
suc.put ("approved", LibMisc.getText ("approved_success"));
url = "/membership/parent/?toot=" + approveChild.getUserID();
} catch (IllegalStateException e) {
err.put("", LibMisc.getText("login_invalid"));
}
} else {
err.put("invalidlink", "The link you followed is invalid. Please make sure you're following the link from "
+ "your e-mail notification. If you are having trouble please contact customer service.");
}
} else {
err.put("invalidlink", "The link you followed is invalid. Please make sure you're following the link from "
+ "your e-mail notification. If you are having trouble please contact customer service.");
}
if (err.size() > 0) {
/** If there was any errors caught, return to last page with the error message. */
session.setAttribute("sError", err);
url = "/membership/";
}
try {
response.sendRedirect (url);
} catch (IllegalStateException e) {
AppiusClaudiusCaecus.reportBug ("Failure to forward from parent approval link", e);
%>
<%@page import="org.starhope.appius.game.AppiusClaudiusCaecus"%> Click here to continue ... <%
}
%>