Some smal fixes and updated Zutil
This commit is contained in:
parent
99c9b136d7
commit
75f09064f7
4 changed files with 27 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue