浏览代码

cookie 修改为 user_id user_uid形式 增加httponly

visuddhinanda 4 年之前
父节点
当前提交
c7527f5610
共有 80 个文件被更改,包括 391 次插入371 次删除
  1. 7 7
      app/article/function.php
  2. 1 1
      app/article/index.php
  3. 1 1
      app/article/list_article_in_collect.php
  4. 2 2
      app/article/my_article_put.php
  5. 1 1
      app/article/my_collect_post.php
  6. 2 2
      app/article/my_collect_put.php
  7. 1 1
      app/channal/coop_new_user.php
  8. 6 6
      app/channal/function.php
  9. 5 5
      app/channal/get.php
  10. 1 1
      app/channal/my_channal_get.php
  11. 2 2
      app/channal/my_channal_put.php
  12. 5 5
      app/collect/function.php
  13. 1 1
      app/course/my_course_insert.php
  14. 1 1
      app/course/my_course_list.php
  15. 1 1
      app/course/my_lesson_insert.php
  16. 2 2
      app/db/custom_book.php
  17. 8 8
      app/db/like.php
  18. 1 1
      app/db/wbw_block.php
  19. 1 1
      app/dict/redis_sys_rgl_part.php
  20. 3 3
      app/doc/coop.php
  21. 3 3
      app/doc/coopfilelist.php
  22. 2 2
      app/doc/docinfo.php
  23. 1 1
      app/doc/edit_wbw.php
  24. 8 8
      app/doc/fork.php
  25. 6 6
      app/doc/fork_channel.php
  26. 9 9
      app/doc/pcs2db.php
  27. 1 43
      app/group/group.js
  28. 3 3
      app/group/group_del.php
  29. 1 1
      app/group/list.php
  30. 4 4
      app/group/member_del.php
  31. 2 2
      app/group/member_put.php
  32. 3 3
      app/group/my_group_put.php
  33. 1 1
      app/install/install_head.php
  34. 1 1
      app/pcdl/favorite.php
  35. 6 6
      app/pcdl/reader1.php
  36. 1 1
      app/studio/dict_find_auto.php
  37. 4 4
      app/studio/dom_http.php
  38. 2 2
      app/studio/file_index.php
  39. 1 1
      app/studio/file_index_refresh.php
  40. 2 2
      app/studio/getfilelist.php
  41. 2 2
      app/studio/message.php
  42. 7 7
      app/studio/project.php
  43. 1 1
      app/studio/project_load.php
  44. 3 3
      app/studio/publish.php
  45. 1 1
      app/studio/sent/sent.php
  46. 1 1
      app/studio/user_file.php
  47. 1 1
      app/sync/check_login.php
  48. 1 1
      app/sync/index.php
  49. 8 8
      app/sync/sync.php
  50. 3 3
      app/term/channal_list.php
  51. 2 2
      app/term/my_dict_list.php
  52. 3 3
      app/term/note.php
  53. 3 3
      app/term/term.php
  54. 1 1
      app/term/term_channel_get.php
  55. 1 1
      app/term/term_get.php
  56. 4 4
      app/term/term_post.php
  57. 1 1
      app/term/term_put.php
  58. 6 6
      app/ucenter/active.php
  59. 2 2
      app/ucenter/active_get.php
  60. 2 2
      app/ucenter/active_log_get.php
  61. 2 2
      app/ucenter/active_log_list.php
  62. 178 116
      app/ucenter/index.php
  63. 3 3
      app/ucenter/login.php
  64. 2 2
      app/ucenter/pwd_set.php
  65. 1 1
      app/ucenter/set_setting.php
  66. 1 1
      app/ucenter/setting.php
  67. 2 2
      app/ucenter/setting_function.php
  68. 2 2
      app/ucenter/user.php
  69. 2 2
      app/uhome/foot_step.php
  70. 4 4
      app/uhome/head.php
  71. 1 1
      app/usent/function.php
  72. 3 3
      app/usent/get.php
  73. 2 2
      app/usent/get_pr.php
  74. 2 2
      app/usent/new_block.php
  75. 1 1
      app/usent/pr_post.php
  76. 10 10
      app/usent/sent_post.php
  77. 3 3
      app/usent/update.php
  78. 2 2
      app/uwbw/create_wbw.php
  79. 1 1
      app/uwbw/update.php
  80. 3 3
      app/uwbw/wbw_channel_list.php

+ 7 - 7
app/article/function.php

