mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
update
This commit is contained in:
parent
63ef10337e
commit
cbd2e0c032
2 changed files with 11 additions and 2 deletions
|
@ -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");
|
||||
|
|
|
@ -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' ";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue