Question 1 :
I wanna that the preprocess plugin works before the validation.
Because I wanna make a system that delete accounts with the same username if they aren't activated, something like this :
Code: Select all
suac.getConfig().preProcessPlugin = (user, isfsObject, signUpConfiguration) -> {
String email = isfsObject.getUtfString("email");
String username = isfsObject.getUtfString("username");
try {
String sql = "DELETE FROM accounts WHERE active='N' AND (username='" + username + "' OR email='" + email + "')";
getParentZone().getDBManager().executeQuery(sql, new Object[]{});
} catch (SQLException e) {
trace(WARN, "SQL Failed: " + e);
}
};
But this doesn't works, users are not deleted
I just looked into the signup assiatant class and discovered that the validation is made before the preprocess plugin call. Is there a way to change that or must I recompile the program to make it works this way ?
Question 2 : Is there a way to apply the badwords system into the usernames at the signup ? Or must I use some regex jars in the pre process plugin to make it ?
Question 3 : Should I manually remove the activation_code of the accounts that were activated to prevent collision with other activation_codes ? I'm saying that because i'm using a 4 digit activation code to make it user friendly, and in this case collisions are possible.
Question 4 : I'm trying to use the Custom password checking of the login assistant. For this I have to use the PasswordUtil.hash() fonction, but it needs a salt, and I didnt seen any tutorial on how to configure the signup extension to use salts.
Thank you.