/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
-import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import javax.naming.Context;
import javax.naming.InitialContext;
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-@FacesValidator (value = "UserPasswordValidator")
-public class JobsUserPasswordValidator extends BaseStringValidator implements Validator {
+@FacesValidator ("UserPasswordValidator")
+public class JobsUserPasswordValidator extends BaseStringValidator {
/**
* Serial number
@Override
public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
- // Trace message
- // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N
-
// The required field
- String[] requiredFields = {"currentPassword"}; //NOI18N
+ final String[] requiredFields = {"currentPassword"}; //NOI18N
// Pre-validation (example: not null, not a string, empty string ...)
super.preValidate(context, component, value, requiredFields, false);
// Test it here
if (!UserUtils.ifPasswordMatches(container, this.userLoginController.getLoggedInUser())) {
// Password mismatches
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Password mismatching.", "The password the user has entered does not match the stored password.")); //NOI18N
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, "Password mismatching.", "The password the user has entered does not match the stored password.")); //NOI18N
}
*/
-
- // Trace message
- // NOISY-DEBUG: this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N
}
}