+ } else if (req.getParameter("makeAgent") != null) {
+ User userByEmail = User.getByEmail(req.getParameter("agentEmail"));
+ if (userByEmail == null) {
+ resp.getWriter().println("User not found, or found user is not allowed to verify.");
+ } else {
+ if (userByEmail.getVerificationPoints() < 100) {
+ addVerificationPoints(100, userByEmail);
+ }
+ if ( !userByEmail.hasPassedCATS()) {
+ passCATS(userByEmail, CATSType.AGENT_CHALLENGE);
+ }
+ if ( !Contract.hasSignedContract(userByEmail, Contract.ContractType.RA_AGENT_CONTRACT)) {
+ try {
+ new Contract(userByEmail, Contract.ContractType.RA_AGENT_CONTRACT);
+ } catch (GigiApiException e) {
+ throw new Error(e);
+ }
+ }
+ resp.getWriter().println("User has all requirements to be an RA Agent");
+ }