1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
This commit is contained in:
Daniel 2022-11-17 16:44:24 -03:00
parent 63ef10337e
commit cbd2e0c032
2 changed files with 11 additions and 2 deletions

View file

@ -195,7 +195,7 @@ if (empty($_POST['user']) || empty($_POST['pass'])) {
die(json_encode($object));
}
$user = new User(0, $_POST['user'], $_POST['pass']);
if(empty($user)){
if(!empty($user)){
_error_log("login.json.php user found");
}else{
_error_log("login.json.php user not found");

View file

@ -1262,7 +1262,7 @@ if (typeof gtag !== \"function\") {
}
private function find($user, $pass, $mustBeactive = false, $encodedPass = false) {
global $global, $advancedCustom;
global $global, $advancedCustom, $advancedCustomUser;
$formats = '';
$values = [];
$sql = "SELECT * FROM users WHERE user = ? ";
@ -1276,6 +1276,15 @@ if (typeof gtag !== \"function\") {
$sql .= " OR user = ? ";
}
if (
$advancedCustomUser->forceLoginToBeTheEmail &&
$advancedCustomUser->emailMustBeUnique &&
filter_var($user, FILTER_VALIDATE_EMAIL)) {
$formats .= "s";
$values[] = trim($user);
$sql .= " OR email = ? ";
}
if ($mustBeactive) {
$sql .= " AND status = 'a' ";
}