private static final Pattern USERNAME_PATTERN = Pattern.compile("\\w+");
/**
* Validates the excludeUsers field
*/
public FormValidation doCheckExcludedUsers(@QueryParameter String value) throws IOException, ServletException {
for (String user : Util.fixNull(value).trim().split("[\\r\\n]+")) {
user = user.trim();
if ("".equals(user)) {
continue;
}
if (!USERNAME_PATTERN.matcher(user).matches()) {
return FormValidation.error("Invalid username: " + user);
}
}
return FormValidation.ok();
}
Attached patch accepts windows domain\user formatted usernames on the excluded users list. Tried it on my mac, but will test it on a windows environment next monday.
(NOTE: This also changes the pom.xml The version on the trunk didn't work for me)