Parcourir la source

用户名不得使用大写字母

visuddhinanda@gmail.com il y a 4 ans
Parent
commit
892a3cecb7

+ 1 - 1
public/app/db/user.php

@@ -321,7 +321,7 @@ class User extends Table
 			$this->result["message"]="::username_too_short";
 			$this->result["message"]="::username_too_short";
 			return false;
 			return false;
 		}
 		}
-		if(preg_match("/@|\s|\//",$username)!==0){
+		if(preg_match("/@|\s|\/|[A-Z]/",$username)!==0){
 			$this->result["ok"]=false;
 			$this->result["ok"]=false;
 			$this->result["message"]="::username_invaild_symbol";
 			$this->result["message"]="::username_invaild_symbol";
 			return false;
 			return false;

+ 1 - 1
public/app/public/lang/si.json

@@ -373,7 +373,7 @@
 		"nick_name": "nickname",
 		"nick_name": "nickname",
 		"name_for_show": "name showed for others",
 		"name_for_show": "name showed for others",
 		"email_address": "E-mail address",
 		"email_address": "E-mail address",
-		"account_demond": "Username may only contain alphanumeric characters, and try to avoid using ? : ! ; , -  etc.",
+		"account_demond": "Username may only contain alphanumeric lower case characters, and try to avoid using ? : ! ; , -  etc.",
 		"password_demond": "Make sure it's at least 5 characters including both numbers and letters",
 		"password_demond": "Make sure it's at least 5 characters including both numbers and letters",
 		"login_with_google": "Log in with Google",
 		"login_with_google": "Log in with Google",
 		"login_with_facebook": "Log in with Facebook",
 		"login_with_facebook": "Log in with Facebook",

+ 1 - 1
public/app/public/lang/zh-cn.json

@@ -369,7 +369,7 @@
 		"nick_name": "称呼(昵称)",
 		"nick_name": "称呼(昵称)",
 		"name_for_show": "给他人看的名字",
 		"name_for_show": "给他人看的名字",
 		"email_address": "电子邮箱地址",
 		"email_address": "电子邮箱地址",
-		"account_demond": "请在半角下使用英文本母、数字、标点符号。并避免使用这些符号?:!;,",
+		"account_demond": "请在半角下使用小写英文字母和数字。并避免使用这些符号?:!;,",
 		"password_demond": "请混合使用五个字符以上的字母和数字",
 		"password_demond": "请混合使用五个字符以上的字母和数字",
 		"login_with_google": "使用谷歌登录",
 		"login_with_google": "使用谷歌登录",
 		"login_with_facebook": "使用脸书登录",
 		"login_with_facebook": "使用脸书登录",

+ 1 - 1
public/app/public/lang/zh-tw.json

@@ -369,7 +369,7 @@
 		"nick_name": "稱呼(暱稱)",
 		"nick_name": "稱呼(暱稱)",
 		"name_for_show": "給他人看的名字",
 		"name_for_show": "給他人看的名字",
 		"email_address": "電子信箱地址",
 		"email_address": "電子信箱地址",
-		"account_demond": "請在半形下使用英文字母、數字、標點符號。並避免使用這些符號?:!;,",
+		"account_demond": "請在半形下使用小寫英文字母和數字。並避免使用這些符號?:!;,",
 		"password_demond": "請混合使用五個字元以上的字母和數字",
 		"password_demond": "請混合使用五個字元以上的字母和數字",
 		"login_with_google": "使用Google登入",
 		"login_with_google": "使用Google登入",
 		"login_with_facebook": "使用Facebook登入",
 		"login_with_facebook": "使用Facebook登入",

+ 2 - 2
public/app/ucenter/sign.js

@@ -7,7 +7,7 @@ function isValidPassword(str){
 	}
 	}
 }
 }
 function isValidUserName(str){
 function isValidUserName(str){
-	let patt=new RegExp(/@|\s|\//);
+	let patt=new RegExp(/@|\s|\/|[A-Z]/);
 	if(patt.test(str)){
 	if(patt.test(str)){
 		return false;
 		return false;
 	}else{
 	}else{
@@ -17,7 +17,7 @@ function isValidUserName(str){
 function submit(){
 function submit(){
 	let hasError = false;
 	let hasError = false;
 	if($("#password").val()!==$("#repassword").val()){
 	if($("#password").val()!==$("#repassword").val()){
-		$("#error_password").text("两次密码输入不一致");
+		$("#error_password").text("password and repassword is not match");
 		hasError = true;
 		hasError = true;
 	}
 	}
 	if(isValidPassword($("#password").val())==false){
 	if(isValidPassword($("#password").val())==false){