%@ page language="java" %>
<%@ page import="javax.servlet.http.*" %>
<%@ include file="header.jsp" %>
<%@ include file="sidebar.jsp" %>
<%
boolean greenlight=true;
boolean greenlight2=true;
String user=request.getParameter("user");
String pass=request.getParameter("pass");
String pass2=request.getParameter("pass2");
String browser=request.getParameter("browser");
String plugins =request.getParameter("plugins");
String je=request.getParameter("je");
// the java_enabled parameter(je) will be null if the person has JavaScript disabled
if (je==null || je.length()< 3) { je="NO_JS"; }
if (plugins==null || plugins.length()< 3) { plugins="Unknown"; }
if (browser==null || browser.length()< 3) { browser="Unknown"; } //this should never happen
if (user==null || pass==null) { greenlight=false; }
if (user !=null && pass !=null) {
if (user.equals("") || pass.equals("")) { greenlight=false; }
if (!pass.equals(pass2)) { greenlight2=false; greenlight=false; }
}
if (greenlight==false) {
out.print("New User Preferences Account
To create a new account, simple choose a Username and Password. Usernames and Passwords must contain at least 6 characters, numbers and letters only.
");
if (greenlight2==false) { out.println("
The two passwords you entered did not match.
"); }
if (user==null) { user="";}
out.print("
");
} //end if
else {
account.SignUp(user,pass,browser,je,plugins);
//in this instance, account creation was successful
if (account.getStatInt() ==1) {
out.print("New User Preferences Account
");
out.print(account.getStatMess());
out.print("
Your site admission ticket is "+account.getSerNo()+". You do not need to remember this number or write it down anywhere. This number is simply to confirm the creation of your new User Preferences Account on this site.
");
// we will also be using the serial number to set a cookie...
Cookie our_cookie = new Cookie("whip1472pref",account.getSerNo());
our_cookie.setPath("/");
our_cookie.setComment("User Site Preferences");
response.addCookie(our_cookie);
} else {
// in this instance, account creation failed
// let's tell the user why, a message from the EJB
out.print("New User Preferences Account
");
out.print(account.getStatMess());
// now reprint the form, so the user can correct the mistake
out.print("
");
} //end if-else
} //end big if-else
%>