Skip to content

Commit

Permalink
update to v1.0.29-release
Browse files Browse the repository at this point in the history
  • Loading branch information
KOHGYLW committed May 13, 2020
1 parent 1a6dc78 commit 5eb232c
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ _提示:源代码路径下包含了一些程序运行所需的非源代码资
### 联系作者?
如有任何需要(例如对该资源有疑问、意见或建议),请发件联系作者: kohgylw@163.com (青阳龙野),随时恭候您的来信!

青阳龙野@kohgylw by 2020年05月12日
青阳龙野@kohgylw by 2020年05月13日

Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public String doSignUp(HttpServletRequest request) {
// 新账户和密码的合法性检查
if (account != null && account.length() >= 3 && account.length() <= 32
&& ios8859_1Encoder.canEncode(account)) {
if(account.indexOf("=") < 0 && account.indexOf(":") < 0) {
if (account.indexOf("=") < 0 && account.indexOf(":") < 0 && account.indexOf("#") != 0) {
if (password != null && password.length() >= 3 && password.length() <= 32
&& ios8859_1Encoder.canEncode(password)) {
if (ConfigureReader.instance().createNewAccount(account, password)) {
Expand All @@ -275,7 +275,7 @@ public String doSignUp(HttpServletRequest request) {
} else {
return "invalidpwd";
}
}else {
} else {
return "illegalaccount";
}
} else {
Expand Down
60 changes: 33 additions & 27 deletions src/main/java/kohgylw/kiftd/server/util/ConfigureReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ private int testServerPropertiesAndEffect() {
this.allowChangePassword = false;
break;
default:
Printer.instance.print("错误:用户修改密码功能设置无效。");
Printer.instance.print("错误:用户修改密码功能设置无效(只能设置为“Y”或“N”),请重新检查。");
return INVALID_CHANGE_PASSWORD_SETTING;
}
}
Expand All @@ -639,7 +639,7 @@ private int testServerPropertiesAndEffect() {
this.openFileChain = false;
break;
default:
Printer.instance.print("错误:永久资源链接功能设置无效。");
Printer.instance.print("错误:永久资源链接功能设置无效(只能设置为“OPEN”或“CLOSE”),请重新检查。");
return INVALID_FILE_CHAIN_SETTING;
}
}
Expand Down Expand Up @@ -752,39 +752,45 @@ private int testServerPropertiesAndEffect() {
dbPwd = "301537gY";
}
// https支持检查及生效处理
if ("true".equals(serverp.getProperty("https.enable"))) {
File keyFile = new File(path, "https.p12");
if (keyFile.isFile()) {
httpsKeyType = "PKCS12";
} else {
keyFile = new File(path, "https.jks");
String enableHttps = serverp.getProperty("https.enable");
if (enableHttps != null) {
if ("true".equals(enableHttps)) {
File keyFile = new File(path, "https.p12");
if (keyFile.isFile()) {
httpsKeyType = "JKS";
httpsKeyType = "PKCS12";
} else {
Printer.instance.print(
"错误:无法启用https支持,因为kiftd未能找到https证书文件。您必须在应用主目录内放置PKCS12(必须命名为https.p12)或JKS(必须命名为https.jks)证书。");
return HTTPS_SETTING_ERROR;
keyFile = new File(path, "https.jks");
if (keyFile.isFile()) {
httpsKeyType = "JKS";
} else {
Printer.instance.print(
"错误:无法启用https支持,因为kiftd未能找到https证书文件。您必须在应用主目录内放置PKCS12(必须命名为https.p12)或JKS(必须命名为https.jks)证书。");
return HTTPS_SETTING_ERROR;
}
}
}
httpsKeyFile = keyFile.getAbsolutePath();
httpsKeyPass = serverp.getProperty("https.keypass", "");
String httpsports = serverp.getProperty("https.port");
if (httpsports == null) {
Printer.instance.print("警告:未找到https端口配置,将采用默认值(443)。");
httpsPort = 443;
} else {
try {
this.httpsPort = Integer.parseInt(httpsports);
if (httpsPort <= 0 || httpsPort > 65535) {
httpsKeyFile = keyFile.getAbsolutePath();
httpsKeyPass = serverp.getProperty("https.keypass", "");
String httpsports = serverp.getProperty("https.port");
if (httpsports == null) {
Printer.instance.print("警告:未找到https端口配置,将采用默认值(443)。");
httpsPort = 443;
} else {
try {
this.httpsPort = Integer.parseInt(httpsports);
if (httpsPort <= 0 || httpsPort > 65535) {
Printer.instance.print("错误:无法启用https支持,https访问端口号配置不正确。");
return HTTPS_SETTING_ERROR;
}
} catch (Exception e) {
Printer.instance.print("错误:无法启用https支持,https访问端口号配置不正确。");
return HTTPS_SETTING_ERROR;
}
} catch (Exception e) {
Printer.instance.print("错误:无法启用https支持,https访问端口号配置不正确。");
return HTTPS_SETTING_ERROR;
}
openHttps = true;
} else if (!"false".equals(enableHttps)) {
Printer.instance.print("错误:https支持功能的启用项配置不正确(只能设置为“true”或“false”),请重新检查。");
return HTTPS_SETTING_ERROR;
}
openHttps = true;
}
// 是否启用XFF解析
String xffConf = serverp.getProperty("IP.xff");
Expand Down
2 changes: 1 addition & 1 deletion target/classes/META-INF/maven/kohgylw/kiftd/pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Tue May 12 16:58:12 CST 2020
#Wed May 13 16:51:31 CST 2020
version=1.0.29-RELEASE
groupId=kohgylw
m2e.projectName=kiftd
Expand Down
Binary file not shown.
Binary file modified target/classes/kohgylw/kiftd/server/util/ConfigureReader.class
Binary file not shown.
2 changes: 1 addition & 1 deletion webContext/js/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function sendSignUpInfo(encrypted){
$("#accountidbox").addClass("has-error");
break;
case "illegalaccount":
showAlert("提示:注册失败,账户名中不得包含“=”或“:”。");
showAlert("提示:注册失败,账户名中不得包含“=”或“:”,且首个字符不能为“#”。");
$("#accountidbox").addClass("has-error");
break;
case "mustlogout":
Expand Down

0 comments on commit 5eb232c

Please sign in to comment.