Pārlūkot izejas kodu

Merge branch 'master' of https://github.com/iapt-platform/mint

bhikkhu-kosalla-china 4 gadi atpakaļ
vecāks
revīzija
dea3355346

+ 4 - 0
app/api/user.php

@@ -34,6 +34,10 @@ switch ($_REQUEST["_method"]) {
 		# get
 		$model->reset_password_send_email();
 		break;	
+	case 'reset_pwd':
+		# get
+		$model->reset_password();
+		break;	
 	default:
 		# code...
 		break;

+ 5 - 0
app/article/index.php

@@ -133,6 +133,11 @@ span.fancytree-node{
     width: max-content;
 }
 
+#content_toc>ul>li>span.fancytree-node{
+	font-size: 120%;
+    font-weight: 900;
+}
+
 </style>
 
 <?php

+ 88 - 0
app/db/channel.php

@@ -0,0 +1,88 @@
+<?php
+require_once "../path.php";
+require_once "../db/table.php";
+require_once "../public/function.php";
+/*
+CREATE TABLE likes (
+    id            INTEGER      PRIMARY KEY AUTOINCREMENT,
+    like_type     VARCHAR (16) NOT NULL,
+    resource_type VARCHAR (32) NOT NULL,
+    resource_id   CHAR (36)    NOT NULL,
+    user_id       INTEGER      NOT NULL,
+    created_at    TIMESTAMP DEFAULT CURRENT_TIMESTAMP     NOT NULL //只做初始化,更新时不自动更新
+);
+*/
+class Channel extends Table
+{
+    function __construct($redis=false) {
+		parent::__construct(_FILE_DB_CHANNAL_, "channal", "", "",$redis);
+    }
+
+	public function  index(){
+		switch ($_GET["view"]) {
+			case 'studio':
+				# code...
+				break;
+			case 'user':
+				# code...
+				break;
+			default:
+				# code...
+				break;
+		}
+		$where["like_type"] = "like";
+		$where["resource_type"] = $_GET["type"];
+		$where["resource_id"] = explode($_GET["id"],",");
+		echo json_encode($this->_index(["id","name","lang","status"],$where), JSON_UNESCAPED_UNICODE);
+	}
+
+	public function create($data=null){
+		if($data===null){
+			if(!isset($_COOKIE["userid"])){
+				return;
+			}
+			$json = file_get_contents('php://input');
+			$data = json_decode($json,true);
+			$data["owner"] = $_COOKIE["userid"];			
+		}
+
+		$isExist = $this->medoo->has($this->table,["owner"=>$data["owner"],"name"=>$data["name"]]);
+		if(!$isExist){
+			$data["id"] = UUID::v4();
+			$data["create_time"] = mTime();
+			$data["modify_time"] = mTime();
+			$result =  $this->_create($data,["id","owner","lang","name","summary","status","create_time","modify_time"]);
+		}
+		else{
+			$this->result["ok"]=false;
+			$this->result["message"]="is exist";
+			$result = $this->result;
+		}
+		if($data===null){
+			echo json_encode($result, JSON_UNESCAPED_UNICODE);
+		}else{
+			return $result;
+		}
+		
+	}
+	
+	public function  delete(){
+		if(!isset($_COOKIE["userid"])){
+			return;
+		}
+		$where["like_type"] = $_GET["like_type"];
+		$where["resource_type"] = $_GET["resource_type"];
+		$where["resource_id"] = $_GET["resource_id"];
+		$where["user_id"] = $_COOKIE["userid"];
+		$row = $this->_delete($where);
+		if($row["data"]>0){
+			$this->result["data"] = $where;
+		}else{
+			$this->result["ok"]=false;
+			$this->result["message"]="no delete";			
+		}
+		echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
+	}
+}
+
+?>

+ 8 - 4
app/db/table.php

@@ -60,10 +60,14 @@ class Table
 		$this->result["data"] = $updateDate;
 		return $this->result;
 	}
