Переглянути джерело

支持 电子邮件登陆

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