@@ -73,8 +73,8 @@ class Article extends Table
 
 	public function getPower($id,$collectionId=""){
 		#查询用户对此是否有权限	
-		if(isset($_COOKIE["userid"])){
-			$userId = $_COOKIE["userid"];
+		if(isset($_COOKIE["user_uid"])){
+			$userId = $_COOKIE["user_uid"];
 		}
 		else{
 			$userId=0;
@@ -91,7 +91,7 @@ class Article extends Table
 		$stmt->execute(array($id));
 		$channel = $stmt->fetch(PDO::FETCH_ASSOC);
 		if($channel){
-			if(!isset($_COOKIE["userid"])){
+			if(!isset($_COOKIE["user_uid"])){
 				#未登录用户
 				if($channel["status"]==30){
 					#全网公开有读取和建议权限
@@ -103,7 +103,7 @@ class Article extends Table
 				}
 			}
 			else{
-				if($channel["owner"]==$_COOKIE["userid"]){
+				if($channel["owner"]==$_COOKIE["user_uid"]){
 					#自己的
 					return 30;
 				}
@@ -114,9 +114,9 @@ class Article extends Table
 			}
 		}
 		#查询共享权限,如果共享权限更大,覆盖上面的的
-		$sharePower = share_get_res_power($_COOKIE["userid"],$id);
+		$sharePower = share_get_res_power($_COOKIE["user_uid"],$id);
 		if($collectionId!=""){
-			$sharePowerCollection = share_get_res_power($_COOKIE["userid"],$collectionId);
+			$sharePowerCollection = share_get_res_power($_COOKIE["user_uid"],$collectionId);
 		}
 		else{
 			$sharePowerCollection =0;
@@ -128,7 +128,7 @@ class Article extends Table
 			$iPower=$sharePowerCollection;
 		}
 		if($this->redis!==false){
-			$this->redis->hSet("power://article/".$id,$_COOKIE["userid"],$iPower);
+			$this->redis->hSet("power://article/".$id,$_COOKIE["user_uid"],$iPower);
 		}
 		return $iPower;
 	}

+ 1 - 1
app/article/index.php

@@ -40,7 +40,7 @@ require_once "../pcdl/html_head.php";
 	if(isset($_GET["author"])){
 		echo "_author='".$_GET["author"]."';";
 	}
-	if(isset($_GET["mode"]) && $_GET["mode"]=="edit" && isset($_COOKIE["userid"])){
+	if(isset($_GET["mode"]) && $_GET["mode"]=="edit" && isset($_COOKIE["user_uid"])){
 		#登录状态下 编辑模式
 		$_mode = "edit";
 		echo "_mode='edit';";

+ 1 - 1
app/article/list_article_in_collect.php

@@ -22,7 +22,7 @@ if(isset($_GET["id"])){
     $output["exist"] = $exist;
 
     $query = "SELECT id,title from collect  where owner = ? AND status <> 0 order by modify_time DESC limit 0,15";
-    $others = PDO_FetchAll($query,array($_COOKIE["userid"])); 
+    $others = PDO_FetchAll($query,array($_COOKIE["user_uid"])); 
     foreach ($others as $key => $value) {
         # remove exist record
         if(!isset($exist_id[$value["id"]])){

+ 2 - 2
app/article/my_article_put.php

@@ -9,7 +9,7 @@ require_once '../hostsetting/function.php';
 require_once "../ucenter/active.php";
 
 $respond=array("status"=>0,"message"=>"");
-if(!isset($_COOKIE["userid"])){
+if(!isset($_COOKIE["user_uid"])){
 	#不登录不能新建
 	$respond['status']=1;
 	$respond['message']="no power create article";
@@ -31,7 +31,7 @@ $uuid = UUID::v4();
 //写入日志
 add_edit_event(_ARTICLE_NEW_,$uuid);
 #新建文章默认私有
-$sth->execute(array($uuid , $_POST["title"] , "" ,"", "" , "" , $_COOKIE["userid"] , "{}" , 10 , mTime() ,  mTime() , mTime() ));
+$sth->execute(array($uuid , $_POST["title"] , "" ,"", "" , "" , $_COOKIE["user_uid"] , "{}" , 10 , mTime() ,  mTime() , mTime() ));
 $respond=array("status"=>0,"message"=>"");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();

+ 1 - 1
app/article/my_collect_post.php

@@ -8,7 +8,7 @@ require_once "../redis/function.php";
 
 
 $respond=array("status"=>0,"message"=>"");
-if(!isset($_COOKIE["userid"])){
+if(!isset($_COOKIE["user_uid"])){
 	#不登录不能新建
 	$respond['status']=1;
 	$respond['message']="no power create article";

+ 2 - 2
app/article/my_collect_put.php

@@ -6,7 +6,7 @@ require_once '../hostsetting/function.php';
 require_once "../ucenter/active.php";
 
 $respond=array("status"=>0,"message"=>"");
-if(!isset($_COOKIE["userid"])){
+if(!isset($_COOKIE["user_uid"])){
 	#不登录不能新建
 	$respond['status']=1;
 	$respond['message']="no power create article";
@@ -26,7 +26,7 @@ PDO_Connect(""._FILE_DB_USER_ARTICLE_);
 $query="INSERT INTO collect ( id,  title  , subtitle  , summary , article_list   , owner, lang  , status  , create_time , modify_time , receive_time   )  VALUES  ( ? , ? , ? , ?  , ? , ? , ? , ? , ? , ? , ? ) ";
 $sth = $PDO->prepare($query);
 $uuid = UUID::v4();
-$sth->execute(array($uuid , $_POST["title"] , "" ,"", "[]" ,  $_COOKIE["userid"] , "" , $_POST["status"] , mTime() ,  mTime() , mTime() ));
+$sth->execute(array($uuid , $_POST["title"] , "" ,"", "[]" ,  $_COOKIE["user_uid"] , "" , $_POST["status"] , mTime() ,  mTime() , mTime() ));
 $respond=array("status"=>0,"message"=>"");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();

+ 1 - 1
app/channal/coop_new_user.php

@@ -4,7 +4,7 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 
 $respond=array("status"=>0,"message"=>"");
-if(isset($_COOKIE["userid"]) && isset($_POST["channel_id"])){
+if(isset($_COOKIE["user_uid"]) && isset($_POST["channel_id"])){
 	PDO_Connect(""._FILE_DB_CHANNAL_);
 	$query="INSERT INTO cooperation ( channal_id , user_id  ,type  , power  )  
 	VALUES  (  ? , ? , ? , ? ) ";

+ 6 - 6
app/channal/function.php

@@ -48,8 +48,8 @@ class Channal extends Table
 	}
 	public function getPower($id){
 		#查询用户对此channel是否有权限
-		if(isset($_COOKIE["userid"])){
-			$userId = $_COOKIE["userid"];
+		if(isset($_COOKIE["user_uid"])){
+			$userId = $_COOKIE["user_uid"];
 		}
 		else{
 			$userId='0';
@@ -66,7 +66,7 @@ class Channal extends Table
 		$stmt->execute(array($id));
 		$channel = $stmt->fetch(PDO::FETCH_ASSOC);
 		if($channel){
-			if(!isset($_COOKIE["userid"])  ){
+			if(!isset($_COOKIE["user_uid"])  ){
 				#未登录用户
 				if($channel["status"]==30){
 					#全网公开有建议权限
@@ -78,7 +78,7 @@ class Channal extends Table
 				}
 				
 			}
-			if($channel["owner"]==$_COOKIE["userid"]){
+			if($channel["owner"]==$_COOKIE["user_uid"]){
 				return 30;
 			}
 			else if($channel["status"]>=30){
@@ -87,12 +87,12 @@ class Channal extends Table
 			}
 		}
 		#查询共享权限,如果共享权限更大,覆盖上面的的
-		$sharePower = share_get_res_power($_COOKIE["userid"],$id);
+		$sharePower = share_get_res_power($_COOKIE["user_uid"],$id);
 		if($sharePower>$channelPower){
 			$channelPower=$sharePower;
 		}
 		if($this->redis){
-			$this->redis->hSet("power://channel/".$id,$_COOKIE["userid"],$channelPower);
+			$this->redis->hSet("power://channel/".$id,$_COOKIE["user_uid"],$channelPower);
 		}
 		
 		return $channelPower;

+ 5 - 5
app/channal/get.php

@@ -6,7 +6,7 @@ require_once "../public/_pdo.php";
 require_once '../ucenter/function.php';
 require_once '../share/function.php';
 
-if(!isset($_COOKIE["userid"])){
+if(!isset($_COOKIE["user_uid"])){
 	echo json_encode(array(), JSON_UNESCAPED_UNICODE);
 	exit;
 }
@@ -15,9 +15,9 @@ if(!isset($_COOKIE["userid"])){
 # 找我加入的群
 PDO_Connect(""._FILE_DB_GROUP_);
 $query = "SELECT group_id from group_member where user_id = ?  limit 0,100";
-$my_group = PDO_FetchAll($query,array($_COOKIE["userid"]));
+$my_group = PDO_FetchAll($query,array($_COOKIE["user_uid"]));
 $userList = array();
-$userList[] = $_COOKIE["userid"];
+$userList[] = $_COOKIE["user_uid"];
 foreach ($my_group as $key => $value) {
 	# code...
 	$userList[]=$value["group_id"];
@@ -29,7 +29,7 @@ $channelList = array();
 //找自己的
 PDO_Connect(_FILE_DB_CHANNAL_);
 $query = "SELECT id,owner,name,status,lang FROM channal WHERE owner = ?  LIMIT 0,100";
-$Fetch_my = PDO_FetchAll($query,array($_COOKIE["userid"]));
+$Fetch_my = PDO_FetchAll($query,array($_COOKIE["user_uid"]));
 
 foreach ($Fetch_my as $key => $value) {
 	# code...
@@ -37,7 +37,7 @@ foreach ($Fetch_my as $key => $value) {
 }
 
 # 找协作的
-$coop_channal =  share_res_list_get($_COOKIE["userid"],2);
+$coop_channal =  share_res_list_get($_COOKIE["user_uid"],2);
 foreach ($coop_channal as $key => $value) {
 	# return res_id,res_type,power res_title  res_owner_id
 	if(isset($channelList[$value["res_id"]])){

+ 1 - 1
app/channal/my_channal_get.php

@@ -36,7 +36,7 @@ if(isset($_GET["id"])){
 else{
     PDO_Connect(""._FILE_DB_CHANNAL_);
     $query = "SELECT * FROM channal  WHERE owner = ? ";
-    $Fetch = PDO_FetchAll($query,array($_COOKIE["userid"]));
+    $Fetch = PDO_FetchAll($query,array($_COOKIE["user_uid"]));
     echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
 }
 

+ 2 - 2
app/channal/my_channal_put.php

@@ -5,11 +5,11 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 require_once '../hostsetting/function.php';
 $respond=array("status"=>0,"message"=>"");
-if(isset($_COOKIE["userid"])){
+if(isset($_COOKIE["user_uid"])){
 	PDO_Connect(_FILE_DB_CHANNAL_);
 	$query="INSERT INTO channal ( id,  owner  , name  , summary ,  status  , lang, create_time , modify_time , receive_time   )  VALUES  ( ? , ? , ? , ? , ? , ? , ? , ? , ?  ) ";
 	$sth = $PDO->prepare($query);
-	$sth->execute(array(UUID::v4() , $_COOKIE["userid"] , $_POST["name"] , "" , $_POST["status"] ,$_POST["lang"]  ,  mTime() ,  mTime() , mTime() ));
+	$sth->execute(array(UUID::v4() , $_COOKIE["user_uid"] , $_POST["name"] , "" , $_POST["status"] ,$_POST["lang"]  ,  mTime() ,  mTime() , mTime() ));
 	$respond=array("status"=>0,"message"=>"");
 	if (!$sth || ($sth && $sth->errorCode() != 0)) {
 		$error = PDO_ErrorInfo();

+ 5 - 5
app/collect/function.php

@@ -72,8 +72,8 @@ class CollectInfo
 
 	public function getPower($id){
 		#查询用户对此是否有权限	
-		if(isset($_COOKIE["userid"])){
-			$userId = $_COOKIE["userid"];
+		if(isset($_COOKIE["user_uid"])){
+			$userId = $_COOKIE["user_uid"];
 		}
 		else{
 			$userId='0';
@@ -90,7 +90,7 @@ class CollectInfo
 		$stmt->execute(array($id));
 		$result = $stmt->fetch(PDO::FETCH_ASSOC);
 		if($result){
-			if(!isset($_COOKIE["userid"])){
+			if(!isset($_COOKIE["user_uid"])){
 				#未登录用户
 				if($result["status"]==30){
 					#全网公开有读取和建议权限
@@ -102,7 +102,7 @@ class CollectInfo
 				}
 			}
 			else{
-				if($result["owner"]==$_COOKIE["userid"]){
+				if($result["owner"]==$_COOKIE["user_uid"]){
 					#自己的
 					return 30;
 				}
@@ -217,7 +217,7 @@ class CollectInfo
 						$newData["owner"]=$data["owner"];
 					}
 					else{
-						$newData["owner"]=$_COOKIE["userid"];
+						$newData["owner"]=$_COOKIE["user_uid"];
 					}	
 					if(isset($data["lang"])){
 						$newData["lang"]=$data["lang"];

+ 1 - 1
app/course/my_course_insert.php

@@ -10,7 +10,7 @@ $query = "INSERT INTO course (id,  title,  subtitle, creator, tag, summary, stat
                       VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?  )";
 $sth = $PDO->prepare($query);
 
-$sth->execute(array(UUID::v4() ,$_POST["title"] , $_POST["subtitle"]  , $_COOKIE["userid"] , $_POST["tag"] ,$_POST["summary"] , 1, $_POST["cover"] ,$_POST["teacher"] ,  $_POST["lang"] , "" ,$_POST["attachment"] , 0 ,mTime() , mTime() ,  mTime() ));
+$sth->execute(array(UUID::v4() ,$_POST["title"] , $_POST["subtitle"]  , $_COOKIE["user_uid"] , $_POST["tag"] ,$_POST["summary"] , 1, $_POST["cover"] ,$_POST["teacher"] ,  $_POST["lang"] , "" ,$_POST["attachment"] , 0 ,mTime() , mTime() ,  mTime() ));
 $respond=array("status"=>0,"message"=>"");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();

+ 1 - 1
app/course/my_course_list.php

@@ -39,7 +39,7 @@ require_once '../ucenter/function.php';
 global $PDO;
 PDO_Connect(""._FILE_DB_COURSE_);
 $query = "SELECT * from course where creator = ?  order by modify_time DESC limit 0,100";
-$Fetch = PDO_FetchAll($query,array($_COOKIE["userid"]));
+$Fetch = PDO_FetchAll($query,array($_COOKIE["user_uid"]));
 
 foreach($Fetch as $row){
     echo '<div class="file_list_row">';

+ 1 - 1
app/course/my_lesson_insert.php

@@ -27,7 +27,7 @@ $timezone = $_POST["lesson_timezone"];
 $datatime = ($data+$time+$timezone*60)*1000;
 $duration = strtotime($_POST["duration"]) - strtotime("today");
 
-$sth->execute(array(UUID::v4(), $_POST["course_id"] , $_POST["live"] , $_POST["replay"] ,$_POST["title"] , $_POST["subtitle"]  , $datatime  , $duration  , $_COOKIE["userid"] , $_POST["tag"] ,$_POST["summary"] , 1, $_POST["cover"] ,$_POST["teacher"] , $_POST["attachment"] , $_POST["lang"] , $_POST["speech_lang"] ,mTime() , mTime() ,  mTime() ));
+$sth->execute(array(UUID::v4(), $_POST["course_id"] , $_POST["live"] , $_POST["replay"] ,$_POST["title"] , $_POST["subtitle"]  , $datatime  , $duration  , $_COOKIE["user_uid"] , $_POST["tag"] ,$_POST["summary"] , 1, $_POST["cover"] ,$_POST["teacher"] , $_POST["attachment"] , $_POST["lang"] , $_POST["speech_lang"] ,mTime() , mTime() ,  mTime() ));
 $respond=array("status"=>0,"message"=>"");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();

+ 2 - 2
app/db/custom_book.php

@@ -36,7 +36,7 @@ class CustomBook extends Table
 
 			$query="INSERT INTO {$this->table} ('book_id','title','owner','lang','status','modify_time','create_time') VALUES (?, ?, ?, ?, ?, ?, ?)";
 
-			$stmt = $this->execute($query,array($currBook,$title,$_COOKIE["userid"],$lang,10,mTime(),mTime()));
+			$stmt = $this->execute($query,array($currBook,$title,$_COOKIE["user_uid"],$lang,10,mTime(),mTime()));
 			if($stmt){
 				$CSent = new CustomBookSentence($this->redis);
 				$respond = $CSent->insert($currBook,$sent,$lang);
@@ -106,7 +106,7 @@ class CustomBookSentence extends Table
 							mb_strlen($data,"UTF-8"),
 							$data,
 							$lang,
-							$_COOKIE["userid"],
+							$_COOKIE["user_uid"],
 							10,
 							mTime(),
 							mTime()

+ 8 - 8
app/db/like.php

@@ -25,8 +25,8 @@ class Like extends Table
 	}
 	
 	public function  list(){
-		if(!isset($_COOKIE["userid"])){
-			$userId = $_COOKIE["userid"];
+		if(!isset($_COOKIE["user_uid"])){
+			$userId = $_COOKIE["user_uid"];
 		}
 
 		$json = file_get_contents('php://input');
@@ -39,8 +39,8 @@ class Like extends Table
 											'resource_id'=>$value['resource_id'],
 											  ]);
 		}
-		if(isset($_COOKIE["userid"])){
-			$userId = $_COOKIE["userid"];
+		if(isset($_COOKIE["user_uid"])){
+			$userId = $_COOKIE["user_uid"];
 			foreach ($data as $key => $value) {
 				# code...
 				$data[$key]['me']=$this->medoo->count($this->table,[
@@ -61,12 +61,12 @@ class Like extends Table
 
 
 	public function  create(){
-		if(!isset($_COOKIE["userid"])){
+		if(!isset($_COOKIE["user_uid"])){
 			return;
 		}
 		$json = file_get_contents('php://input');
 		$data = json_decode($json,true);
-		$data["user_id"] = $_COOKIE["userid"];
+		$data["user_id"] = $_COOKIE["user_uid"];
 		$isExist = $this->medoo->has("likes",$data);
 		if(!$isExist){
 			echo json_encode($this->_create($data,["like_type","resource_type","resource_id","user_id"]), JSON_UNESCAPED_UNICODE);
@@ -79,13 +79,13 @@ class Like extends Table
 	}
 	
 	public function  delete(){
-		if(!isset($_COOKIE["userid"])){
+		if(!isset($_COOKIE["user_uid"])){
 			return;
 		}
 		$where["like_type"] = $_GET["like_type"];
 		$where["resource_type"] = $_GET["resource_type"];
 		$where["resource_id"] = $_GET["resource_id"];
-		$where["user_id"] = $_COOKIE["userid"];
+		$where["user_id"] = $_COOKIE["user_uid"];
 		$row = $this->_delete($where);
 		if($row["data"]>0){
 			$this->result["data"] = $where;

+ 1 - 1
app/db/wbw_block.php

@@ -16,7 +16,7 @@ class WbwBlock extends Table
 		$row = $this->fetch($query,array($blockId));
 		if($row ){
 			if(empty($row["channal"])){
-				if($row["owner"]==$_COOKIE["userid"]){
+				if($row["owner"]==$_COOKIE["user_uid"]){
 					$power = 30;
 				}
 			}

+ 1 - 1
app/dict/redis_sys_rgl_part.php

@@ -2,7 +2,7 @@
 require_once "../path.php";
 require_once "../redis/function.php";
 
-if (PHP_SAPI == "cli" || isset($_COOKIE["userid"])) 
+if (PHP_SAPI == "cli" || isset($_COOKIE["user_uid"])) 
 {
 	$redis = redis_connect();
 	if ($redis != false) {

+ 3 - 3
app/doc/coop.php

@@ -27,8 +27,8 @@ require_once "../group/function.php";
 
 $userid = "";
 $isLogin = false;
-if ($_COOKIE["userid"]) {
-    $userid = $_COOKIE["userid"];
+if ($_COOKIE["user_uid"]) {
+    $userid = $_COOKIE["user_uid"];
     $isLogin = true;
 }
 if ($_GET["do"]) {
@@ -58,7 +58,7 @@ $iFetch = count($Fetch);
 if ($iFetch > 0) {
 
     $owner = $Fetch[0]["user_id"];
-    $uid = $_COOKIE["uid"];
+    $uid = $_COOKIE["user_id"];
     if ($owner == $uid) {
         //自己的文档
         switch ($_do) {

+ 3 - 3
app/doc/coopfilelist.php

@@ -7,8 +7,8 @@ require_once "../public/_pdo.php";
 require_once "../public/function.php";
 require_once "../ucenter/function.php";
 
-if($_COOKIE["uid"]){
-	$uid=$_COOKIE["uid"];
+if($_COOKIE["user_id"]){
+	$uid=$_COOKIE["user_id"];
 }
 else{
 	echo "尚未登录";
@@ -17,7 +17,7 @@ else{
 
     PDO_Connect(""._FILE_DB_FILEINDEX_);
     $query = "SELECT * from power where user = ? order by modify_time DESC";
-    $Fetch = PDO_FetchAll($query,array($_COOKIE["userid"]));
+    $Fetch = PDO_FetchAll($query,array($_COOKIE["user_uid"]));
     $result=array();
     foreach($Fetch as $row){
         $query = "SELECT * from fileindex where id = ?  ";

+ 2 - 2
app/doc/docinfo.php

@@ -10,8 +10,8 @@ require_once "../ucenter/function.php";
 
 $userid = "";
 $isLogin = false;
-if ($_COOKIE["userid"]) {
-    $userid = $_COOKIE["userid"];
+if ($_COOKIE["user_uid"]) {
+    $userid = $_COOKIE["user_uid"];
     $isLogin = true;
 }
 

+ 1 - 1
app/doc/edit_wbw.php

@@ -42,7 +42,7 @@ echo "<legend>{$_local->gui->channel} ({$_local->gui->required})</legend>";
 echo "<div>";
 PDO_Connect(""._FILE_DB_CHANNAL_);
 $query = "SELECT * from channal where owner = ?   limit 0,100";
-$Fetch = PDO_FetchAll($query,array($_COOKIE["userid"]));
+$Fetch = PDO_FetchAll($query,array($_COOKIE["user_uid"]));
 $i=0;
 foreach($Fetch as $row){
     echo '<div class="file_list_row" style="padding:5px;">';

+ 8 - 8
app/doc/fork.php

@@ -15,8 +15,8 @@ require_once '../studio/index_tool_bar.php';
 
 echo '<div class="index_inner" style="    margin-left: 18em;margin-top: 5em;">';
 
-if ($_COOKIE["uid"]) {
-    $uid = $_COOKIE["uid"];
+if ($_COOKIE["user_id"]) {
+    $uid = $_COOKIE["user_id"];
 } else {
     echo "尚未登录";
     echo "<h3><a href='../ucenter/index.php?op=login'>登录</a>后才可以打开文档 </h3>";
@@ -43,7 +43,7 @@ if (isset($_GET["channel"]) == false) {
     echo "<form action='fork.php' method='get'>";
     echo "<input type='hidden' name='doc_id' value='{$_GET["doc_id"]}' />";
     PDO_Connect("" . _FILE_DB_CHANNAL_);
-    $query = "select * from channal where owner = '{$_COOKIE["userid"]}'   limit 0,100";
+    $query = "select * from channal where owner = '{$_COOKIE["user_uid"]}'   limit 0,100";
     $Fetch = PDO_FetchAll($query);
     $i = 0;
     foreach ($Fetch as $row) {
@@ -187,7 +187,7 @@ if (isset($_GET["channel"]) == false) {
                                             $fBlock[0]["id"],
                                             $fBlock[0]["book"],
                                             $fBlock[0]["paragraph"],
-                                            $_COOKIE["userid"],
+                                            $_COOKIE["user_uid"],
                                             $fBlock[0]["lang"],
                                             $fBlock[0]["author"],
                                             $fBlock[0]["editor"],
@@ -213,7 +213,7 @@ if (isset($_GET["channel"]) == false) {
                                             $value["channal"],
                                             $value["tag"],
                                             $value["author"],
-                                            $_COOKIE["userid"],
+                                            $_COOKIE["user_uid"],
                                             $value["text"],
                                             $value["language"],
                                             $value["ver"],
@@ -246,7 +246,7 @@ if (isset($_GET["channel"]) == false) {
                                         array($newBlockId,
                                             $fBlock[0]["id"],
                                             $_GET["channel"],
-                                            $_COOKIE["userid"],
+                                            $_COOKIE["user_uid"],
                                             $fBlock[0]["book"],
                                             $fBlock[0]["paragraph"],
                                             $fBlock[0]["style"],
@@ -273,7 +273,7 @@ if (isset($_GET["channel"]) == false) {
                                             mTime(),
                                             mTime(),
                                             $value["status"],
-                                            $_COOKIE["userid"],
+                                            $_COOKIE["user_uid"],
                                         ));
 
                                 }
@@ -400,7 +400,7 @@ if (isset($_GET["channel"]) == false) {
                     $newDocInfo = $orgFileInfo;
                     $newDocInfo["id"] = $newDocId;
                     $newDocInfo["parent_id"] = $orgFileInfo["id"];
-                    $newDocInfo["user_id"] = $_COOKIE["uid"];
+                    $newDocInfo["user_id"] = $_COOKIE["user_id"];
                     $newDocInfo["doc_block"] = json_encode($newDocBlockList, JSON_UNESCAPED_UNICODE);
                     $newData = array($newDocInfo["id"],
                         $newDocInfo["parent_id"],

+ 6 - 6
app/doc/fork_channel.php

@@ -20,8 +20,8 @@ require_once '../studio/index_tool_bar.php';
 
 echo '<div class="index_inner" style="    margin-left: 18em;margin-top: 5em;">';
 
-if ($_COOKIE["uid"]) {
-    $uid = $_COOKIE["uid"];
+if ($_COOKIE["user_id"]) {
+    $uid = $_COOKIE["user_id"];
 } else {
     echo "尚未登录";
     echo "<h3><a href='../ucenter/index.php?op=login'>登录</a>后才可以打开文档 </h3>";
@@ -53,7 +53,7 @@ if (isset($_GET["dest_channel"]) == false) {
     echo "<input type='hidden' name='para' value='{$_GET["para"]}' />";
     echo "<input type='hidden' name='src_channel' value='{$_GET["src_channel"]}' />";
     PDO_Connect(_FILE_DB_CHANNAL_);
-    $query = "select * from channal where owner = '{$_COOKIE["userid"]}'   limit 0,100";
+    $query = "select * from channal where owner = '{$_COOKIE["user_uid"]}'   limit 0,100";
     $Fetch = PDO_FetchAll($query);
     $i = 0;
     PDO_Connect( _FILE_DB_USER_WBW_);	
@@ -111,7 +111,7 @@ $srcPower = (int)$channelInfo->getPower($_GET["src_channel"]);
             //别人的文档
             //查询以前自己是否曾经复刻
             $query = "SELECT * from "._TABLE_USER_WBW_BLOCK_." where parent_channel=? and owner=? ";
-            $FetchSelf = PDO_FetchAll($query,array($_GET["src_channel"],$_COOKIE["userid"]));
+            $FetchSelf = PDO_FetchAll($query,array($_GET["src_channel"],$_COOKIE["user_uid"]));
             $iFetchSelf = count($FetchSelf);
             if ($iFetchSelf > 0) {
                 //以前打开过
@@ -166,7 +166,7 @@ $srcPower = (int)$channelInfo->getPower($_GET["src_channel"]);
 									"",
 									$_GET["dest_channel"],
 									$_GET["src_channel"],
-									$_COOKIE["userid"],
+									$_COOKIE["user_uid"],
 									$fBlock[0]["book"],
 									$fBlock[0]["paragraph"],
 									$fBlock[0]["style"],
@@ -194,7 +194,7 @@ $srcPower = (int)$channelInfo->getPower($_GET["src_channel"]);
 									mTime(),
 									mTime(),
 									$value["status"],
-									$_COOKIE["userid"],
+									$_COOKIE["user_uid"],
 								));
 
 						}

+ 9 - 9
app/doc/pcs2db.php

@@ -13,8 +13,8 @@ echo '<div class="index_inner" style="    margin-left: 18em;margin-top: 5em;">';
 
 echo "<h2>转换PCS 到数据库格式</h2>";
 
-if ($_COOKIE["uid"]) {
-    $uid = $_COOKIE["uid"];
+if ($_COOKIE["user_id"]) {
+    $uid = $_COOKIE["user_id"];
 } else {
     echo "尚未登录";
     echo "<h3><a href='../ucenter/index.php?op=login'>登录</a>后才可以打开文档 </h3>";
@@ -41,7 +41,7 @@ if (isset($_GET["channel"]) == false) {
     echo "<form action='pcs2db.php' method='get'>";
     echo "<input type='hidden' name='doc_id' value='{$_GET["doc_id"]}' />";
     PDO_Connect("" . _FILE_DB_CHANNAL_);
-    $query = "SELECT * from channal where owner = '{$_COOKIE["userid"]}'   limit 0,100";
+    $query = "SELECT * from channal where owner = '{$_COOKIE["user_uid"]}'   limit 0,100";
     $Fetch = PDO_FetchAll($query);
     $i = 0;
     foreach ($Fetch as $row) {
@@ -95,7 +95,7 @@ if (isset($_GET["channel"]) == false) {
     exit;
 }
 
-$dir = _DIR_USER_DOC_ . '/' . $_COOKIE["userid"] . _DIR_MYDOCUMENT_;
+$dir = _DIR_USER_DOC_ . '/' . $_COOKIE["user_uid"] . _DIR_MYDOCUMENT_;
 PDO_Connect("" . _FILE_DB_FILEINDEX_);
 $query = "SELECT file_name, doc_info, modify_time from fileindex where id=? ";
 $Fetch = PDO_FetchRow($query, array($_GET["doc_id"]));
@@ -188,7 +188,7 @@ $dataBlock = $xml->xpath('//block');
                         "",
                         $block->info->book,
                         $block->info->paragraph,
-                        $_COOKIE["userid"],
+                        $_COOKIE["user_uid"],
                         $block->info->language,
                         $block->info->author,
                         "",
@@ -223,7 +223,7 @@ $dataBlock = $xml->xpath('//block');
                                 $sent_end,
                                 "",
                                 $block->info->author,
-                                $_COOKIE["userid"],
+                                $_COOKIE["user_uid"],
                                 $paraText,
                                 mb_strlen($paraText, "UTF-8"),
                                 $block->info->language,
@@ -246,7 +246,7 @@ $dataBlock = $xml->xpath('//block');
                         array($blockid,
                             "",
                             $_GET["channel"],
-                            $_COOKIE["userid"],
+                            $_COOKIE["user_uid"],
                             $block->info->book,
                             $block->info->paragraph,
                             "",
@@ -278,7 +278,7 @@ $dataBlock = $xml->xpath('//block');
                                 $file_modify_time,
                                 mTime(),
                                 $currWordStatus,
-                                $_COOKIE["userid"],
+                                $_COOKIE["user_uid"],
                             ));
                             $sWordData = "";
                         }
@@ -328,7 +328,7 @@ $dataBlock = $xml->xpath('//block');
                         $file_modify_time,
                         mTime(),
                         $word->status,
-                        $_COOKIE["userid"],
+                        $_COOKIE["user_uid"],
                     ));
                 break;
             case 2:

+ 1 - 43
app/group/group.js

@@ -129,49 +129,7 @@ function group_list(id, list) {
 								result.parent.name +
 								"</a> "
 						);
-					} else {
-						/*
-						关闭子小组功能
-						if (result.info.owner == getCookie("userid")) {
-							$("#button_new_sub_group").show();
-						}
-						//子小组列表
-						html += "<div class='info_block'>";
-						html += "<h2>" + gLocal.gui.sub_group + "</h2>";
-						if (result.children && result.children.length > 0) {
-							for (const iterator of result.children) {
-								html += '<div class="file_list_row" style="padding:5px;">';
-								html += "<div style='flex:1;'>" + key++ + "</div>";
-								html += "<div style='flex:2;'>" + iterator.name + "</div>";
-								html += "<div style='flex:2;'>";
-								if (iterator.owner == getCookie("userid")) {
-									html += gLocal.gui.owner;
-								}
-								html += "</div>";
-								html +=
-									"<div style='flex:1;'><a href='../group/index.php?id=" +
-									iterator.id +
-									"&list=file'>" +
-									gLocal.gui.enter +
-									"</a></div>";
-								html += "<div style='flex:1;'><div class='hover_button'>";
-								if (iterator.owner == getCookie("userid")) {
-									html +=
-										"<button onclick=\"group_del('" +
-										iterator.id +
-										"')\">" +
-										gLocal.gui.delete +
-										"</button>";
-								}
-								html += "</div></div>";
-								html += "</div>";
-							}
-						} else {
-							html += "尚未设置小组";
-						}
-						html += "</div>";
-*/
-					}
+					} 
 
 					//共享文件列表
 					key = 1;

+ 3 - 3
app/group/group_del.php

@@ -4,15 +4,15 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 
 $respond = array("status" => 0, "message" => "");
-if (isset($_COOKIE["userid"]) && isset($_POST["groupid"])) {
+if (isset($_COOKIE["user_uid"]) && isset($_POST["groupid"])) {
     PDO_Connect("" . _FILE_DB_GROUP_);
     #TODO 先查是否有删除权限
     $query = "SELECT parent from group_info where id=? and owner=? ";
-    $gInfo = PDO_FetchRow($query, array($_POST["groupid"], $_COOKIE["userid"]));
+    $gInfo = PDO_FetchRow($query, array($_POST["groupid"], $_COOKIE["user_uid"]));
     if ($gInfo) {
         #删除group info
         $query = "DELETE from group_info where id=? and owner=? ";
-        PDO_Execute($query, array($_POST["groupid"], $_COOKIE["userid"]));
+        PDO_Execute($query, array($_POST["groupid"], $_COOKIE["user_uid"]));
         #删除 组员
         $query = "DELETE from group_member where group_id=? ";
         PDO_Execute($query, array($_POST["groupid"]));

+ 1 - 1
app/group/list.php

@@ -9,7 +9,7 @@ require_once '../ucenter/function.php';
 //列出 我j参与的群组
 PDO_Connect("" . _FILE_DB_GROUP_);
 $query = "SELECT group_name,group_id,power FROM group_member  WHERE level = 0 and user_id=?";
-$Fetch = PDO_FetchAll($query, array($_COOKIE["userid"]));
+$Fetch = PDO_FetchAll($query, array($_COOKIE["user_uid"]));
 foreach ($Fetch as $key => $value) {
 	# code...
 	$query = "SELECT name FROM group_info  WHERE id=?";

+ 4 - 4
app/group/member_del.php

@@ -4,7 +4,7 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 
 $respond = array("status" => 0, "message" => "");
-if (!isset($_COOKIE["userid"])) {
+if (!isset($_COOKIE["user_uid"])) {
     $respond['status'] = 1;
     $respond['message'] = "尚未登录";
     echo json_encode($respond, JSON_UNESCAPED_UNICODE);
@@ -18,13 +18,13 @@ if (isset($_POST["groupid"])) {
     $fc = PDO_FetchRow($query, array($_POST["groupid"]));
     if ($fc) {
         if ($fc["parent"] == 0) {
-            if ($fc["owner"] == $_COOKIE["userid"]) {
+            if ($fc["owner"] == $_COOKIE["user_uid"]) {
                 $mypower = 0;
             }
         } else {
             $query = "SELECT owner  from group_info where id=?";
             $g_parent = PDO_FetchRow($query, array($fc["parent"]));
-            if ($g_parent && $g_parent["owner"] == $_COOKIE["userid"]) {
+            if ($g_parent && $g_parent["owner"] == $_COOKIE["user_uid"]) {
                 $mypower = 0;
             }
         }
@@ -32,7 +32,7 @@ if (isset($_POST["groupid"])) {
     if ($mypower != 0) {
         #非拥有者,看看是不是管理员
         $query = "SELECT power from group_member where user_id=? and group_id=? ";
-        $power = PDO_FetchRow($query, array($_COOKIE["userid"], $_POST["groupid"]));
+        $power = PDO_FetchRow($query, array($_COOKIE["user_uid"], $_POST["groupid"]));
         if ($power) {
             $mypower = (int) $power["power"];
         }

+ 2 - 2
app/group/member_put.php

@@ -4,11 +4,11 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 
 $respond = array("status" => 0, "message" => "");
-if (isset($_COOKIE["userid"]) && isset($_POST["groupid"])) {
+if (isset($_COOKIE["user_uid"]) && isset($_POST["groupid"])) {
     PDO_Connect("" . _FILE_DB_GROUP_);
     #TODO 先查是否有加人权限
     $query = "SELECT power from group_member where user_id=? and group_id=? ";
-    $power = PDO_FetchRow($query, array($_COOKIE["userid"], $_POST["groupid"]));
+    $power = PDO_FetchRow($query, array($_COOKIE["user_uid"], $_POST["groupid"]));
     if ($power) {
         if ($power["power"] > 1) {
             $respond['status'] = 1;

+ 3 - 3
app/group/my_group_put.php

@@ -5,7 +5,7 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 
 $respond = array("status" => 0, "message" => "");
-if (isset($_COOKIE["userid"])) {
+if (isset($_COOKIE["user_uid"])) {
     PDO_Connect(_FILE_DB_GROUP_);
 	#先查询是否有重复的组名
 	$query = "SELECT id FROM group_info  WHERE name = ? ";
@@ -20,7 +20,7 @@ if (isset($_COOKIE["userid"])) {
 	                       VALUES  ( ?, ? , ? , ? , ? , ?  ,? ) ";
     $sth = $PDO->prepare($query);
     $newid = UUID::v4();
-    $sth->execute(array($newid, $_POST["parent"], $_POST["name"], "", 1, $_COOKIE["userid"], mTime()));
+    $sth->execute(array($newid, $_POST["parent"], $_POST["name"], "", 1, $_COOKIE["user_uid"], mTime()));
     $respond = array("status" => 0, "message" => "");
     if (!$sth || ($sth && $sth->errorCode() != 0)) {
         $error = PDO_ErrorInfo();
@@ -32,7 +32,7 @@ if (isset($_COOKIE["userid"])) {
     $query = "INSERT INTO group_member (  user_id  , group_id  , power , group_name , level ,  status )
 		VALUES  (  ? , ? , ? , ? , ?  ,? ) ";
     $sth = $PDO->prepare($query);
-    $sth->execute(array($_COOKIE["userid"], $newid, 0, $_POST["name"], 0, 1));
+    $sth->execute(array($_COOKIE["user_uid"], $newid, 0, $_POST["name"], 0, 1));
     $respond = array("status" => 0, "message" => "");
     if (!$sth || ($sth && $sth->errorCode() != 0)) {
         $error = PDO_ErrorInfo();

+ 1 - 1
app/install/install_head.php

@@ -28,7 +28,7 @@ function user_db_is_exist()
 }
 
 if (user_db_is_exist()) {
-    if (!isset($_COOKIE["userid"])) {
+    if (!isset($_COOKIE["user_uid"])) {
         echo "请登陆后执行此操作";
         exit;
     }

+ 1 - 1
app/pcdl/favorite.php

@@ -11,7 +11,7 @@ else{
 }
 	
 	//更新点击
-	$dir= $dir_user_base.$_COOKIE["userid"];
+	$dir= $dir_user_base.$_COOKIE["user_uid"];
 	$db_file = $dir.'my_data.db';
 	PDO_Connect("$db_file");
 

+ 6 - 6
app/pcdl/reader1.php

@@ -809,9 +809,9 @@ if ($currParaLevel == 1 || $currParaParentLevel == 1) {
                 $sentClass = "";
                 # 找出句子中 我贡献的,优先显示
                 if ($_view != "sent") {
-                    if (isset($_COOKIE["userid"])) {
-                        if ($thisSent["editor"] !== $_COOKIE["userid"]) {
-                            $query = "SELECT * FROM sentence WHERE parent = " . $PDO->quote($thisSent["id"]) . " AND editor = " . $PDO->quote($_COOKIE["userid"]) . " order by modify_time DESC limit 0,1";
+                    if (isset($_COOKIE["user_uid"])) {
+                        if ($thisSent["editor"] !== $_COOKIE["user_uid"]) {
+                            $query = "SELECT * FROM sentence WHERE parent = " . $PDO->quote($thisSent["id"]) . " AND editor = " . $PDO->quote($_COOKIE["user_uid"]) . " order by modify_time DESC limit 0,1";
                             $myText = PDO_FetchAll($query);
                             if (count($myText) > 0) {
                                 $thisSent = $myText[0];
@@ -914,7 +914,7 @@ function render_sent($sent_data, $sn, $display_mode, $sent_count, $class = "")
 
     if ($display_mode == "sent") {
         if ((isset($_GET["channal"]) || $_GET["view"] == "sent")) {
-            if ($sent_data["editor"] == $_COOKIE["userid"]) {
+            if ($sent_data["editor"] == $_COOKIE["user_uid"]) {
                 $output .= "<svg class='edit_icon'><use xlink:href='../studio/svg/icon.svg#ic_mode_edit'></use></svg>";
             }
 
@@ -934,14 +934,14 @@ function render_sent($sent_data, $sn, $display_mode, $sent_count, $class = "")
         $output .= "<div style='font-size:80%;color:gray;'>{$name["nickname"]} <span style='color:gray;'>@{$name["username"]} </span>· {$channalInfo["name"]}</div>";
         $output .= "<div class='sent_blcok_tools'>";
 
-        if ($sent_data["editor"] == $_COOKIE["userid"]) {
+        if ($sent_data["editor"] == $_COOKIE["user_uid"]) {
             $output .= "<span>{$_local_arr["gui"]["revise"]}</span>";
         } else {
             $output .= "<edit>{$_local_arr["gui"]["revise"]}</edit>";
         }
 
         $output .= "{$edit_count}  ";
-        if ($sent_data["editor"] != $_COOKIE["userid"]) {
+        if ($sent_data["editor"] != $_COOKIE["user_uid"]) {
             $output .= "<span onclick=\"sent_apply('{$sent_data["id"]}')\">采纳</span>";
         }
         $output .= '<svg t="1600445373282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2368" width="16" height="16"><path fill="silver" d="M854.00064 412.66688h-275.99872v-35.99872c48-102.00064 35.99872-227.99872 0-288-12.00128-18.00192-35.99872-35.99872-54.00064-35.99872s-35.99872 6.00064-35.99872 54.00064c0 96-6.00064 137.99936-24.00256 179.99872-12.00128 29.99808-77.99808 96-156.00128 120.00256v480c12.00128 6.00064 35.99872 24.00256 54.00064 29.99808 18.00192 12.00128 48 18.00192 60.00128 18.00192h306.00192c77.99808 0 108.00128-29.99808 108.00128-66.00192 0-18.00192 0-29.99808-18.00192-35.99872V796.672c41.99936 0 83.99872-12.00128 83.99872-48 0-29.99808-12.00128-35.99872-18.00192-35.99872v-35.99872h6.00064c24.00256 0 60.00128-35.99872 60.00128-60.00128 0-18.00192-6.00064-35.99872-18.00192-41.99936-6.00064-6.00064-24.00256-6.00064-24.00256-6.00064v-35.99872s12.00128 0 24.00256-12.00128c18.00192-12.00128 18.00192-42.00448 18.00192-42.00448v-12.00128c0-29.99808-48-54.00064-96-54.00064zM67.99872 478.6688l35.99872 408.00256c6.00064 24.00256 24.00256 48 48 48h83.99872c6.00064 0 12.00128-6.00064 18.00192-12.00128s12.00128-6.00064 18.00192-12.00128V412.66688H128c-35.99872 0-60.00128 35.99872-60.00128 66.00192z" p-id="2369"></path></svg>';

+ 1 - 1
app/studio/dict_find_auto.php

@@ -98,7 +98,7 @@ array_push($db_file_list, array(_DIR_DICT_3RD_ . "/concise.db", ""));
 array_push($db_file_list, array(_DIR_DICT_3RD_ . "/uhan_en.db", ""));
 */
 
-$db_file_list[] = array("","wbwdict://new/".$_COOKIE["userid"],true);	
+$db_file_list[] = array("","wbwdict://new/".$_COOKIE["user_uid"],true);	
 $db_file_list[] = array(_FILE_DB_TERM_,"dict://term",true);	
 $db_file_list[] = array(_FILE_DB_WBW1_,"dict://user",true);
 

+ 4 - 4
app/studio/dom_http.php

@@ -19,13 +19,13 @@ if (isset($_POST["xmldata"])) {
 }
 
 PDO_Connect( _FILE_DB_FILEINDEX_);
-$query = "select file_name from fileindex where user_id='{$_COOKIE["uid"]}' AND  id='{$fileid}'";
+$query = "select file_name from fileindex where user_id='{$_COOKIE["user_id"]}' AND  id='{$fileid}'";
 $Fetch = PDO_FetchOne($query);
 $purefilename = $Fetch;
-$FileName = _DIR_USER_DOC_ . "/" . $_COOKIE["userid"] . _DIR_MYDOCUMENT_ . "/" . $Fetch;
+$FileName = _DIR_USER_DOC_ . "/" . $_COOKIE["user_uid"] . _DIR_MYDOCUMENT_ . "/" . $Fetch;
 
-if ($_COOKIE["uid"]) {
-    $uid = $_COOKIE["uid"];
+if ($_COOKIE["user_id"]) {
+    $uid = $_COOKIE["user_id"];
 } else {
     echo "尚未登录";
     exit;

+ 2 - 2
app/studio/file_index.php

@@ -22,8 +22,8 @@ if (isset($_POST["field"])) {
 if (isset($_POST["value"])) {
     $value = $_POST["value"];
 }
-if ($_COOKIE["uid"]) {
-    $uid = $_COOKIE["uid"];
+if ($_COOKIE["user_id"]) {
+    $uid = $_COOKIE["user_id"];
 } else {
     echo "尚未登录";
     exit;

+ 1 - 1
app/studio/file_index_refresh.php

@@ -3,7 +3,7 @@ include "../path.php";
 include "./_pdo.php";
 
 //获取服务器端文件列表
-$dir = _DIR_USER_DOC_ . '/' . $_COOKIE["userid"] . '/' . _DIR_MYDOCUMENT_ . "/";
+$dir = _DIR_USER_DOC_ . '/' . $_COOKIE["user_uid"] . '/' . _DIR_MYDOCUMENT_ . "/";
 
 PDO_Connect( _FILE_DB_FILEINDEX_);
 

+ 2 - 2
app/studio/getfilelist.php

@@ -31,8 +31,8 @@ if (isset($_GET["order"])) {
     $order = "desc";
 }
 
-if ($_COOKIE["uid"]) {
-    $uid = $_COOKIE["uid"];
+if ($_COOKIE["user_id"]) {
+    $uid = $_COOKIE["user_id"];
 } else {
     echo "尚未登录";
     exit;

+ 2 - 2
app/studio/message.php

@@ -40,8 +40,8 @@ if (isset($_POST["paragraph"])) {
 } else {
     $para = 0;
 }
-if (isset($_COOKIE["username"]) && !empty($_COOKIE["username"])) {
-    $uid = $_COOKIE["uid"];
+if (isset($_COOKIE["user_id"]) ) {
+    $uid = $_COOKIE["user_id"];
     $username = $_COOKIE["username"];
 } else {
     echo "not login";

+ 7 - 7
app/studio/project.php

@@ -39,9 +39,9 @@ if (isset($_POST["data"])) {
 } else if (isset($_GET["data"])) {
     $data = $_GET["data"];
 }
-if ($_COOKIE["uid"]) {
-    $uid = $_COOKIE["uid"];
-    $USER_ID = $_COOKIE["userid"];
+if ($_COOKIE["user_id"]) {
+    $uid = $_COOKIE["user_id"];
+    $USER_ID = $_COOKIE["user_uid"];
     $USER_NAME = $_COOKIE["username"];
 } else {
     echo '<a href="../ucenter/index.php" target="_blank">' . $_local->gui->not_login . '</a>';
@@ -339,7 +339,7 @@ switch ($op) {
                 echo "<legend>{$_local->gui->channel} ({$_local->gui->required})</legend>";
                 echo "<div>";
                 PDO_Connect(_FILE_DB_CHANNAL_);
-                $query = "select * from channal where owner = '{$_COOKIE["userid"]}'   limit 0,100";
+                $query = "select * from channal where owner = '{$_COOKIE["user_uid"]}'   limit 0,100";
                 $Fetch = PDO_FetchAll($query);
                 $i = 0;
                 foreach ($Fetch as $row) {
@@ -839,8 +839,8 @@ switch ($op) {
             2.别人的共享文档,自己以前没有打开过。复制到自己的空间,再打开。
             3.别人的共享文档,自己以前打开过。直接打开
              */
-            if ($_COOKIE["uid"]) {
-                $uid = $_COOKIE["uid"];
+            if ($_COOKIE["user_id"]) {
+                $uid = $_COOKIE["user_id"];
             } else {
                 echo "<h3><a href='../ucenter/index.php?op=login'>{$_local->gui->login}</a>后才可以打开文档</h3>";
                 exit;
@@ -927,7 +927,7 @@ exit;
                                 $FetchUid = PDO_FetchOne($query);
                                 if ($FetchUid) {
                                     $source = _DIR_USER_DOC_ . "/" . $FetchUid . _DIR_MYDOCUMENT_ . "/" . $filename;
-                                    $dest = _DIR_USER_DOC_ . "/" . $_COOKIE["userid"] . _DIR_MYDOCUMENT_ . "/" . $filename;
+                                    $dest = _DIR_USER_DOC_ . "/" . $_COOKIE["user_uid"] . _DIR_MYDOCUMENT_ . "/" . $filename;
                                 }
                                 echo "<div>源文件{$source}</div>";
                                 echo "<div>目标文件{$dest}</div>";

+ 1 - 1
app/studio/project_load.php

@@ -4,7 +4,7 @@ require_once "../path.php";
 require_once "../public/_pdo.php";
 
 PDO_Connect(_FILE_DB_FILEINDEX_);
-$query = "select file_name from fileindex where user_id='{$_COOKIE["uid"]}' AND  id='{$_GET["id"]}'";
+$query = "select file_name from fileindex where user_id='{$_COOKIE["user_id"]}' AND  id='{$_GET["id"]}'";
 $Fetch = PDO_FetchOne($query);
 $FileName = _DIR_USER_DOC_ . "/" . $userid . _DIR_MYDOCUMENT_ . "/" . $Fetch;
 if (file_exists($FileName)) {

+ 3 - 3
app/studio/publish.php

@@ -33,9 +33,9 @@ if (isset($_GET["step"])) {
     $step = $_GET["step"];
 }
 
-if ($_COOKIE["userid"]) {
-    $userid = $_COOKIE["userid"];
-    $uid = $_COOKIE["uid"];
+if ($_COOKIE["user_id"]) {
+    $userid = $_COOKIE["user_uid"];
+    $uid = $_COOKIE["user_id"];
 } else {
     echo "尚未登录";
     exit;

+ 1 - 1
app/studio/sent/sent.php

@@ -13,7 +13,7 @@ if (isset($_POST["uid"])) {
     $UID = $_POST["uid"];
 } else {
     if (isset($_COOKIE["username"]) && !empty($_COOKIE["username"])) {
-        $UID = $_COOKIE["uid"];
+        $UID = $_COOKIE["user_id"];
     }
 }
 

+ 1 - 1
app/studio/user_file.php

@@ -3,7 +3,7 @@ include("../public/config.php");
 
 $USER_ID = "";
 if(isset($_COOKIE["username"]) && !empty($_COOKIE["username"])){
- $USER_ID = $_COOKIE["userid"];
+ $USER_ID = $_COOKIE["user_uid"];
 }
 
 if($USER_ID!=""){

+ 1 - 1
app/sync/check_login.php

@@ -15,7 +15,7 @@ if(!isset($_COOKIE["sync_userid"])){
 	</div>
 	<h3>用户名:<?php echo $_COOKIE["username"];?></h3>
 	<div>
-	<input id="userid" type="hidden" name="userid"  value="<?php echo $_COOKIE["userid"];?>" style="width:30em;" />
+	<input id="userid" type="hidden" name="userid"  value="<?php echo $_COOKIE["user_uid"];?>" style="width:30em;" />
 	
 	<input id="password" type="password" name="password" placeholder="password" value="" style="width:30em;" />
 	<br>

+ 1 - 1
app/sync/index.php

@@ -8,7 +8,7 @@ require_once "../pcdl/html_head.php";
 	<script language="javascript" src="sync.js"></script>
 
 <?php 
-	if(!isset($_COOKIE["userid"])){
+	if(!isset($_COOKIE["user_uid"])){
 		echo "没有登录,请在登录后执行同步操作";
 	}
 	else if(!isset($_COOKIE["sync_userid"])){

+ 8 - 8
app/sync/sync.php

@@ -14,7 +14,7 @@ $message = "<h3>正在处理 {$path}</h3>";
 
 $redis=redis_connect();
 if($redis){
-	$sync_key = $redis->hget("sync://key",$_COOKIE["userid"]);
+	$sync_key = $redis->hget("sync://key",$_COOKIE["user_uid"]);
 	if($sync_key===FALSE){
 		$message.= "客户端没有钥匙"."<br>";
 		$output["message"]=$message;
@@ -31,13 +31,13 @@ else{
 
 $client = new \GuzzleHttp\Client();
 if($size<0){
-	$response = $client->request('POST', $server.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'sync_count','time'=>$time,'size'=>$size,"key"=>$sync_key,"userid"=>$_COOKIE["userid"]]]);
+	$response = $client->request('POST', $server.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'sync_count','time'=>$time,'size'=>$size,"key"=>$sync_key,"userid"=>$_COOKIE["user_uid"]]]);
 	$serverJson=(string)$response->getBody();
 	$serverData = json_decode($serverJson,true);
 	echo json_encode($serverData, JSON_UNESCAPED_UNICODE);
 	exit;	
 }
-$response = $client->request('POST', $server.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'sync','time'=>$time,'size'=>$size,"key"=>$sync_key,"userid"=>$_COOKIE["userid"]]]);
+$response = $client->request('POST', $server.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'sync','time'=>$time,'size'=>$size,"key"=>$sync_key,"userid"=>$_COOKIE["user_uid"]]]);
 $serverJson=(string)$response->getBody();
 $serverData = json_decode($serverJson,true);
 if($serverData===NULL){
@@ -73,7 +73,7 @@ foreach($serverDBData as $sd){
 }
 $sIdlist = json_encode($aIdList, JSON_UNESCAPED_UNICODE);
 // 拉 id 列表
-$response = $client->request('POST', $localhost.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'sync','id'=>$sIdlist,'size'=>$size,"key"=>$sync_key,"userid"=>$_COOKIE["userid"]]]);
+$response = $client->request('POST', $localhost.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'sync','id'=>$sIdlist,'size'=>$size,"key"=>$sync_key,"userid"=>$_COOKIE["user_uid"]]]);
 $strLocalData = (string)$response->getBody();
 $localData = json_decode($strLocalData,true);
 if($localData["error"]>0){
@@ -139,13 +139,13 @@ else{
 		
 		#提取数据
 		$idInServer = json_encode($insert_to_local, JSON_UNESCAPED_UNICODE);
-		$response = $client->request('POST', $server.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'get','id'=>"{$idInServer}","key"=>$sync_key,"userid"=>$_COOKIE["userid"]]]);
+		$response = $client->request('POST', $server.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'get','id'=>"{$idInServer}","key"=>$sync_key,"userid"=>$_COOKIE["user_uid"]]]);
 		$serverData=(string)$response->getBody();
 		$arrData = json_decode($serverData,true);
 		if($arrData["error"]==0){
 			$message .= "数据提取成功:{$arrData["message"]} | ";
 			$strData = json_encode($arrData["data"], JSON_UNESCAPED_UNICODE);
-			$response = $client->request('POST', $localhost.'/app/'.$path, ['verify' => false,'form_params'=>['op'=>'insert','data'=>"{$strData}","key"=>$sync_key,"userid"=>$_COOKIE["userid"]]]);
+			$response = $client->request('POST', $localhost.'/app/'.$path, ['verify' => false,'form_params'=>['op'=>'insert','data'=>"{$strData}","key"=>$sync_key,"userid"=>$_COOKIE["user_uid"]]]);
 			$insertMsg =  (string)$response->getBody();	
 			$arrInsertMsg = json_decode($insertMsg,true);	
 			$message .= $arrInsertMsg["message"] . " | ";
@@ -161,13 +161,13 @@ else{
 	if(count($update_to_local)>0){
 		$message .=  "需要更新到目标机".count($update_to_local)."条记录 | ";
 		$idInServer = json_encode($update_to_local, JSON_UNESCAPED_UNICODE);
-		$response = $client->request('POST', $server.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'get','id'=>"{$idInServer}","key"=>$sync_key,"userid"=>$_COOKIE["userid"]]]);
+		$response = $client->request('POST', $server.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'get','id'=>"{$idInServer}","key"=>$sync_key,"userid"=>$_COOKIE["user_uid"]]]);
 		$serverData=(string)$response->getBody();
 		$arrData = json_decode($serverData,true);
 		if($arrData["error"]==0){
 			$message .= "数据提取成功:{$arrData["message"]} | ";
 			$strData = json_encode($arrData["data"], JSON_UNESCAPED_UNICODE);
-			$response = $client->request('POST', $localhost.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'update','data'=>"{$strData}","key"=>$sync_key,"userid"=>$_COOKIE["userid"]]]);
+			$response = $client->request('POST', $localhost.'/app/'.$path,['verify' => false,'form_params'=>['op'=>'update','data'=>"{$strData}","key"=>$sync_key,"userid"=>$_COOKIE["user_uid"]]]);
 			$strMsgUpdate =  (string)$response->getBody();
 			$arrMsgUpdate = json_decode($strMsgUpdate,true);
 			$message .= $arrMsgUpdate["message"] . " | ";;

+ 3 - 3
app/term/channal_list.php

@@ -41,11 +41,11 @@ $channal = array();
 #查询有阅读权限的channel
 $channal_list = array();
 $channel_power=array();
-if (isset($_COOKIE["userid"])) {
+if (isset($_COOKIE["user_uid"])) {
 	//找自己的
     PDO_Connect(_FILE_DB_CHANNAL_);
     $query = "SELECT id from channal where owner = ? and status >0   limit 0,100";
-    $Fetch_my = PDO_FetchAll($query, array($_COOKIE["userid"]));
+    $Fetch_my = PDO_FetchAll($query, array($_COOKIE["user_uid"]));
     foreach ($Fetch_my as $key => $value) {
         # code...
 		$channal_list[] = $value["id"];
@@ -56,7 +56,7 @@ if (isset($_COOKIE["userid"])) {
 	$timeStart = $time;
 
 	# 找协作的
-	$coop_channal =  share_res_list_get($_COOKIE["userid"],2);
+	$coop_channal =  share_res_list_get($_COOKIE["user_uid"],2);
 	foreach ($coop_channal as $key => $value) {
 		# return res_id,res_type,power res_title  res_owner_id
 		$channal_list[] = $value["res_id"];

+ 2 - 2
app/term/my_dict_list.php

@@ -78,7 +78,7 @@ PDO_Connect(_FILE_DB_TERM_);
 
 $query = "select count(*) as co  from term where owner= ? ";
 
-$allWord = PDO_FetchOne($query, array($_COOKIE["userid"]));
+$allWord = PDO_FetchOne($query, array($_COOKIE["user_uid"]));
 $iCountWords = $allWord;
 
 if ($iCountWords == 0) {
@@ -92,7 +92,7 @@ if ($iCountWords == 0) {
     $begin = $iCurrPage * $iOnePage;
 
     $query = "select *  from term where owner= ? ";
-    $allWords = PDO_FetchAll($query, array($_COOKIE["userid"]));
+    $allWords = PDO_FetchAll($query, array($_COOKIE["user_uid"]));
 
     echo '<div id="setting_user_dict_nav">';
 

+ 3 - 3
app/term/note.php

@@ -59,10 +59,10 @@ $output = array();
 
 #查询有阅读权限的channel
 $channal_list = array();
-if (isset($_COOKIE["userid"])) {
+if (isset($_COOKIE["user_uid"])) {
     PDO_Connect( _FILE_DB_CHANNAL_);
     $query = "SELECT id from channal where owner = ?   limit 0,100";
-    $Fetch_my = PDO_FetchAll($query, array($_COOKIE["userid"]));
+    $Fetch_my = PDO_FetchAll($query, array($_COOKIE["user_uid"]));
     foreach ($Fetch_my as $key => $value) {
         # code...
         $channal_list[] = $value["id"];
@@ -71,7 +71,7 @@ if (isset($_COOKIE["userid"])) {
     # 找协作的
     $Fetch_coop = array();
     $query = "SELECT channal_id FROM cooperation WHERE  user_id = ? ";
-    $coop_channal = PDO_FetchAll($query, array($_COOKIE["userid"]));
+    $coop_channal = PDO_FetchAll($query, array($_COOKIE["user_uid"]));
     if (count($coop_channal) > 0) {
         foreach ($coop_channal as $key => $value) {
             # code...

+ 3 - 3
app/term/term.php

@@ -97,7 +97,7 @@ switch ($op) {
     case "my":
         {
             $query = "select guid,word,meaning,other_meaning,language from term  where owner= ? ";
-            $Fetch = PDO_FetchAll($query, array($_COOKIE["userid"]));
+            $Fetch = PDO_FetchAll($query, array($_COOKIE["user_uid"]));
             $iFetch = count($Fetch);
             if ($iFetch > 0) {
                 echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
@@ -150,7 +150,7 @@ switch ($op) {
             //查本人数据
             echo "<div></div>"; //My Term
             $query = "select * from term  where word = ? AND  owner = ? limit 0,30";
-            $Fetch = PDO_FetchAll($query, array($word, $_COOKIE["userid"]));
+            $Fetch = PDO_FetchAll($query, array($word, $_COOKIE["user_uid"]));
             $iFetch = count($Fetch);
             if ($iFetch > 0) {
                 for ($i = 0; $i < $iFetch; $i++) {
@@ -237,7 +237,7 @@ switch ($op) {
             //查他人数据
             $query = "SELECT * FROM term  WHERE word = ? AND owner <> ? LIMIT 0,30";
 
-            $Fetch = PDO_FetchAll($query, array($word, $_COOKIE["userid"]));
+            $Fetch = PDO_FetchAll($query, array($word, $_COOKIE["user_uid"]));
             $iFetch = count($Fetch);
             if ($iFetch > 0) {
                 for ($i = 0; $i < $iFetch; $i++) {

+ 1 - 1
app/term/term_channel_get.php

@@ -91,7 +91,7 @@ if (isset($_POST["words"])) {
             $userinfo = new UserInfo();
             foreach ($fetch as $key => $value) {
 				# code...
-				if($value["owner"]==$_COOKIE["userid"]){
+				if($value["owner"]==$_COOKIE["user_uid"]){
 					$fetch[$key]["readonly"]=false;
 				}
 				else{

+ 1 - 1
app/term/term_get.php

@@ -89,7 +89,7 @@ if (isset($_POST["words"])) {
             $userinfo = new UserInfo();
             foreach ($fetch as $key => $value) {
 				# code...
-				if($value["owner"]==$_COOKIE["userid"]){
+				if($value["owner"]==$_COOKIE["user_uid"]){
 					$fetch[$key]["readonly"]=false;
 				}
 				else{

+ 4 - 4
app/term/term_post.php

@@ -10,7 +10,7 @@ require_once "../redis/function.php";
 $redis = redis_connect();
 
 #未登录不能修改
-if (isset($_COOKIE["userid"]) == false) {
+if (isset($_COOKIE["user_uid"]) == false) {
     $respond['status'] = 1;
     $respond['message'] = "not yet log in";
     echo json_encode($respond, JSON_UNESCAPED_UNICODE);
@@ -28,7 +28,7 @@ if ($_POST["id"] != "") {
 	#先查询是否有权限
 	$query = "SELECT id from term where guid= ? and owner = ? ";
 	$stmt = $PDO->prepare($query);
-	$stmt->execute(array($_POST["id"],$_COOKIE["userid"]));
+	$stmt->execute(array($_POST["id"],$_COOKIE["user_uid"]));
 	if ($stmt) {
 		$Fetch = $stmt->fetch(PDO::FETCH_ASSOC);
 		if(!$Fetch){
@@ -49,7 +49,7 @@ if ($_POST["id"] != "") {
         					  mTime(),
         					  mTime(),
         					  $_POST["id"],
-        					  $_COOKIE["userid"],
+        					  $_COOKIE["user_uid"],
     ));
     if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
         $error = PDO_ErrorInfo();
@@ -88,7 +88,7 @@ if ($_POST["id"] != "") {
     $parm[] = $_POST["channal"];
     $parm[] = $_POST["language"];
     $parm[] = $_POST["note"];
-    $parm[] = $_COOKIE["userid"];
+    $parm[] = $_COOKIE["user_uid"];
     $parm[] = 0;
     $parm[] = mTime();
     $parm[] = mTime();

+ 1 - 1
app/term/term_put.php

@@ -30,7 +30,7 @@
 			$parm[]=$_GET["channal"];			
 			$parm[]=$_GET["language"];			
 			$parm[]=$_GET["note"];
-			$parm[]=$_COOKIE["userid"];
+			$parm[]=$_COOKIE["user_uid"];
 			$parm[]=0;
 			$parm[]=mTime();
 			$parm[]=mTime();

+ 6 - 6
app/ucenter/active.php

@@ -10,7 +10,7 @@ function add_edit_event($type = 0, $data = null)
     define("MAX_INTERVAL", 600000);
     define("MIN_INTERVAL", 60000);
 
-    if (isset($_COOKIE["userid"])) {
+    if (isset($_COOKIE["user_uid"])) {
         $dns = "" . _FILE_DB_USER_ACTIVE_;
         $dbh = new PDO($dns, "", "", array(PDO::ATTR_PERSISTENT => true));
         $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
@@ -18,7 +18,7 @@ function add_edit_event($type = 0, $data = null)
         // 查询上次编辑活跃结束时间
         $query = "SELECT id, end, start,hit  FROM edit WHERE user_id = ? order by end DESC";
         $stmt = $dbh->prepare($query);
-        $stmt->execute(array($_COOKIE["userid"]));
+        $stmt->execute(array($_COOKIE["user_uid"]));
         $row = $stmt->fetch(PDO::FETCH_ASSOC);
         $new_record = false;
         $currTime = mTime();
@@ -53,7 +53,7 @@ function add_edit_event($type = 0, $data = null)
             $query = "INSERT INTO edit ( user_id, start , end  , duration , hit , timezone )  VALUES  ( ? , ? , ? , ? , ? ,?) ";
             $sth = $dbh->prepare($query);
             #最小思考时间
-            $sth->execute(array($_COOKIE["userid"], ($currTime - MIN_INTERVAL), $currTime, MIN_INTERVAL, 1, $client_timezone));
+            $sth->execute(array($_COOKIE["user_uid"], ($currTime - MIN_INTERVAL), $currTime, MIN_INTERVAL, 1, $client_timezone));
             if (!$sth || ($sth && $sth->errorCode() != 0)) {
                 $error = $dbh->errorInfo();
             }
@@ -78,7 +78,7 @@ function add_edit_event($type = 0, $data = null)
         #查询是否存在
         $query = "SELECT id,duration,hit  FROM active_index WHERE user_id = ? and date = ?";
         $sth = $dbh->prepare($query);
-        $sth->execute(array($_COOKIE["userid"], $client_date));
+        $sth->execute(array($_COOKIE["user_uid"], $client_date));
         $row = $sth->fetch(PDO::FETCH_ASSOC);
         if ($row) {
             #更新
@@ -97,7 +97,7 @@ function add_edit_event($type = 0, $data = null)
             $query = "INSERT INTO active_index ( user_id, date , duration , hit )  VALUES  ( ? , ? , ? , ?  ) ";
             $sth = $dbh->prepare($query);
             #最小思考时间
-            $sth->execute(array($_COOKIE["userid"], $client_date, MIN_INTERVAL, 1));
+            $sth->execute(array($_COOKIE["user_uid"], $client_date, MIN_INTERVAL, 1));
             if (!$sth || ($sth && $sth->errorCode() != 0)) {
                 $error = $dbh->errorInfo();
             }
@@ -112,7 +112,7 @@ function add_edit_event($type = 0, $data = null)
 
             $query = "INSERT INTO log ( user_id, active , content , time , timezone )  VALUES  ( ? , ? , ? , ? ,? ) ";
             $sth = $dbh_log->prepare($query);
-            $sth->execute(array($_COOKIE["uid"], $type, $data, $currTime, $client_timezone));
+            $sth->execute(array($_COOKIE["user_id"], $type, $data, $currTime, $client_timezone));
             if (!$sth || ($sth && $sth->errorCode() != 0)) {
                 $error = $dbh->errorInfo();
             }

+ 2 - 2
app/ucenter/active_get.php

@@ -6,8 +6,8 @@ require_once "../public/function.php";
 $output = array();
 if (isset($_GET["userid"])) {
     $userid = $_GET["userid"];
-} else if (isset($_COOKIE["userid"])) {
-    $userid = $_COOKIE["userid"];
+} else if (isset($_COOKIE["user_uid"])) {
+    $userid = $_COOKIE["user_uid"];
 } else {
     exit;
 }

+ 2 - 2
app/ucenter/active_log_get.php

@@ -2,14 +2,14 @@
 //显示log
 require_once '../path.php';
 
-if (isset($_COOKIE["uid"]) && isset($_GET["start"]) && isset($_GET["end"])) {
+if (isset($_COOKIE["user_id"]) && isset($_GET["start"]) && isset($_GET["end"])) {
 
     $dns = "" . _FILE_DB_USER_ACTIVE_LOG_;
     $dbh = new PDO($dns, "", "", array(PDO::ATTR_PERSISTENT => true));
     $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
     $query = "SELECT time , active,content,timezone  FROM log WHERE user_id = ? AND (time BETWEEN ? AND ?) ";
     $stmt = $dbh->prepare($query);
-    $stmt->execute(array($_COOKIE["uid"], $_GET["start"], $_GET["end"]));
+    $stmt->execute(array($_COOKIE["user_id"], $_GET["start"], $_GET["end"]));
     $row = $stmt->fetchAll(PDO::FETCH_ASSOC);
     echo json_encode($row, JSON_UNESCAPED_UNICODE);
 } else {

+ 2 - 2
app/ucenter/active_log_list.php

@@ -6,7 +6,7 @@ require_once '../path.php';
 require_once "../public/function.php";
 require_once "../public/php/define.php";
 
-if (isset($_COOKIE["uid"])) {
+if (isset($_COOKIE["user_id"])) {
 
     $active_type[10] = "_CHANNEL_EDIT_";
     $active_type[11] = "_CHANNEL_NEW_";
@@ -27,7 +27,7 @@ if (isset($_COOKIE["uid"])) {
     $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
     $query = "SELECT time,active,content,timezone  FROM log WHERE user_id = ? ";
     $stmt = $dbh->prepare($query);
-    $stmt->execute(array($_COOKIE["uid"]));
+    $stmt->execute(array($_COOKIE["user_id"]));
     echo "<table>";
 
     while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {

+ 178 - 116
app/ucenter/index.php

@@ -3,42 +3,54 @@ require_once '../path.php';
 require_once "../public/load_lang.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
+require_once "../redis/function.php";
 
-if (isset($_GET["op"])) {
-    $op = $_GET["op"];
+
+if (isset($_REQUEST["op"])) {
+    $op = $_REQUEST["op"];
 } else {
     $op = "login";
 }
 
 switch ($op) {
     case "login":
-        {
-            if (isset($_GET["url"])) {
-                $goto_url = $_GET["url"];
-            }
-            break;
-        }
+		if (isset($_GET["url"])) {
+			$goto_url = $_GET["url"];
+		}
+		break;
     case "logout":
-        {
-            if (isset($_COOKIE["nickname"])) {
-                $message_comm = $_local->gui->user . " " . $_COOKIE["nickname"] . " " . $_local->gui->loged_out;
-            }
-            setcookie("uid", "", time() - 60, "/");
-            setcookie("username", "", time() - 60, "/");
-            setcookie("userid", "", time() - 60, "/");
-            setcookie("nickname", "", time() - 60, "/");
-            setcookie("email", "", time() - 60, "/");
-            break;
-        }
+		if (isset($_COOKIE["username"])) {
+			$message_comm = $_local->gui->user . " " . $_COOKIE["username"] . " " . $_local->gui->loged_out;
+		}
+		setcookie("user_uid", "", time() - 60, "/");
+		setcookie("user_id", "", time() - 60, "/");
+
+		setcookie("uid", "", time() - 60, "/");
+		setcookie("username", "", time() - 60, "/");
+		setcookie("userid", "", time() - 60, "/");
+		break;
     case "new":
-        {
-            $host = $_SERVER['HTTP_HOST'];
-            if (strpos($host, "wikipali.org") !== false) {
-                echo "网站正处于开发阶段。目前不支持注册。";
-                exit;
-            }
-            break;
-        }
+		$host = $_SERVER['HTTP_HOST'];
+		//if (strpos($host, "wikipali.org") !== false) 
+		{
+			if(isset($_REQUEST["invite"])){
+				$redis = redis_connect();
+				if ($redis == false) {
+					echo "no redis connect\n";
+					exit;
+				}
+				$code = $redis->exists("invitecode://".$_REQUEST["invite"]);
+				if(!$code){
+					echo "无效的邀请码,或邀请码已经过期。";
+					exit;
+				}
+				$invite_email = $redis->get("invitecode://".$_REQUEST["invite"]);
+			}else{
+				echo "无邀请码";
+				exit;	
+			}
+		}
+		break;
 }
 
 $post_nickname = "";
@@ -46,55 +58,73 @@ $post_username = "";
 $post_password = "";
 $post_email = "";
 if (isset($_POST["op"]) && $_POST["op"] == "new") {
+	PDO_Connect( _FILE_DB_USERINFO_);
+	//建立账号
     $op = "new";
-    $post_username = $_POST["username"];
-    $post_password = $_POST["password"];
-    $post_nickname = $_POST["nickname"];
-    $post_email = $_POST["email"];
+    $post_username = trim($_POST["username"]);
+    $post_password = trim($_POST["password"]);
+    $post_nickname = trim($_POST["nickname"]);
+    $post_email = trim($_POST["email"]);
+	$post_error = false;
     if (empty($post_username)) {
         $error_username = $_local->gui->account . $_local->gui->cannot_empty;
+		$post_error = true;
     }
+	else{
+        $query = "select count(*) as co from user where username = ?" ;
+        $iFetch = PDO_FetchOne($query,array($post_username));
+        if ($iFetch > 0) { //username is existed
+            $error_username = $_local->gui->account_existed;
+			$post_error = true;
+        }
+	}
+	if (empty($post_email)) {
+        $error_email = $_local->gui->email . $_local->gui->cannot_empty;
+		$post_error = true;
+    }else{
+		$query = "select count(*) as co from user where email = ?" ;
+		$iFetch = PDO_FetchOne($query,array($post_email));
+		if ($iFetch > 0) { //username is existed
+			$error_email = $_local->gui->email . "已经存在";
+			$post_error = true;
+		} 
+	}
     if (empty($post_password)) {
         $error_password = $_local->gui->password . $_local->gui->cannot_empty;
-    }
+		$post_error = true;
+    }else{
+		if(strlen($post_password)<6){
+			$error_password = $_local->gui->password . "过短";
+			$post_error = true;
+		}
+	}
+
     if (empty($post_nickname)) {
         $error_nickname = $_local->gui->nick_name . $_local->gui->cannot_empty;
+		$post_error = true;
     }
-    if (!empty($post_username) && !empty($post_password) && !empty($post_nickname)) {
+
+    if (!$post_error) {
         $md5_password = md5($post_password);
         $new_userid = UUID::v4();
-        PDO_Connect("" . _FILE_DB_USERINFO_);
-        $query = "select * from user where \"username\"=" . $PDO->quote($post_username);
-        $Fetch = PDO_FetchAll($query);
-        $iFetch = count($Fetch);
-        if ($iFetch > 0) { //username is existed
-            $error_username = $_local->gui->account_existed;
-        } else {
-            $query = "INSERT INTO user ('id','userid','username','password','nickname','email') VALUES (NULL," . $PDO->quote($new_userid) . "," . $PDO->quote($post_username) . "," . $PDO->quote($md5_password) . "," . $PDO->quote($post_nickname) . "," . $PDO->quote($post_email) . ")";
-            $stmt = @PDO_Execute($query);
-            if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
-                $error = PDO_ErrorInfo();
-                $error_comm = $error[2] . "抱歉!请再试一次";
-            } else {
-                //created user recorder
-                $newUserPath = _DIR_USER_DOC_ . '/' . $new_userid;
-                $userDirMyDocument = $newUserPath . _DIR_MYDOCUMENT_;
-                if (!file_exists($newUserPath)) {
-                    if (mkdir($newUserPath)) {
-                        mkdir($userDirMyDocument);
-                    } else {
-                        $error_comm = "建立用户目录失败,请联络网站管理员。";
-                    }
-                }
-                $message_comm = "新账户建立成功";
-                $op = "login";
-                unset($_POST["username"]);
-            }
-        }
-    } else {
+ 
+				$query = "INSERT INTO user ('id','userid','username','password','nickname','email') VALUES (NULL," . $PDO->quote($new_userid) . "," . $PDO->quote($post_username) . "," . $PDO->quote($md5_password) . "," . $PDO->quote($post_nickname) . "," . $PDO->quote($post_email) . ")";
+				$stmt = @PDO_Execute($query);
+				if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
+					$error = PDO_ErrorInfo();
+					$error_comm = $error[2] . "系统错误,抱歉!请再试一次";
+				} else {
+					$message_comm = "新账户建立成功";
+					$op = "login";
+					unset($_POST["username"]);
+					//TODO create channel
+					
+					//TODO create studio
+				}
 
     }
 } else {
+	//登录
     if (isset($_POST["username"])) {
         $_username_ok = true;
         if ($_POST["username"] == "") {
@@ -106,41 +136,46 @@ if (isset($_POST["op"]) && $_POST["op"] == "new") {
             $query = "select * from user where (\"username\"=" . $PDO->quote($_POST["username"]) . " or \"email\"=" . $PDO->quote($_POST["username"]) . " ) and \"password\"=" . $PDO->quote($md5_password);
             $Fetch = PDO_FetchAll($query);
             $iFetch = count($Fetch);
-            if ($iFetch > 0) { //username is exite
+            if ($iFetch > 0) { 
+				//username is exite
                 $uid = $Fetch[0]["id"];
                 $username = $Fetch[0]["username"];
-                $userid = $Fetch[0]["userid"];
+                $user_uuid = $Fetch[0]["userid"];
                 $nickname = $Fetch[0]["nickname"];
                 $email = $Fetch[0]["email"];
-                setcookie("uid", $uid, time() + 60 * 60 * 24 * 365, "/");
+				$ExpTime = time() + 60 * 60 * 24 * 365;
+				if(empty($_SERVER["HTTPS"])){
+					setcookie("user_uid", $user_uuid,["expires"=>$ExpTime,"path"=>"/","secure"=>false,"httponly"=>true]);
+					setcookie("user_id", $Fetch[0]["id"], ["expires"=>$ExpTime,"path"=>"/","secure"=>false,"httponly"=>true]);
+				}else{
+					setcookie("user_uid", $user_uuid, ["expires"=>$ExpTime,"path"=>"/","secure"=>true,"httponly"=>true]);
+					setcookie("user_id", $Fetch[0]["id"], ["expires"=>$ExpTime,"path"=>"/","secure"=>true,"httponly"=>true]);
+				}
+				#给js用的
                 setcookie("username", $username, time() + 60 * 60 * 24 * 365, "/");
-                setcookie("userid", $userid, time() + 60 * 60 * 24 * 365, "/");
-                setcookie("nickname", $nickname, time() + 60 * 60 * 24 * 365, "/");
-                setcookie("email", $email, time() + 60 * 60 * 24 * 365, "/");
+                setcookie("userid", $user_uuid, time() + 60 * 60 * 24 * 365, "/");
                 if (isset($_POST["url"])) {
                     $goto_url = $_POST["url"];
                 }
+				#设置新密码
                 if (isset($_COOKIE["url"])) {
                     setcookie("pwd_set", "on", time() + 60, "/");
                 }
-                $newUserPath = _DIR_USER_DOC_ . '/' . $userid . '/';
-                if (!file_exists($newUserPath)) {
-                    echo "error:cannot find user dir:$newUserPath<br/>";
-                }
                 ?>
 
+
 <!DOCTYPE html>
 <html>
 	<head>
 
 		<title>wikipali starting</title>
 		<?php
-if (isset($goto_url)) {
+		if (isset($goto_url)) {
                     $goto = $goto_url;
                 } else {
                     $goto = "../studio/index.php";
                 }
-                ?>
+            ?>
 		<meta http-equiv="refresh" content="0,<?php echo $goto; ?>"/>
 	</head>
 
@@ -155,13 +190,14 @@ if (isset($goto_url)) {
 
                 exit;
             } else {
+				//用户名不存在
                 $_post_error = $_local->gui->incorrect_ID_PASS;
             }
         }
     }
 }
 ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
 <html>
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
@@ -319,10 +355,7 @@ require_once '../lang/lang.php';
 		<div id = "login_form_div" class="fun_block" >
 
 		<?php
-$host = $_SERVER['HTTP_HOST'];
-if (strpos($host, "wikipali.org") !== false) {
-    echo "网站正处于开发阶段。目前不支持注册。";
-}
+
 if (isset($error_comm)) {
     echo '<div class="form_error">';
     echo $error_comm;
@@ -344,63 +377,90 @@ if ($op == "new") {
 			<div class="login_form" style="    padding: 3em 0 3em 0;">
 			<form action="index.php" method="post">
 				<div>
+
 				<div>
-				    <span id='tip_nickname' class='form_field_name'><?php echo $_local->gui->nick_name; ?></span>
-					<input type="input" name="nickname" value="<?php echo $nickname; ?>" />
-				</div>
-					<div class="form_help">
-						<?php echo $_local->gui->name_for_show; ?>
+						<span id='tip_username' class='form_field_name'><?php echo $_local->gui->account; ?></span>
+						<input type="input" name="username"  value="<?php echo $post_username; ?>" />
 					</div>
-
-					<div id="error_nickname" class="form_error">
-						<?php
-if (isset($error_nickname)) {echo $error_nickname;}
-    ?>
+					<div id="error_username" class="form_error">
+					<?php
+					if (isset($error_username)) {echo $error_username;}
+					?>
 					</div>
-					<div>
-					<select name="language" style="width: 100%;">
-						<option><?php echo $_local->language->en; ?></option>
-						<option><?php echo $_local->language->zh_cn; ?></option>
-						<option><?php echo $_local->language->zh_tw; ?></option>
-						<option><?php echo $_local->language->my; ?></option>
-						<option><?php echo $_local->language->si; ?></option>
-					</select>
+					<div class="form_help">
+						<?php echo $_local->gui->account_demond; ?>
 					</div>
 
 					<div>
 						<span id='tip_email' class='form_field_name'><?php echo $_local->gui->email_address; ?></span>
 						<input type="input" name="email"  value="<?php echo $post_email; ?>" />
-					</div>
-
-					<div>
-						<span id='tip_username' class='form_field_name'><?php echo $_local->gui->account; ?></span>
-						<input type="input" name="username"  value="<?php echo $post_username; ?>" />
-					</div>
-
-					<div id="error_username" class="form_error">
+						<div id="error_email" class="form_error">
 						<?php
-if (isset($error_username)) {echo $error_username;}
-    ?>
+						if (isset($error_email)) {echo $error_email;}
+						?>
+						</div>
 					</div>
 
-					<div class="form_help">
-						<?php echo $_local->gui->account_demond; ?>
-					</div>
 					<div>
 						<span id='tip_password' class='form_field_name'><?php echo $_local->gui->password; ?></span>
-						<input type="password" name="password"  value="<?php echo $post_password; ?>" />
-						<input type="password" name="repassword"  value="<?php echo $post_password; ?>" />
+						<input type="password" name="password" placeholder="密码" value="<?php echo $post_password; ?>" />
+						<input type="password" name="repassword" placeholder="再次输入密码" value="<?php echo $post_password; ?>" />
 					</div>
 					<div class="form_help">
 					<?php echo $_local->gui->password_demond; ?>
 					</div>
-
 					<div id="error_password" class="form_error">
 					<?php
-if (isset($error_password)) {echo $error_password;}
-    ?>
+					if (isset($error_password)) {echo $error_password;}
+					?>
+					</div>
+
+					<div>
+
+						<span id='tip_language' class='viewswitch_on'><?php echo "惯常使用的语言"; ?></span>
+						<select 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>
+						<span id='tip_nickname' class='form_field_name'><?php echo $_local->gui->nick_name; ?></span>
+						<input type="input" name="nickname" value="<?php echo $post_nickname; ?>" />
+					</div>
+					<?php
+						if (isset($error_nickname)) {
+							echo '<div id="error_nickname" class="form_error">';
+							echo $error_nickname;
+							echo '</div>';
+						}
+						else{
+							echo '<div class="form_help">';
+							echo $_local->gui->name_for_show;
+							echo '</div>';
+
+						}
+					?>
+
 					<input type="hidden" name="op" value="new" />
+					<input type="hidden" name="invite" value="<?php echo $_REQUEST["invite"]; ?>" />
 				</div>
 				<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);" />
@@ -464,7 +524,8 @@ if (isset($goto_url)) {
 				</div>
 				</form>
 			</div>
-			<div id="login_shortcut">
+
+			<div id="login_shortcut" style="display:none;">
 				<button class="form_help"><?php echo $_local->gui->login_with_google; ?>&nbsp;
 					<svg class="icon">
 						<use xlink:href="../studio/svg/icon.svg#google_logo"></use>
@@ -481,6 +542,7 @@ if (isset($goto_url)) {
 					</svg>
 				</button>
 			</div>
+
 			<?php
 }
 ?>

+ 3 - 3
app/ucenter/login.php

@@ -10,13 +10,13 @@
  $NICK_NAME = "";
 if(isset($_COOKIE["username"]) && !empty($_COOKIE["username"])){
 //已经登陆
- $USER_ID = $_COOKIE["userid"];
- $UID = $_COOKIE["uid"];
+ $USER_ID = $_COOKIE["user_id"];
+ $UID = $_COOKIE["user_uid"];
  $USER_NAME = $_COOKIE["username"];
  $NICK_NAME = $_COOKIE["nickname"];
  
  $username = $_COOKIE["username"];
- $userid = $_COOKIE["userid"];
+ $userid = $_COOKIE["user_id"];
  $nickname = $_COOKIE["nickname"];
  if(isset($_COOKIE["email"])){$email = $_COOKIE["email"];}
 }

+ 2 - 2
app/ucenter/pwd_set.php

@@ -2,7 +2,7 @@
 require_once '../path.php';
 require_once "../public/load_lang.php";
 
-if (!isset($_COOKIE["userid"])) {
+if (!isset($_COOKIE["user_uid"])) {
     echo "尚未登陆<a href='index.php'>登陆</a>";
 } else {
     if (isset($_POST["pwd_set"])) {
@@ -12,7 +12,7 @@ if (!isset($_COOKIE["userid"])) {
             $PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
             $query = "UPDATE user SET password = ? WHERE userid = ? ";
             $stmt = $PDO->prepare($query);
-            $stmt->execute(array($md5_password, $_COOKIE["userid"]));
+            $stmt->execute(array($md5_password, $_COOKIE["user_uid"]));
             if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
                 $error = $PDO->errorInfo();
                 echo "修改密码失败。错误信息:$error";

+ 1 - 1
app/ucenter/set_setting.php

@@ -9,7 +9,7 @@ PDO_Connect("" . _FILE_DB_USERINFO_);
 $query = "UPDATE user SET  setting = ? where  userid = ?  ";
 $sth = $PDO->prepare($query);
 
-$sth->execute(array($_POST["data"], $_COOKIE["userid"]));
+$sth->execute(array($_POST["data"], $_COOKIE["user_uid"]));
 $respond = array("status" => 0, "message" => "");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
     $error = PDO_ErrorInfo();

+ 1 - 1
app/ucenter/setting.php

@@ -66,7 +66,7 @@ require_once '../public/function.php';
 </head>
 <body class="reader_body" >
 <?php
-if(!isset($_COOKIE["userid"])){
+if(!isset($_COOKIE["user_uid"])){
     echo "请您先登陆";
     exit;
 }

+ 2 - 2
app/ucenter/setting_function.php

@@ -3,7 +3,7 @@ require_once '../path.php';
 function get_setting()
 {
 
-    if (!isset($_COOKIE["userid"])) {
+    if (!isset($_COOKIE["user_uid"])) {
         $setting = json_decode(file_get_contents("../ucenter/default.json"), true);
     } else {
         $setting = json_decode(file_get_contents("../ucenter/default.json"), true);
@@ -14,7 +14,7 @@ function get_setting()
 
         $query = "select setting from user where userid = ? ";
         $stmt = $dbh->prepare($query);
-        $stmt->execute(array($_COOKIE["userid"]));
+        $stmt->execute(array($_COOKIE["user_uid"]));
         $fUser = $stmt->fetchAll(PDO::FETCH_ASSOC);
         $dbh = null;
         if (isset($fUser[0]["setting"])) {

+ 2 - 2
app/ucenter/user.php

@@ -71,7 +71,7 @@
 <div class="dropdown" onmouseover="switchMenu(this,'user_info')" onmouseout="hideMenu()">
 
 	<?php
-	if (isset($_COOKIE["userid"])) {
+	if (isset($_COOKIE["user_uid"])) {
 	?>
 		<button class="dropbtn icon_btn" onClick="switchMenu(this,'user_info')" id="use_mode">
 			<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="ic_user_32px">
@@ -93,7 +93,7 @@
 						?>
 					</span>
 				</a>
-				<a href='../uhome/index.php?userid=<?php echo $_COOKIE["userid"]; ?>'>
+				<a href='../uhome/index.php?userid=<?php echo $_COOKIE["user_uid"]; ?>'>
 					<svg class="icon">
 						<use xlink:href="../studio/svg/icon.svg#my_zone"></use>
 					</svg>

+ 2 - 2
app/uhome/foot_step.php

@@ -2,8 +2,8 @@
 if(isset($_GET["userid"])){
 	$foot_set_userid = $_GET["userid"];
 }
-else if(isset($_COOKIE["userid"])){
-	$foot_set_userid = $_COOKIE["userid"];
+else if(isset($_COOKIE["user_uid"])){
+	$foot_set_userid = $_COOKIE["user_uid"];
 }
 else{
 	echo "no user id";

+ 4 - 4
app/uhome/head.php

@@ -103,16 +103,16 @@
 					</li>
 					<li>
 					<?php 
-						if(isset($_GET["userid"]) && isset($_COOKIE["userid"]) ){
-							if($_COOKIE["userid"]==$_GET["userid"]){
+						if(isset($_GET["userid"]) && isset($_COOKIE["user_uid"]) ){
+							if($_COOKIE["user_uid"]==$_GET["userid"]){
 								$id = $_GET["userid"];
 							}
 							else{
 								$id=false;
 							}
 						}
-						else if(isset($_COOKIE["userid"])){
-							$id=$_COOKIE["userid"];
+						else if(isset($_COOKIE["user_uid"])){
+							$id=$_COOKIE["user_uid"];
 						}
 						else{
 							$id = false;

+ 1 - 1
app/usent/function.php

@@ -108,7 +108,7 @@ class SentPr{
 		if ($this->dbh_sent) {
             $query = "UPDATE sent_pr set text=? ,modify_time=?  WHERE id = ? and editor= ? ";
             $stmt = $this->dbh_sent->prepare($query);
-            $stmt->execute(array($text,mTime(),$id,$_COOKIE["userid"]));
+            $stmt->execute(array($text,mTime(),$id,$_COOKIE["user_uid"]));
             
 			if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
 				/*  识别错误  */

+ 3 - 3
app/usent/get.php

@@ -14,17 +14,17 @@ $redis = redis_connect();
 
 #查询有阅读权限的channel
 $channal_list = array();
-if (isset($_COOKIE["userid"])) {
+if (isset($_COOKIE["user_uid"])) {
     PDO_Connect(_FILE_DB_CHANNAL_);
     $query = "SELECT id from channal where owner = ?   limit 0,100";
-    $Fetch_my = PDO_FetchAll($query, array($_COOKIE["userid"]));
+    $Fetch_my = PDO_FetchAll($query, array($_COOKIE["user_uid"]));
     foreach ($Fetch_my as $key => $value) {
         # code...
         $channal_list[] = $value["id"];
     }
 
     # 找协作的
-	$coop_channal = share_res_list_get($_COOKIE["userid"],2);
+	$coop_channal = share_res_list_get($_COOKIE["user_uid"],2);
 	foreach ($coop_channal as $key => $value) {
 		# code...
 		$channal_list[] = $value["res_id"];

+ 2 - 2
app/usent/get_pr.php

@@ -19,8 +19,8 @@ foreach ($result as $key => $value) {
 	$result[$key]["para"]=$value["paragraph"];
 	$result[$key]["channalinfo"] = $channel_info->getChannal($value["channel"]);
 	$result[$key]["mypower"] = $channel_info->getPower($value["channel"]);
-	if(isset($_COOKIE["userid"])){
-		if($value["editor"]==$_COOKIE["userid"]){
+	if(isset($_COOKIE["user_uid"])){
+		if($value["editor"]==$_COOKIE["user_uid"]){
 			$result[$key]["is_pr_editor"] =true;
 		}
 		else{

+ 2 - 2
app/usent/new_block.php

@@ -17,8 +17,8 @@ $query = "INSERT INTO sent_block ('id','book','paragraph','owner','lang','author
 $sth = $PDO->prepare($query);
 
 foreach ($aData as $data) {
-    if (isset($_COOKIE["userid"])) {
-        $userid = $_COOKIE["userid"];
+    if (isset($_COOKIE["user_uid"])) {
+        $userid = $_COOKIE["user_uid"];
     } else {
         $userid = $data->userid;
     }

+ 1 - 1
app/usent/pr_post.php

@@ -14,7 +14,7 @@ $respond['begin'] = $_POST["begin"];
 $respond['end'] = $_POST["end"];
 $respond['channal'] = $_POST["channel"];
 $respond['text'] = $_POST["text"];
-$respond['editor'] = $_COOKIE["userid"];
+$respond['editor'] = $_COOKIE["user_uid"];
 $respond['commit_type'] = 1;
 
 $redis = redis_connect();

+ 10 - 10
app/usent/sent_post.php

@@ -8,7 +8,7 @@ require_once "../ucenter/active.php";
 require_once "../share/function.php";
 
 #检查是否登陆
-if (!isset($_COOKIE["userid"])) {
+if (!isset($_COOKIE["user_uid"])) {
     $respond["status"] = 1;
     $respond["message"] = 'not login';
     echo json_encode($respond, JSON_UNESCAPED_UNICODE);
@@ -28,7 +28,7 @@ $respond['begin'] = $_POST["begin"];
 $respond['end'] = $_POST["end"];
 $respond['channal'] = $_POST["channal"];
 $respond['text'] = $_POST["text"];
-$respond['editor'] = $_COOKIE["userid"];
+$respond['editor'] = $_COOKIE["user_uid"];
 $respond['commit_type'] = 0; #0 未提交 1 插入 2 修改 3pr 
 
 add_edit_event(_SENT_EDIT_, "{$_POST["book"]}-{$_POST["para"]}-{$_POST["begin"]}-{$_POST["end"]}@{$_POST["channal"]}");
@@ -47,11 +47,11 @@ if (isset($_POST["channal"])) {
 		$channel_status = $fetch["status"];
     }
     $respond['lang'] = $text_lang;
-    if ($fetch && $fetch["owner"] == $_COOKIE["userid"]) {
+    if ($fetch && $fetch["owner"] == $_COOKIE["user_uid"]) {
         #自己的channal
         $cooperation = 30;
     } else {
-		$sharePower = share_get_res_power($_COOKIE["userid"],$_POST["channal"]);
+		$sharePower = share_get_res_power($_COOKIE["user_uid"],$_POST["channal"]);
 		$cooperation = $sharePower;
 		if($channel_status>=30 && $cooperation<10){
 			#全网公开的 可以提交pr
@@ -119,7 +119,7 @@ if ($_id == false) {
             $_POST["channal"],
             "",
             "[]",
-            $_COOKIE["userid"],
+            $_COOKIE["user_uid"],
             $_POST["text"],
             $text_lang,
             1,
@@ -141,7 +141,7 @@ if ($_id == false) {
             # 更新historay
 			#没错误 更新历史记录
 			$respond['commit_type'] = 1;
-            $respond['message'] = update_historay($newId, $_COOKIE["userid"], $_POST["text"], $_landmark);
+            $respond['message'] = update_historay($newId, $_COOKIE["user_uid"], $_POST["text"], $_landmark);
             if ($respond['message'] !== "") {
                 $respond['status'] = 1;
                 echo json_encode($respond, JSON_UNESCAPED_UNICODE);
@@ -178,7 +178,7 @@ if ($_id == false) {
 							$_POST["channal"],
 							"",
 							"[]",
-							$_COOKIE["userid"],
+							$_COOKIE["user_uid"],
 							$_POST["text"],
 							$text_lang,
 							1,
@@ -210,7 +210,7 @@ if ($_id == false) {
         $stmt = PDO_Execute($query,
             array($_POST["text"],
                 mb_strlen($_POST["text"], "UTF-8"),
-                $_COOKIE["userid"],
+                $_COOKIE["user_uid"],
                 mTime(),
                 mTime(),
                 $_id));
@@ -224,7 +224,7 @@ if ($_id == false) {
         } else {
             #没错误 更新历史记录
 			$respond['commit_type'] = 2;
-            $respond['message'] = update_historay($_id, $_COOKIE["userid"], $_POST["text"], $_landmark);
+            $respond['message'] = update_historay($_id, $_COOKIE["user_uid"], $_POST["text"], $_landmark);
             if ($respond['message'] !== "") {
                 $respond['status'] = 1;
                 echo json_encode($respond, JSON_UNESCAPED_UNICODE);
@@ -262,7 +262,7 @@ if ($_id == false) {
 							$_POST["channal"],
 							"",
 							"[]",
-							$_COOKIE["userid"],
+							$_COOKIE["user_uid"],
 							$_POST["text"],
 							$text_lang,
 							1,

+ 3 - 3
app/usent/update.php

@@ -10,7 +10,7 @@ require_once "../channal/function.php";
 require_once "../ucenter/active.php";
 
 #检查是否登陆
-if (!isset($_COOKIE["userid"])) {
+if (!isset($_COOKIE["user_uid"])) {
     $respond["status"] = 1;
     $respond["message"] = 'not login';
     echo json_encode($respond, JSON_UNESCAPED_UNICODE);
@@ -83,7 +83,7 @@ if (count($oldList) > 0) {
     } else {
         #没错误 添加log 更新历史记录
         foreach ($oldList as $data) {
-            $respond['message'] = update_historay($data["id"], $_COOKIE["userid"], $data["text"], $_landmark);
+            $respond['message'] = update_historay($data["id"], $_COOKIE["user_uid"], $data["text"], $_landmark);
             if ($respond['message'] !== "") {
                 $respond['status'] = 1;
                 echo json_encode($respond, JSON_UNESCAPED_UNICODE);
@@ -154,7 +154,7 @@ if (count($newList) > 0) {
             $data["channal"],
             isset($data["tag"]) ? $data["tag"] : "",
             $data["author"],
-            $_COOKIE["userid"],
+            $_COOKIE["user_uid"],
             $data["text"],
             $lang,
             1,

+ 2 - 2
app/uwbw/create_wbw.php

@@ -90,7 +90,7 @@ foreach ($_para as $key => $para) {
         $block_data = array($block_id,
                                          "",
                                          $_channel,
-                                         $_COOKIE["userid"],
+                                         $_COOKIE["user_uid"],
                                          $_book,
                                          $para,
                                          "",
@@ -172,7 +172,7 @@ foreach ($_para as $key => $para) {
                                               mTime(),
                                               mTime(),
                                               1,
-                                              $_COOKIE["userid"]
+                                              $_COOKIE["user_uid"]
                                             );
         }
                 

+ 1 - 1
app/uwbw/update.php

@@ -98,7 +98,7 @@ if (count($aData) > 0) {
 									"my",
 									"none"
 					);
-					$redis->hSet("wbwdict://new/".$_COOKIE["userid"],$pali,json_encode($newword, JSON_UNESCAPED_UNICODE));
+					$redis->hSet("wbwdict://new/".$_COOKIE["user_uid"],$pali,json_encode($newword, JSON_UNESCAPED_UNICODE));
 				}
 			}
 

+ 3 - 3
app/uwbw/wbw_channel_list.php

@@ -11,7 +11,7 @@ $redis = redis_connect();
 $output["status"] = 0;
 $output["error"] = "";
 $output["data"] = "";
-if (!isset($_COOKIE["userid"])) {
+if (!isset($_COOKIE["user_uid"])) {
     $output["status"] = 1;
     $output["error"] = "#not_login";
     echo json_encode($output, JSON_UNESCAPED_UNICODE);
@@ -33,7 +33,7 @@ $channelList = array();
 
 PDO_Connect(_FILE_DB_CHANNAL_);
 $query = "SELECT id FROM channal WHERE owner = ? and status>0 LIMIT 0,100";
-$FetchChannal = PDO_FetchAll($query, array($_COOKIE["userid"]));
+$FetchChannal = PDO_FetchAll($query, array($_COOKIE["user_uid"]));
 
 foreach ($FetchChannal as $key => $value) {
 	# code...
@@ -41,7 +41,7 @@ foreach ($FetchChannal as $key => $value) {
 }
 
 # 找协作的
-$coop_channal =  share_res_list_get($_COOKIE["userid"],2);
+$coop_channal =  share_res_list_get($_COOKIE["user_uid"],2);
 foreach ($coop_channal as $key => $value) {
 	# return res_id,res_type,power res_title  res_owner_id
 	if(isset($channelList[$value["res_id"]])){