diff --git a/WebContent/register.jsp b/WebContent/register.jsp index 6e386ad..8874bce 100644 --- a/WebContent/register.jsp +++ b/WebContent/register.jsp @@ -16,7 +16,7 @@ }, name: { required: true, - firstLastName: true + //firstLastName: true } }, messages: { diff --git a/Zallery.iml b/Zallery.iml index f97991b..b39e141 100755 --- a/Zallery.iml +++ b/Zallery.iml @@ -44,5 +44,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/zall/Zallery.java b/src/zall/Zallery.java index cf252a4..1c130e7 100755 --- a/src/zall/Zallery.java +++ b/src/zall/Zallery.java @@ -125,7 +125,7 @@ public class Zallery extends HttpServlet{ user.logout( response ); if( !user.isEmailVerified() ) - msgs.add(MessageType.ERROR, "Your email has not been verified!"); + msgs.add(MessageType.WARNING, "Your email has not been verified!"); else if( !user.isEnabled() ) msgs.add(MessageType.ERROR, "Your account is disabled! Please contact the website administrator."); else diff --git a/src/zall/action/user/VerifyEmailAction.java b/src/zall/action/user/VerifyEmailAction.java index 85b7fbf..a103563 100755 --- a/src/zall/action/user/VerifyEmailAction.java +++ b/src/zall/action/user/VerifyEmailAction.java @@ -27,19 +27,23 @@ public class VerifyEmailAction extends ZalleryAction{ PrintWriter out, User user, UserMessage msgs) throws SQLException, IOException { User verifiedUser = User.load(db, Long.parseLong(request.getParameter("id"))); - if( verifiedUser.verifyEmail(request.getParameter("hash")) ){ - if( verifiedUser.isEnabled() ) - if(out != null) out.println("{ }"); - else msgs.add(MessageType.INFO, "Your email has been successfully verified"); - else { - ZalleryEmail.sendNewUserRegistrationToAdmin(verifiedUser, db); - if(out != null) out.println("{ }"); - else msgs.add(MessageType.INFO, "Your email has been successfully verified, the account is waiting account activation by an admin."); + if (verifiedUser != null) { + if (verifiedUser.verifyEmail(request.getParameter("hash"))) { + if (verifiedUser.isEnabled()) + if (out != null) out.println("{ }"); + else msgs.add(MessageType.INFO, "Your email has been successfully verified"); + else { + ZalleryEmail.sendNewUserRegistrationToAdmin(verifiedUser, db); + if (out != null) out.println("{ }"); + else + msgs.add(MessageType.INFO, "Your email has been successfully verified, the account is waiting for activation by an admin."); + } + verifiedUser.save(db); } - verifiedUser.save(db); + else if (out != null) out.println("{ \"error\":\"Invalid email verification hash!\" }"); + else msgs.add(MessageType.ERROR, "Invalid email verification hash!"); } - else if(out != null) out.println("{ \"error\":\"Invalid email verification hash!\" }"); - else msgs.add(MessageType.ERROR, "Invalid email verification hash!"); + else msgs.add(MessageType.ERROR, "Invalid user id: "+request.getParameter("id")); }