1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Fix user option email

This commit is contained in:
DanieL 2023-02-01 14:40:15 -03:00
parent b554406dc0
commit 0597fd692d
2 changed files with 23 additions and 3 deletions

View file

@ -1268,16 +1268,36 @@ if (typeof gtag !== \"function\") {
}
public function thisUserCanStream() {
global $advancedCustomUser;
global $advancedCustomUser, $_thisUserCanStreamReasonMessage;
$_thisUserCanStreamReasonMessage = '';
if(!empty($advancedCustomUser->unverifiedEmailsCanNOTLiveStream)){
if(!$this->isVerified()){
$_thisUserCanStreamReasonMessage = 'User Not verified';
return false;
}
}
if ($this->status === 'i') {
$_thisUserCanStreamReasonMessage = 'User status is inactive';
return false;
}
return !empty($this->isAdmin) || !empty($this->canStream);
$can = !empty($this->isAdmin) || !empty($this->canStream);
if(empty($can)){
$reasons = array();
if(empty($this->isAdmin)){
$reasons[] = 'User is not admin';
}
if(empty($this->canStream)){
$reasons[] = 'User cannot stream';
}
$_thisUserCanStreamReasonMessage = implode(', ', $reasons);
}
return $can;
}
static public function getLastUserCanStreamReason() {
global $_thisUserCanStreamReasonMessage;
return $_thisUserCanStreamReasonMessage;
}
private function find($user, $pass, $mustBeactive = false, $encodedPass = false) {

View file

@ -195,7 +195,7 @@ if (!empty($obj) && empty($obj->error)) {
}
//exit;
} else {
_error_log("NGINX ON Publish denied ". json_encode($obj), AVideoLog::$SECURITY);
_error_log("NGINX ON Publish denied ".User::getLastUserCanStreamReason().' '. json_encode($obj), AVideoLog::$SECURITY);
http_response_code(401);
header("HTTP/1.1 401 Unauthorized Error");
exit;