|
<% String loginName = request.getParameter("loginName");
String error = "";
if (loginName!=null) {
String email = request.getParameter("email");
Type_User user = (Type_User) AppUser.userAppData.data.queryFirst("User", "UserLogin", loginName);
if (user==null) {
error = "System error: "+user+" could not be found in our database.";
Monitor.error("Invalid user parameter in wbplogin.jsp, who='"+user.getUserLogin());
} else {
if (FCC.canonicalEmailAddress(email).equals(FCC.canonicalEmailAddress(user.getUserEmail()))) {
if (user.getIntUserLoginCount()==0) {
FCC.craigNote(loginName+" wants password, but has never logged in");
error = "Sorry, your account is not yet ready for use.";
} else {
PF_Admin.sendNewPassword(user);
error = "Your new password has been sent to "+email;
}
} else {
// invalid email address
error = "Your email address does not match our database records. Please contact our staff members.";
Monitor.error("Invalid Email Address entered for "+user.getUserLogin());
Monitor.event("InvalidEmail", null, "who='"+user.getUserLogin()+"'");
}
}
}
String name = request.getParameter("u");
String password = request.getParameter("password");
AppUser appUser = null;
// check for too many login attempts
if (name!=null) {
Integer x = (Integer) PF_Admin.loginAttempts.get(name);
if (x!=null && x.intValue()>5) {
Long lastFailure = (Long) PF_Admin.lastLoginFailure.get(name);
if (lastFailure!=null) {
long seconds = System.currentTimeMillis() - lastFailure.longValue();
if (seconds > 120000) {
PF_Admin.loginAttempts.remove(name); // reset after a while
} else {
out.println("Login attempt has been ignored. Please wait before trying again.");
name = null;
password = null;
}
} else {
PF_Admin.lastLoginFailure.put(name, new Long(System.currentTimeMillis()));
out.println("Login attempt has been ignored. Please wait before trying again.");
name = null;
password = null;
}
}
}
if (name!=null) try {
name = name.toLowerCase();
appUser = AppUser.login(pageContext, name, Encrypt.crypt(password));
} catch (Exception e) {
error = e.getMessage();
}
if (name==null) name = "";
if (password==null) password = "";
if (error!=null && appUser!=null) {
Role role = Role.getRole(appUser.user.getUserRole());
if (!role.canLogin) {
%>
<% } else if (destination.equals("purchase")) {
AppTrail trail = new AppTrail();
trail.appUser = appUser;
PF_Admin.loginAttempts.remove(name);
%>
<%
} else { // destination = enter
AppTrail trail = new AppTrail();
trail.appUser = appUser;
PF_Admin.loginEvent(trail, request);
String t = trail.trail_id;
PF_Admin.loginAttempts.remove(name);
%>
Welcome Back <%=name%>
What's New
Last updated December 23, 2009
<%@ include file="enterapplication.ijsp" %>
<% } %>
<% } else { %>
<% if (error.equals("Invalid Password")) {
Integer x = (Integer) PF_Admin.loginAttempts.get(name);
int nx = 1;
if (x==null) {
PF_Admin.loginAttempts.put(name, new Integer(1));
} else {
nx = x.intValue() + 1;
PF_Admin.loginAttempts.put(name, new Integer(nx));
}
// Monitor.event("LoginFailure", name, "attempt='"+nx+"'"); already present
System.out.println("Login Attempt Failed login="+name);
PF_Admin.lastLoginFailure.put(name, new Long(System.currentTimeMillis()));
%>
| |
Invalid Password.
Failed login attempts: <%=nx%>
<% if (nx==5) out.println("For security reasons, we limit the number of attempted logins."); %>
If you would like a new password emailed to you, please enter your email address.
Note: The email address MUST be the last email address of record.
|
<% } else { %>
<% } %>
<% if (destination.equals("purchase")) out.println("Step 1 - Log into your account "); %>
| |
|
<% if (destination.equals("purchase")){%>
| |
If you do not yet have a Whitebirch account, please register first. |
<%}%>
| |
Not yet a Member? Register for an online demonstraton and free trial! |
| |
|
| |
Forgot your password? Type in your Login Name, leave the Password blank, and click Login. You will have the opportunity to email yourself a new password. |
<% } %>
|