-	public function _update($data,$columns,$where=null){
-		foreach ($columns as $value) {
-			# code...
-			$updateDate[$value] = $data[$value];
+	public function _update($data,$columns=null,$where=null){
+		if($columns==null){
+			$updateDate = $data;
+		}else{
+			foreach ($columns as $value) {
+				# code...
+				$updateDate[$value] = $data[$value];
+			}			
 		}
 
 		if($where==null){

+ 144 - 38
app/db/user.php

@@ -1,6 +1,7 @@
 <?php
 require_once "../path.php";
 require_once "../db/table.php";
+require_once "../db/channel.php";
 require_once "../public/function.php";
 // Require Composer's autoloader.
 require_once '../../vendor/autoload.php';
@@ -74,40 +75,91 @@ class User extends Table
 
 
 	public function  create(){
-		if(!isset($_COOKIE["userid"])){
-			return;
-		}
 		$json = file_get_contents('php://input');
 		$data = json_decode($json,true);
-		$data["user_id"] = $_COOKIE["userid"];
-		$isExist = $this->medoo->has("likes",$data);
+		//验证邀请码
+		if(isset($data["invite"])){
+			if ($this->redis == false) {
+				$this->result["ok"]=false;
+				$this->result["message"]="no_redis_connect";
+				echo json_encode($this->result, JSON_UNESCAPED_UNICODE);	
+				return;	
+			}
+			$redisKey = "invitecode://".$data["invite"];
+			$code = $this->redis->exists($redisKey);
+			if(!$code){
+				$this->result["ok"]=false;
+				$this->result["message"]="invite_code_invalid";
+				echo json_encode($this->result, JSON_UNESCAPED_UNICODE);	
+				return;	
+			}
+			$data["email"] = $this->redis->get($redisKey);				
+		}else{
+			$this->result["ok"]=false;
+			$this->result["message"]="no_invite_code";
+			echo json_encode($this->result, JSON_UNESCAPED_UNICODE);	
+			return;	
+		}
+		//验证用户名有效性
+		if(!$this->isValidUsername($data["username"])){
+			echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
+			return;
+		}
+		$isExist = $this->medoo->has($this->table,["username"=>$data["username"]]);
 		if(!$isExist){
-			echo json_encode($this->_create($data,["like_type","resource_type","resource_id","user_id"]), JSON_UNESCAPED_UNICODE);
+			if(!$this->isValidEmail($data["email"])){
+				echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
+				return;
+			}
+			$isExist = $this->medoo->has($this->table,["email"=>$data["email"]]);
+			if(!$isExist){
+				if(!$this->isValidPassword($data["password"])){
+					echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
+					return;
+				}
+				$data["userid"] = UUID::v4();
+				$data["password"] = md5($data["password"]);
+				$data["create_time"] = mTime();
+				$data["modify_time"] = mTime();
+				$data["setting"] = "{}";
+				$result = $this->_create($data,["userid","username","email","password","nickname","setting","create_time","modify_time"]);
+				if($result["ok"]){
+					$channel = new Channel($this->redis);
+					$newChannel1 = $channel->create(["owner"=>$data["userid"],
+													"lang"=>$data["lang"],
+													"name"=>$data["username"],
+													"lang"=>$data["lang"],
+													"status"=>30,
+													"summary"=>""
+													]);
+					$newChannel2 = $channel->create(["owner"=>$data["userid"],
+													"lang"=>$data["lang"],
+													"name"=>"draft",
+													"lang"=>$data["lang"],
+													"status"=>10,
+													"summary"=>""
+													]);
+					echo json_encode($newChannel1, JSON_UNESCAPED_UNICODE);
+					//删除
+					$this->redis->del($redisKey);
+				}else{
+					echo json_encode($result, JSON_UNESCAPED_UNICODE);
+				}
+				
+			}else{
+				$this->result["ok"]=false;
+				$this->result["message"]="email_is_exist";
+				echo json_encode($this->result, JSON_UNESCAPED_UNICODE);				
+			}
 		}
 		else{
 			$this->result["ok"]=false;
-			$this->result["message"]="is exist";
+			$this->result["message"]="account_is_exist";
 			echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
 		}
 	}
 	
-	public function  delete(){
-		if(!isset($_COOKIE["userid"])){
-			return;
-		}
-		$where["like_type"] = $_GET["like_type"];
-		$where["resource_type"] = $_GET["resource_type"];
-		$where["resource_id"] = $_GET["resource_id"];
-		$where["user_id"] = $_COOKIE["userid"];
-		$row = $this->_delete($where);
-		if($row["data"]>0){
-			$this->result["data"] = $where;
-		}else{
-			$this->result["ok"]=false;
-			$this->result["message"]="no delete";			
-		}
-		echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
-	}
+
 
 	#发送密码重置邮件
 	public function reset_password_send_email(){
@@ -118,10 +170,10 @@ class User extends Table
 			$ok = $this->_update(["reset_password_token"=>$resetToken],["reset_password_token"],["email"=>$email]);
 			if($ok){
 				#send email
-				$resetLink="https://www.wikipali.org/ucenter/reset.php?token=".$resetToken;
-				$resetString="https://www.wikipali.org/ucenter/reset.php?token=".$resetToken;
+				$resetLink="https://www.wikipali.org/app/ucenter/reset.php?token=".$resetToken;
+				$resetString="https://www.wikipali.org/app/ucenter/reset.php";
 		
-					// 打开文件并读取数据
+				// 打开文件并读取数据
 				$irow=0;
 				$strSubject = "";
 				$strBody = "";
@@ -143,8 +195,8 @@ class User extends Table
 					return;
 				}
 		
-				$strBody = str_replace("%resetLink%",$resetLink,$strBody);
-				$strBody = str_replace("%resetString%",$resetString,$strBody);
+				$strBody = str_replace("%ResetLink%",$resetLink,$strBody);
+				$strBody = str_replace("%ResetString%",$resetString,$strBody);
 		
 				//TODO sendmail
 		
@@ -193,29 +245,83 @@ class User extends Table
 			}
 		}else{
 			$this->result["ok"]=false;
-			$this->result["message"]="invalid email";
+			$this->result["message"]="::invalid_email";
 			echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
 		}
 	}
 
 	#重置密码
-	public function reset_password($username,$password,$token){
-		$isExist = $this->medoo->has($this->table,["user_name"=>$username,"token"=>$token]);
+	public function reset_password(){
+		$json = file_get_contents('php://input');
+		$data = json_decode($json,true);
+		$isExist = $this->medoo->has($this->table,["username"=>$data["username"],"reset_password_token"=>$data["reset_password_token"]]);
 		if($isExist){
 			#reset password
-			$ok = $this->_update(["password"=>$password],"password",["user_name"=>$username]);
-			if($ok){
-				echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
-				
-			}else{
+			if(!$this->isValidPassword($data["password"])){
 				echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
+				return;
 			}
+			$ok = $this->_update(["password"=>md5($data["password"])],["password"],["username"=>$data["username"]]);
+			if($ok){
+				#成功后删除reset_password_token
+				$ok = $this->_update(["reset_password_token"=>null,
+									  "reset_password_sent_at"=>null],
+									  null,
+									  ["username"=>$data["username"]]);	
+			}
+			echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
 		}else{
 			$this->result["ok"]=false;
-			$this->result["message"]="invalid token";
+			$this->result["message"]="::invalid_token";
 			echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
 		}
 	}
+
+	private function isValidPassword($password){
+		if(mb_strlen($password,"UTF-8")<6){
+			$this->result["ok"]=false;
+			$this->result["message"]="::password_too_short";
+			return false;
+		}
+		if(mb_strlen($password,"UTF-8")>32){
+			$this->result["ok"]=false;
+			$this->result["message"]="::password_too_long";
+			return false;
+		}
+		if(strpos($password," ")!==false){
+			$this->result["ok"]=false;
+			$this->result["message"]="::password_invaild_symbol";
+			return false;
+		}
+		return true;
+	}
+	private function isValidUsername($username){
+		if(mb_strlen($username,"UTF-8")>32){
+			$this->result["ok"]=false;
+			$this->result["message"]="::username_too_long";
+			return false;
+		}
+		if(mb_strlen($username,"UTF-8")<4){
+			$this->result["ok"]=false;
+			$this->result["message"]="::username_too_short";
+			return false;
+		}
+		if(preg_match("/@|\s|\//",$username)!==0){
+			$this->result["ok"]=false;
+			$this->result["message"]="::username_invaild_symbol";
+			return false;
+		}
+		return true;
+	}
+	private function isValidEmail($email){	
+		$isValid = filter_var($email, FILTER_VALIDATE_EMAIL);
+		if($isValid===false){
+			$this->result["ok"]=false;
+			$this->result["message"]="::invaild_email";
+		}
+		return $isValid;
+	}
+
 }
 
 ?>

+ 6 - 7
app/dict/css/style.css

@@ -94,13 +94,12 @@ body {
 
 .dropdown_ctl > .menu {
 	position: absolute;
-	box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
 	display: none;
+    background-color: var(--tool-bg-color);
+    box-shadow: 0 0 10px var(--border-shadow);
+    color: var(--tool-color);	
 }
 
-.dropdown_ctl > .menu {
-	background-color: white;
-}
 
 .dropdown_ctl > .content > .main_view > part {
 	margin: 0 0.5em;
@@ -114,7 +113,8 @@ body {
 }
 
 .dropdown_ctl > .menu > .part_list:hover {
-	background-color: azure;
+	background-color: var(--btn-hover-bg-color);
+    color: var(--btn-hover-color);
 }
 
 .dropdown_ctl > .content > .more_button {
@@ -298,6 +298,7 @@ input[type="submit"] {
 .dict_word .dict {
 	font-size: 100%;
 	font-style: normal;
+	color: var(--link-color);
 }
 
 .dict_word .mean {
@@ -321,8 +322,6 @@ textarea {
 	font-size: 130%;
 	font-weight: 500;
 	padding: 0.3em 0.6em;
-	color: var(--btn-hover-bg-color);
-	background-color: var(--btn-color);
 }
 #left_menu_button {
 	display: none;

+ 3 - 1
app/dict/css/style_mobile.css

@@ -142,7 +142,9 @@ body {
 guide{
 	display:none;
 }
-
+.dict_find_gramma guide{
+	display:unset;
+}
 #search_info {
     display: block;
 }

+ 1 - 1
app/dict/index.php

@@ -108,7 +108,7 @@ if (!(isset($_GET["builtin"]) && $_GET["builtin"] == 'true')) {
 	</div>
 
 	<div>
-		<div id="main_view" class='section_inner'  style="background-color:white;color:black;">
+		<div id="main_view" class='section_inner' >
 			<div id='dict_list_shell' style="display:none" onclick='setNaviVisibility()'>
 				<div id='dict_list' class='dict_list_off'></div>
 			</div>

+ 1 - 0
app/pcdl/css/color_night.css

@@ -5,6 +5,7 @@
         --tool-color:#C6BAAE;
     --btn-color: #A9A9A9;
     --btn-hover-color: #F9F9F9;
+	--btn-border-line-color:#F9F9F9;
     --link-color: #498EFF;
         --mean-user-color:#F9468F;
 

+ 17 - 1
app/pcdl/html_head.php

@@ -25,7 +25,20 @@ if (isset($_GET["language"])) {
 	<link type="text/css" rel="stylesheet" href="../pcdl/css/font.css" />
 	<link type="text/css" rel="stylesheet" href="../pcdl/css/basic_style.css" />
 	<link type="text/css" rel="stylesheet" href="../pcdl/css/style.css" />
-	<link type="text/css" rel="stylesheet" href="../pcdl/css/color_day.css" id="colorchange" />
+	<?php 
+	if(isset($_GET["theme"]) && $_GET["theme"]==="dark"){
+		?>
+	<link type="text/css" rel="stylesheet" href="../pcdl/css/color_night.css"  id="colorchange" />		
+		<?php
+	}else{
+		?>
+	<link type="text/css" rel="stylesheet" href="../pcdl/css/color_day.css" id="colorchange" />		
+		<?php	
+	}
+	?>
+
+
+
 	<link type="text/css" rel="stylesheet" href="../pcdl/css/style_mobile.css" media="screen and (max-width:800px)">
 	<link href="https://fonts.googleapis.com/css2?family=Padauk:wght@400;700&display=swap" rel="stylesheet">
 
@@ -125,6 +138,9 @@ if (isset($_GET["language"])) {
 	<script src="../../node_modules/diff/dist/diff.js"></script>
 	
 	<style>
+		body{
+			background-color: var(--bg-color);
+		}
 		.list_with_head {
 			display: flex;
 			margin: 3px 0;

+ 7 - 1
app/public/lang/default.json

@@ -66,7 +66,7 @@
 		"delete": "Delete",
 		"departure_in_detail": "departure in detail",
 		"desc": "DESC",
-		"detaile": "Detaile",
+		"detaile": "Detail",
 		"dhamma_time": "5000 Years of the Buddha’s Dispensation ",
 		"dict": "Dict",
 		"dict_match": "Match the Dictionary and Document",
@@ -641,6 +641,12 @@
 		"page_num": "page",
 		"palihandbook": "巴利手册",
 		"viewer": "viewer",
+		"invalid_email": "invalid email",
+		"invalid_token": "invalid token",
+		"username_too_long": "username too long",
+		"username_too_short": "username too short",
+		"username_invaild_symbol": "username invaild symbol",
+		"password_invaild_symbol": "password invaild symbol",
 		"": ""
 	},
 	"grammastr": [

+ 7 - 1
app/public/lang/en.json

@@ -66,7 +66,7 @@
 		"delete": "delete",
 		"departure_in_detail": "departure in detail",
 		"desc": "DESC",
-		"detaile": "Detaile",
+		"detaile": "Detail",
 		"dhamma_time": "5000 Years of the Buddha’s Dispensation ",
 		"dict": "Dict",
 		"dict_match": "Match the Dictionary and Document",
@@ -640,6 +640,12 @@
 		"page_num": "page",
 		"palihandbook": "巴利手册",
 		"viewer": "viewer",
+		"invalid_email": "invalid email",
+		"invalid_token": "invalid token",
+		"username_too_long": "username too long",
+		"username_too_short": "username too short",
+		"username_invaild_symbol": "username invaild symbol",
+		"password_invaild_symbol": "password invaild symbol",
 		"": ""
 	},
 	"grammastr": [

+ 8 - 2
app/public/lang/my.json

@@ -66,7 +66,7 @@
 		"delete": "Delete",
 		"departure_in_detail": "departure in detail",
 		"desc": "DESC",
-		"detaile": "Detaile",
+		"detaile": "Detail",
 		"dhamma_time": "5000 Years of the Buddha’s Dispensation ",
 		"dict": "Dict",
 		"dict_match": "Match the Dictionary and Document",
@@ -638,8 +638,14 @@
 		"reference": "reference",
 		"original": "original",
 		"page_num": "page",
-		"palihandbook": "巴利手册",
+		"palihandbook": "pāli handbook",
 		"viewer": "viewer",
+		"invalid_email": "invalid email",
+		"invalid_token": "invalid token",
+		"username_too_long": "username too long",
+		"username_too_short": "username too short",
+		"username_invaild_symbol": "username invaild symbol",
+		"password_invaild_symbol": "password invaild symbol",
 		"": ""
 	},
 	"grammastr": [

+ 7 - 0
app/public/lang/si.json

@@ -645,6 +645,13 @@
 		"page_num": "page",
 		"palihandbook": "巴利手册",
 		"viewer": "viewer",
+		"palihandbook": "pali handbook",
+		"invalid_email": "invalid email",
+		"invalid_token": "invalid token",
+		"username_too_long": "username too long",
+		"username_too_short": "username too short",
+		"username_invaild_symbol": "username invaild symbol",
+		"password_invaild_symbol": "password invaild symbol",
 		"": ""
 	},
 	"grammastr": [

+ 6 - 0
app/public/lang/zh-cn.json

@@ -643,6 +643,12 @@
 		"page_num": "页码",
 		"palihandbook": "巴利手册",
 		"viewer": "查看者",
+		"invalid_email": "无效的电子邮件",
+		"invalid_token": "无效的密钥",
+		"username_too_long": "用户名过长",
+		"username_too_short": "用户名过短",
+		"username_invaild_symbol": "用户名包含无效字符",
+		"password_invaild_symbol": "密码包含无效字符",
 		"": ""
 	},
 	"grammastr": [

+ 6 - 0
app/public/lang/zh-tw.json

@@ -642,6 +642,12 @@
 		"page_num": "頁碼",
 		"palihandbook": "巴利手冊",
 		"viewer": "查看者",
+		"invalid_email": "無效的電子郵件",
+		"invalid_token": "無效的密鑰",
+		"username_too_long": "用戶名過長",
+		"username_too_short": "用戶名過短",
+		"username_invaild_symbol": "用戶名包含無效字符",
+		"password_invaild_symbol": "密碼包含無效字符",
 		"": ""
 	},
 	"grammastr": [

+ 1 - 1
app/reader/get_para.php

@@ -65,7 +65,7 @@ $paraBegin=0;
 $paraEnd=0;
 
 PDO_Connect(_FILE_DB_PALITEXT_);
-			$query = "SELECT level , parent, chapter_len FROM 'pali_text'  WHERE book= ? AND paragraph= ?";
+			$query = "SELECT level , parent, chapter_len,chapter_strlen FROM 'pali_text'  WHERE book= ? AND paragraph= ?";
 			$FetchParInfo = PDO_FetchRow($query, array($_book, $_para));
 if ($FetchParInfo) {
     switch ($_view) {

+ 4 - 2
app/studio/js/editor.js

@@ -3041,7 +3041,9 @@ function on_word_click(sWordId) {
 
 	//参考字典
 	if (mouse_action_lookup) {
-		dict_search(sReal);
+		//dict_search(sReal);
+		window.open("../dict/index.php?builtin=true&theme=dark&key="+sReal,target="dict");
+
 	}
 
 	//添加词到翻译框
@@ -3332,7 +3334,7 @@ function showModifyWin(sWordId) {
 		var eDetail = document.getElementById(sDetail);
 		eWord.insertBefore(eWin, eDetail);
 
-		document.getElementById("dict_ref_search_input").value = sReal;
+		//document.getElementById("dict_ref_search_input").value = sReal;
 
 		//editor_refresh_inline_dict(sReal);
 	}

+ 14 - 4
app/studio/plugin/system_dict/gui.html

@@ -1,7 +1,16 @@
 			<!--  参考字典查询结果 -->
-			<div id="dict_ref_search">
+			<style>
+				#sys_dict {
+					height: 100%;
+				}
+				#right_tool_bar_inner{
+					padding:0;
+				}
+			</style>
+			<div id="dict_ref_search" style="height: 100%;padding:0;">
+				<iframe id="dict" src="../dict/index.php?builtin=true&theme=dark" name="dict" title="wikipali" style="width:100%;height:100%;border: none;"></iframe>
+				<!--
 				<div id="right_tool_bar_title" >
-
 					<ul id="id_select_modyfy_type" class="common-tab" >
 						<button class="res_button" style="padding: 0" onclick="editor_show_right_tool_bar(false)">
 							<svg class="button_icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="svg/icon.svg#ic_input"></use></svg>
@@ -15,7 +24,7 @@
 							</svg>
 						</a>
 					</ul>
-					<!--  右侧工具条 -->
+
 					<div>
 						<div id="dict_ref_search_head">
 							<div id="dict_ref_search_input_div">
@@ -36,7 +45,7 @@
 										</tr>
 									</table>
 								</div>
-								<!--  查词工具 拆分 -->
+
 								<div>
 									<div id="input_parts"></div>
 									<div id="dict_word_auto_split"></div>
@@ -49,5 +58,6 @@
 				</div>
 				<div id="dict_ref_search_result">
 				</div>
+			-->
 			</div>
 			

+ 58 - 44
app/ucenter/forgot_pwd.php

@@ -135,8 +135,14 @@ require_once "../public/function.php";
 	<link type="text/css" rel="stylesheet" href="mobile.css" media="screen and (max-width:800px)">
 	</head>
 	<body id="ucenter_body" onload="login_init()">
-
 	<div id="tool_bar">
+		<div>
+		</div>
+		<div>
+			<?php
+			require_once '../lang/lang.php';
+			?>
+		</div>
 	</div>
 <div id="login_body" >
 
@@ -166,29 +172,30 @@ require_once "../public/function.php";
 			</div>
 
 			<div class="login_form" style="    padding: 3em 0 3em 0;">
-			<div class="form_help">
-				我们将向您的注册邮箱发送电子邮件。里面包含了重置密码链接。点击链接后按照提示操作,重置账户密码。
-			</div>
-			<div class="form_help" id="message"> </div>			
-				<form action="../api/user.php" method="get">
-					<div>
+				<div id="message" class="form_help">
+					我们将向您的注册邮箱发送电子邮件。里面包含了重置密码链接。点击链接后按照提示操作,重置账户密码。
+				</div>	
+				<div id="form_div">	
+					<form action="../api/user.php" method="get">
 						<div>
-							<span id='tip_email' class='form_field_name'><?php echo $_local->gui->email_address; ?></span>
-							<input id="form_email" type="input" name="email"  value="" />
+							<div>
+								<span id='tip_email' class='form_field_name'><?php echo $_local->gui->email_address; ?></span>
+								<input id="form_email" type="input" name="email"  value="" />
+							</div>
+							<div id="error_email" class="form_error"> </div>
+							<div class="form_help"></div>
 						</div>
-						<div id="error_email" class="form_error"> </div>
-						<div class="form_help"></div>
-					</div>
 
-					<input type="hidden" name="_method" value="reset_email" />
+						<input type="hidden" name="_method" value="reset_email" />
 
 
-				</form>
+					</form>
 					<div id="button_area">
 						<button  onclick="submit()" style="background-color: var(--link-hover-color);border-color: var(--link-hover-color);" >
 						<?php echo $_local->gui->continue; ?>
 						</button>
-					</div>				
+					</div>
+				</div>				
 			</div>
 		</div>
 	</div>
@@ -196,8 +203,11 @@ require_once "../public/function.php";
 
 	<script>
 	login_init();
-		function submit(){
-			$.getJSON(
+	
+	function submit(){
+		$("#message").text("正在发送...");
+		$(this).prop("disabled",true);
+	$.getJSON(
 		"../api/user.php",
 		{
 			_method:"reset_email",
@@ -207,36 +217,40 @@ require_once "../public/function.php";
 		$("#message").text(data.message);
 		if(data.ok){
 			$("#message").removeClass("form_error");
+			$("#form_div").hide();			
 		}else{
 			$("#message").addClass("form_error");
+			//发送失败enable发送按钮
+			$(this).prop("disabled",false);
 		}
-	}).fail(function(jqXHR, textStatus, errorThrown){
-		$("#message").removeClass("form_error");
-		$("#message").text(textStatus);				
-		switch (textStatus) {
-	
-			case "timeout":
-				break;
-			case "error":
-				switch (jqXHR.status) {
-					case 404:
-						break;
-					case 500:
-						break;				
-					default:
-						break;
-				}
-				break;
-			case "abort":
-				break;
-			case "parsererror":			
-				console.log("delete-parsererror",jqXHR.responseText);
-				break;
-			default:
-				break;
-		}
-		
-	});
+		}).fail(function(jqXHR, textStatus, errorThrown){
+			$("#message").removeClass("form_error");
+			$("#message").text(textStatus);	
+			//发送失败enable发送按钮
+			$(this).prop("disabled",false);		
+			switch (textStatus) {
+				case "timeout":
+					break;
+				case "error":
+					switch (jqXHR.status) {
+						case 404:
+							break;
+						case 500:
+							break;				
+						default:
+							break;
+					}
+					break;
+				case "abort":
+					break;
+				case "parsererror":			
+					console.log("delete-parsererror",jqXHR.responseText);
+					break;
+				default:
+					break;
+			}
+			
+		});
 		}
 	</script>
 

+ 4 - 4
app/ucenter/index.php

@@ -336,9 +336,9 @@ if (isset($_POST["op"]) && $_POST["op"] == "new") {
 		<div>
 		</div>
 		<div>
-		<?php
-require_once '../lang/lang.php';
-?>
+			<?php
+			require_once '../lang/lang.php';
+			?>
 		</div>
 	</div>
 	<div id="login_body" >
@@ -472,7 +472,7 @@ if ($op == "new") {
 				<div id="button_area">
 					<input type="submit" value="<?php echo $_local->gui->continue; ?>" style="background-color: var(--link-hover-color);border-color: var(--link-hover-color);" />
 				</div>
-				</form>
+			</form>
 			</div>
 
 		<?php

+ 4 - 7
app/ucenter/invite.php

@@ -23,8 +23,8 @@ if (PHP_SAPI == "cli") {
 		$invitecode = "invitecode://".$uuid;
 		$redis->set($invitecode,$email);
 		$redis->expire($invitecode,7*20*3600);
-		$SignUpLink="https://www.wikipali.org/ucenter/index.php?op=new&invite=".$uuid;
-		$SignUpString="https://www.wikipali.org/ucenter/index.php?op=new&invite=".$uuid;
+		$SignUpLink="https://www.wikipali.org/app/ucenter/sign_up.php?invite=".$uuid;
+		$SignUpString="www.wikipali.org/app/ucenter/sign_up.php";
 
 			// 打开文件并读取数据
 		$irow=0;
@@ -64,15 +64,12 @@ if (PHP_SAPI == "cli") {
 			$mail->Password   = Email["Password"];                               //SMTP password
 			$mail->SMTPSecure = Email["SMTPSecure"];            //Enable implicit TLS encryption
 			$mail->Port       = Email["Port"];                                    //TCP port to connect to 465; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
-
+			$mail->CharSet =  'UTF-8';
+			$mail->Encoding = 'base64';
 			//Recipients
 			$mail->setFrom(Email["From"], Email["Sender"]);
 			$mail->addAddress($email);     //Add a recipient Name is optional
 
-			//Attachments
-			//$mail->addAttachment('/var/tmp/file.tar.gz');         //Add attachments
-			//$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    //Optional name
-
 			//Content
 			$mail->isHTML(true);                                  //Set email format to HTML
 			$mail->Subject = $strSubject;

+ 282 - 0
app/ucenter/reset.php

@@ -0,0 +1,282 @@
+<?php
+#重置密码
+require_once '../path.php';
+require_once "../public/load_lang.php";
+require_once "../public/function.php";
+
+
+if (!isset($_GET["token"])) {
+    
+}
+
+
+?>
+
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+		<meta name="viewport" content="width=device-width, initial-scale=1.0">
+		<link type="text/css" rel="stylesheet" href="../studio/css/font.css"/>
+		<link type="text/css" rel="stylesheet" href="../studio/css/style.css"/>
+		<link type="text/css" rel="stylesheet" href="../studio/css/color_day.css" id="colorchange" />
+		<title>wikipali reset password</title>
+		<script src="../public/js/comm.js"></script>
+		<script src="../studio/js/jquery-3.3.1.min.js"></script>
+		<script src="../studio/js/fixedsticky.js"></script>
+		<style>
+		#login_body{
+			display: flex;
+			padding: 2em;
+			margin: auto;
+		}
+		#login_left {
+			padding-right: 12em;
+			padding-top: 5em;
+		}
+		.title{
+			font-size: 150%;
+			margin-top: 1em;
+			margin-bottom: 0.5em;
+		}
+		#login_form{
+			padding: 2em 0 1em 0;
+		}
+		#tool_bar {
+			padding: 1em;
+			display: flex;
+			justify-content: space-between;
+		}
+		#login_shortcut {
+			display: flex;
+			flex-direction: column;
+			padding: 2em 0;
+		}
+		#login_shortcut button{
+			height:3em;
+		}
+		#button_area{
+			text-align: right;
+				padding: 1em 0;
+		}
+		.form_help{
+			font-weight: 400;
+			color: var(--bookx);
+		}
+		.login_form input{
+			margin-top:2em;
+			padding:0.5em 0.5em;
+		}
+		.login_form select{
+			margin-top:2em;
+			padding:0.5em 0.5em;
+		}
+		.login_form input[type="submit"]{
+			margin-top:2em;
+			padding:0.1em 0.5em;
+		}
+
+		.form_error{
+			color:var(--error-text);
+		}
+		#login_form_div{
+			width:30em;
+		}
+
+		#ucenter_body {
+			display: flex;
+			flex-direction: column;
+			margin: 0;
+			padding: 0;
+			background-color: var(--tool-bg-color3);
+			color: var(--btn-color);
+		}
+		.icon_big {
+			height: 2em;
+			width: 2em;
+			fill: var(--btn-color);
+			transition: all 0.2s ease;
+		}
+		.form_field_name{
+			position: absolute;
+			margin-left: 7px;
+			margin-top: 2em;
+			color: var(--btn-border-line-color);
+			-webkit-transition-duration: 0.4s;
+			-moz-transition-duration: 0.4s;
+			transition-duration: 0.4s;
+			transform: translateY(0.5em);
+		}
+		.viewswitch_on {
+			position: absolute;
+			margin-left: 7px;
+			margin-top: 1.5em;
+			color: var(--bookx);
+			-webkit-transition-duration: 0.4s;
+			-moz-transition-duration: 0.4s;
+			transition-duration: 0.4s;
+			transform: translateY(-15px);
+		}
+
+		</style>
+
+		<script>
+
+		function login_init(){
+			$("input").focus(function(){
+				let name = $(this).attr("name");
+				var objNave = document.getElementById("tip_"+name);
+				objNave.className = "viewswitch_on";
+			});
+			$(".form_field_name").click(function(){
+				let id = $(this).attr("id");
+				var objNave = document.getElementById(id);
+				objNave.className = "viewswitch_on";
+				let arrId=id.split("_");
+				document.getElementById('input_'+arrId[1]).focus();
+			});
+
+		}
+		</script>
+	<link type="text/css" rel="stylesheet" href="mobile.css" media="screen and (max-width:800px)">
+	</head>
+	<body id="ucenter_body" onload="login_init()">
+	<div id="tool_bar">
+		<div>
+		</div>
+		<div>
+			<?php
+			require_once '../lang/lang.php';
+			?>
+		</div>
+	</div>
+<div id="login_body" >
+
+	<div id="login_left">
+		<div  >
+			<svg  style="height: 8em;width: 25em;">
+				<use xlink:href="../public/images/svg/wikipali_login_page.svg#logo_login"></use>
+			</svg>
+		</div>
+		<div style="    padding: 1em 0 0 3.5em;font-weight: 400;">
+		<?php echo $_local->gui->pali_literature_platform; ?>
+		<ul style="padding-left: 1.2em;">
+			<li><?php echo $_local->gui->online_dict_db; ?></li>
+			<li><?php echo $_local->gui->user_data_share; ?></li>
+			<li><?php echo $_local->gui->cooperate_edit; ?></li>
+		</ul>
+		</div>
+	</div>
+	<div id="login_right">
+		<div id = "login_form_div" class="fun_block" >
+
+			<div class="title">
+			重置密码
+			</div>
+			<div class="login_new">
+				<span class="form_help"><?php echo $_local->gui->have_account; ?> ?</span><a href="index.php?language=<?php echo $currLanguage; ?>">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $_local->gui->login; //登入账户 ?></a>
+			</div>
+			<?php
+			if (!isset($_GET["token"])) {
+				echo '<div class="form_error">';
+				echo "无效的密钥";
+				echo '</div>';
+			}else{
+				?>
+
+			<div class="login_form" style="    padding: 3em 0 3em 0;">
+			<div class="form_help" id="message"> </div>	
+				<div id="form_div">
+				<form action="index.php" method="post">
+					<div>
+						<div>
+							<span id='tip_username' class='form_field_name'><?php echo $_local->gui->account; ?></span>
+							<input type="input" id="username" name="username"  value="" />
+						</div>
+						<div id="error_username" class="form_error"> </div>
+						<div class="form_help"></div>
+					</div>
+
+					<div>
+						<div>
+							<span id='tip_password' class='form_field_name'><?php echo $_local->gui->password; ?></span>
+							<input type="password" id="password" name="password" placeholder="密码" value="" />
+							<input type="password" id="repassword" name="repassword" placeholder="再次输入密码" value="" />
+						</div>
+						<div class="form_help">至少6个字符</div>
+						<div id="error_password" class="form_error"></div>
+					</div>
+
+					<input type="hidden"  id="token" name="token" value="<?php echo $_REQUEST["token"]; ?>" />
+				</form>
+				<div id="button_area">
+					<button  onclick="submit()" style="background-color: var(--link-hover-color);border-color: var(--link-hover-color);" >
+					<?php echo $_local->gui->continue; ?>
+					</button>
+				</div>	
+				</div>
+			</div>
+			<?php
+			}
+			?>
+		</div>
+	</div>
+</div>
+
+	<script>
+	login_init();
+
+	function submit(){
+		$.ajax({
+			type: 'POST',
+			url:"../api/user.php?_method=reset_pwd",
+			contentType:"application/json; charset=utf-8",
+			data:JSON.stringify(
+			{
+				username:$("#username").val(),
+				password:$("#password").val(),
+				reset_password_token:$("#token").val()
+			}),
+			dataType:"json"
+			}).done(function (data) {
+				
+				if(data.ok){
+					$("#form_div").hide();
+					$("#message").removeClass("form_error");
+					$("#message").html("密码修改成功。<a href='index.php?op=login'>登录</a>");
+				}else{
+					$("#message").addClass("form_error");
+					$("#message").text(data.message);
+				}
+		}).fail(function(jqXHR, textStatus, errorThrown){
+			$("#message").removeClass("form_error");
+			$("#message").text(textStatus);				
+			switch (textStatus) {
+		
+				case "timeout":
+					break;
+				case "error":
+					switch (jqXHR.status) {
+						case 404:
+							break;
+						case 500:
+							break;				
+						default:
+							break;
+					}
+					break;
+				case "abort":
+					break;
+				case "parsererror":			
+					console.log("delete-parsererror",jqXHR.responseText);
+					break;
+				default:
+					break;
+			}
+			
+		});
+		}
+	</script>
+
+	</body>
+</html>

+ 1 - 1
app/ucenter/reset_pwd_letter.html

@@ -8,6 +8,6 @@ wikipali reset password
 <a href="%ResetLink%">%ResetString%</a>
 </p>
 <p>
-	此链接包含重置密码所需要的密钥。请勿发给他人。
+	此链接包含重置密码所需要的密钥。<b>请勿发给他人</b>
 	此邮件为系统自动发送,请勿回复。
 </p>

+ 79 - 0
app/ucenter/sign.js

@@ -0,0 +1,79 @@
+function submit(){
+	if($("#password").val()!==$("#repassword").val()){
+		$("#error_password").text("两次密码输入不一致");
+		return;
+	}
+	let nickname = $("#nickname").val();
+	if( nickname ==""){
+		nickname = $("#username").val();
+	}
+	let lang = $("#lang").val();
+	if(lang=="zh-cn"){
+		lang = "zh-hans";
+	}
+	if(lang == "zh-tw"){
+		lang = "zh-hant";
+	}
+	$.ajax({
+		type: 'POST',
+		url:"../api/user.php?_method=create",
+		contentType:"application/json; charset=utf-8",
+		data:JSON.stringify({
+			invite:$("#invite").val(),
+			username:$("#username").val(),
+			password:$("#password").val(),
+			email:$("#email").val(),
+			nickname:$("#nickname").val(),
+			lang:$("#lang").val()
+		}),
+		dataType:"json"
+		}).done(function (data) {
+			
+			if(data.ok){
+				$("#form_div").hide();
+				$("#message").removeClass("form_error");
+				$("#message").html("注册成功。<a href='index.php?op=login'>"+gLocal.gui.login+"</a>");
+
+			}else{
+				$("#message").addClass("form_error");
+
+				$("#message").text(ConvertServerMsgToLocalString(data.message));
+			}
+	}).fail(function(jqXHR, textStatus, errorThrown){
+		$("#message").removeClass("form_error");
+		$("#message").text(textStatus);				
+		switch (textStatus) {
+	
+			case "timeout":
+				break;
+			case "error":
+				switch (jqXHR.status) {
+					case 404:
+						break;
+					case 500:
+						break;				
+					default:
+						break;
+				}
+				break;
+			case "abort":
+				break;
+			case "parsererror":			
+				console.log("delete-parsererror",jqXHR.responseText);
+				break;
+			default:
+				break;
+		}
+		
+	});
+}
+
+function ConvertServerMsgToLocalString(str){
+	if(str.slice(0,2)=="::"){
+		let msg = str.slice(2);
+		if(gLocal.gui.hasOwnProperty(msg)){
+			return gLocal.gui[msg];
+		}
+	}
+	return str;
+}

+ 292 - 0
app/ucenter/sign_up.php

@@ -0,0 +1,292 @@
+<?php
+#重置密码
+require_once '../path.php';
+require_once "../public/load_lang.php";
+require_once "../public/function.php";
+require_once "../redis/function.php";
+?>
+
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+		<meta name="viewport" content="width=device-width, initial-scale=1.0">
+		<link type="text/css" rel="stylesheet" href="../studio/css/font.css"/>
+		<link type="text/css" rel="stylesheet" href="../studio/css/style.css"/>
+		<link type="text/css" rel="stylesheet" href="../studio/css/color_day.css" id="colorchange" />
+		<title>wikipali reset password</title>
+		<script src="../public/js/comm.js"></script>
+		<script src="../studio/js/jquery-3.3.1.min.js"></script>
+		<script src="../studio/js/fixedsticky.js"></script>
+		<script src="../ucenter/sign.js"></script>
+		<script>
+		<?php require_once '../public/load_lang_js.php'; ?>
+	</script>
+		<style>
+		#login_body{
+			display: flex;
+			padding: 2em;
+			margin: auto;
+		}
+		#login_left {
+			padding-right: 12em;
+			padding-top: 5em;
+		}
+		.title{
+			font-size: 150%;
+			margin-top: 1em;
+			margin-bottom: 0.5em;
+		}
+		#login_form{
+			padding: 2em 0 1em 0;
+		}
+		#tool_bar {
+			padding: 1em;
+			display: flex;
+			justify-content: space-between;
+		}
+		#login_shortcut {
+			display: flex;
+			flex-direction: column;
+			padding: 2em 0;
+		}
+		#login_shortcut button{
+			height:3em;
+		}
+		#button_area{
+			text-align: right;
+				padding: 1em 0;
+		}
+		.form_help{
+			font-weight: 400;
+			color: var(--bookx);
+		}
+		.login_form input{
+			margin-top:2em;
+			padding:0.5em 0.5em;
+		}
+		.login_form select{
+			margin-top:2em;
+			padding:0.5em 0.5em;
+		}
+		.login_form input[type="submit"]{
+			margin-top:2em;
+			padding:0.1em 0.5em;
+		}
+
+		.form_error{
+			color:var(--error-text);
+		}
+		#login_form_div{
+			width:30em;
+		}
+
+		#ucenter_body {
+			display: flex;
+			flex-direction: column;
+			margin: 0;
+			padding: 0;
+			background-color: var(--tool-bg-color3);
+			color: var(--btn-color);
+		}
+		.icon_big {
+			height: 2em;
+			width: 2em;
+			fill: var(--btn-color);
+			transition: all 0.2s ease;
+		}
+		.form_field_name{
+			position: absolute;
+			margin-left: 7px;
+			margin-top: 2em;
+			color: var(--btn-border-line-color);
+			-webkit-transition-duration: 0.4s;
+			-moz-transition-duration: 0.4s;
+			transition-duration: 0.4s;
+			transform: translateY(0.5em);
+		}
+		.viewswitch_on {
+			position: absolute;
+			margin-left: 7px;
+			margin-top: 1.5em;
+			color: var(--bookx);
+			-webkit-transition-duration: 0.4s;
+			-moz-transition-duration: 0.4s;
+			transition-duration: 0.4s;
+			transform: translateY(-15px);
+		}
+
+		</style>
+
+		<script>
+
+		function login_init(){
+			$("input").focus(function(){
+				let name = $(this).attr("name");
+				var objNave = document.getElementById("tip_"+name);
+				objNave.className = "viewswitch_on";
+			});
+			$(".form_field_name").click(function(){
+				let id = $(this).attr("id");
+				var objNave = document.getElementById(id);
+				objNave.className = "viewswitch_on";
+				let arrId=id.split("_");
+				document.getElementById('input_'+arrId[1]).focus();
+			});
+
+		}
+		</script>
+	<link type="text/css" rel="stylesheet" href="mobile.css" media="screen and (max-width:800px)">
+	</head>
+	<body id="ucenter_body" onload="login_init()">
+
+	<div id="tool_bar">
+		<div>
+		</div>
+		<div>
+			<?php
+			require_once '../lang/lang.php';
+			?>
+		</div>
+	</div>
+<div id="login_body" >
+
+	<div id="login_left">
+		<div  >
+			<svg  style="height: 8em;width: 25em;">
+				<use xlink:href="../public/images/svg/wikipali_login_page.svg#logo_login"></use>
+			</svg>
+		</div>
+		<div style="    padding: 1em 0 0 3.5em;font-weight: 400;">
+		<?php echo $_local->gui->pali_literature_platform; ?>
+		<ul style="padding-left: 1.2em;">
+			<li><?php echo $_local->gui->online_dict_db; ?></li>
+			<li><?php echo $_local->gui->user_data_share; ?></li>
+			<li><?php echo $_local->gui->cooperate_edit; ?></li>
+		</ul>
+		</div>
+	</div>
+	<div id="login_right">
+		<div id = "login_form_div" class="fun_block" >
+
+			<div class="title">
+			注册wikipali账号
+			</div>
+			<div class="login_new">
+				<span class="form_help"><?php echo $_local->gui->have_account; ?> ?</span><a href="index.php?language=<?php echo $currLanguage; ?>">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $_local->gui->login; //登入账户 ?></a>
+			</div>
+			<div class="form_error">
+			<?php
+			if (!isset($_GET["invite"])) {
+				echo "目前只支持邀请码注册。";
+				exit;
+			}else{
+				$redis = redis_connect();
+				if ($redis == false) {
+					echo "服务器故障,请稍后重试。<br> 错误代码:no_redis_connect";
+					exit;
+				}
+				$code = $redis->exists("invitecode://".$_REQUEST["invite"]);
+				if(!$code){
+					echo "无效的邀请码,或邀请码已经过期。";
+					exit;
+				}
+				$invite_email = $redis->get("invitecode://".$_REQUEST["invite"]);				
+			?>
+			</div>
+		<div class="login_form" style="    padding: 3em 0 3em 0;">
+			<div class="form_help" id="message"> </div>	
+			<div id="form_div">
+				<form id="user_create_form" action="#" method="post">
+					<div>
+						<div>
+							<span id='tip_username' class='form_field_name'><?php echo $_local->gui->account; ?></span>
+							<input type="input" id="username" name="username" maxlength="32" value="" />
+						</div>
+						<div id="error_username" class="form_error"> </div>
+						<div class="form_help"> <?php echo $_local->gui->account_demond; ?> </div>
+					</div>
+
+					<div>
+						<span id='tip_email' class='viewswitch_on'><?php echo $_local->gui->email_address; ?></span>
+						<input type="input" id="email" name="email" disabled value="<?php echo $invite_email; ?>" />
+						<div id="error_email" class="form_error"> </div>
+					</div>
+
+					<div>
+						<div>
+							<span id='tip_password' class='form_field_name'><?php echo $_local->gui->password; ?></span>
+							<input type="password" id="password"  maxlength="32"  name="password"  value="" />
+							<input type="password" id="repassword" maxlength="32"  name="repassword" placeholder="再次输入密码" value="" />
+						</div>
+						<div class="form_help">
+						<?php echo $_local->gui->password_demond; ?>
+						</div>
+						<div id="error_password" class="form_error"> </div>
+					</div>
+
+						<div>
+							<span id='tip_language' class='viewswitch_on'><?php echo "惯常使用的语言"; ?></span>
+							<select id="lang" name="language" style="width: 100%;">
+							<?php
+							$currLang = $_COOKIE["language"];
+							$langList = [
+											"en"=>$_local->language->en,
+											"zh-cn"=>$_local->language->zh_cn,
+											"zh-tw"=>$_local->language->zh_tw,
+											"my"=>$_local->language->my,
+											"si"=>$_local->language->si,
+							];
+							foreach ($langList as $key => $value) {
+								# code...
+								if($currLang==$key){
+									$selected = " selected";
+								}else{
+									$selected = "";
+								}
+								echo "<option value='{$key}' {$selected}>{$value}</option>";
+							}
+							?>
+							</select>
+						</div>
+						
+						<div>
+							<div>
+								<span id='tip_nickname' class='form_field_name'><?php echo $_local->gui->nick_name; ?></span>
+								<input type="input" id="nickname"  maxlength="32"  name="nickname" placehoder="" value="" />
+							</div>
+							<div class="form_help">
+							<?php echo $_local->gui->name_for_show; ?>
+							</div>
+							<div id="error_password" class="form_error"> </div>
+						</div>
+
+						<input type="hidden" id="invite" name="invite" value="<?php echo $_REQUEST["invite"]; ?>" />
+				</form>
+				<div id="button_area">
+					<button  onclick="submit()" style="background-color: var(--link-hover-color);border-color: var(--link-hover-color);" >
+					<?php echo $_local->gui->continue; ?>
+					</button>
+				</div>	
+			</div>	
+		</div>
+			<?php
+			}
+			?>
+		</div>
+	</div>
+</div>
+
+<script>
+	login_init();
+
+	$("#username").on("change",function(){
+		$("#nickname").attr("placeholder",$("#username").val());
+	})
+	
+	
+	
+</script>
+
+	</body>
+</html>