mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-06 07:27:15 +02:00
(refs #1654)Add --validate_password option
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user