소스 검색

支持 电子邮件登陆

visuddhinanda 5 년 전
부모
커밋
c4f1baaca2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/ucenter/index.php

+ 1 - 1
app/ucenter/index.php

@@ -109,7 +109,7 @@ require_once "../public/function.php";
 			else if(isset($_POST["password"])){
 				$md5_password=md5($_POST["password"]);
 				PDO_Connect("sqlite:"._FILE_DB_USERINFO_);
-				$query = "select * from user where \"username\"=".$PDO->quote($_POST["username"])." and \"password\"=".$PDO->quote($md5_password);
+				$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