(refs #1654)Add --validate_password option

This commit is contained in:
Naoki Takezoe
2017-08-06 03:49:04 +09:00
parent 580374208f
commit b2d842ddd0
2 changed files with 4 additions and 1 deletions

View File

@@ -51,6 +51,9 @@ public class JettyLauncher {
case "--plugin_dir":
System.setProperty("gitbucket.pluginDir", dim[1]);
break;
case "--validate_password":
System.setProperty("gitbucket.validate.password", dim[1]);
break;
}
}
}

View File

@@ -24,7 +24,7 @@ trait Validations {
*/
def password: Constraint = new Constraint(){
override def validate(name: String, value: String, messages: Messages): Option[String] =
if(!value.matches("[a-zA-Z0-9\\-_.]+")){
if(System.getProperty("gitbucket.validate.password") != "false" && !value.matches("[a-zA-Z0-9\\-_.]+")){
Some(s"${name} contains invalid character.")
} else {
None