1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00

Missing functions

This commit is contained in:
DanielnetoDotCom 2021-05-01 08:47:25 -03:00
parent 06273135e8
commit 0826de71b7
7 changed files with 76 additions and 33 deletions

48
composer.lock generated
View file

@ -387,16 +387,16 @@
}, },
{ {
"name": "google/auth", "name": "google/auth",
"version": "v1.15.0", "version": "v1.15.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/googleapis/google-auth-library-php.git", "url": "https://github.com/googleapis/google-auth-library-php.git",
"reference": "b346c07de6613e26443d7b4830e5e1933b830dc4" "reference": "4e0c9367719df9703e96f5ad613041b87742471c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/b346c07de6613e26443d7b4830e5e1933b830dc4", "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/4e0c9367719df9703e96f5ad613041b87742471c",
"reference": "b346c07de6613e26443d7b4830e5e1933b830dc4", "reference": "4e0c9367719df9703e96f5ad613041b87742471c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -410,7 +410,7 @@
"require-dev": { "require-dev": {
"guzzlehttp/promises": "0.1.1|^1.3", "guzzlehttp/promises": "0.1.1|^1.3",
"kelvinmo/simplejwt": "^0.2.5|^0.5.1", "kelvinmo/simplejwt": "^0.2.5|^0.5.1",
"phpseclib/phpseclib": "^2", "phpseclib/phpseclib": "^2.0.31",
"phpunit/phpunit": "^4.8.36|^5.7", "phpunit/phpunit": "^4.8.36|^5.7",
"sebastian/comparator": ">=1.2.3", "sebastian/comparator": ">=1.2.3",
"squizlabs/php_codesniffer": "^3.5" "squizlabs/php_codesniffer": "^3.5"
@ -438,9 +438,9 @@
"support": { "support": {
"docs": "https://googleapis.github.io/google-auth-library-php/master/", "docs": "https://googleapis.github.io/google-auth-library-php/master/",
"issues": "https://github.com/googleapis/google-auth-library-php/issues", "issues": "https://github.com/googleapis/google-auth-library-php/issues",
"source": "https://github.com/googleapis/google-auth-library-php/tree/v1.15.0" "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.15.1"
}, },
"time": "2021-02-05T20:50:04+00:00" "time": "2021-04-21T17:42:05+00:00"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
@ -570,16 +570,16 @@
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "1.8.1", "version": "1.8.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" "reference": "dc960a912984efb74d0a90222870c72c87f10c91"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
"reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", "reference": "dc960a912984efb74d0a90222870c72c87f10c91",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -639,9 +639,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/1.8.1" "source": "https://github.com/guzzle/psr7/tree/1.8.2"
}, },
"time": "2021-03-21T16:25:00+00:00" "time": "2021-04-26T09:17:50+00:00"
}, },
{ {
"name": "hybridauth/hybridauth", "name": "hybridauth/hybridauth",
@ -860,16 +860,16 @@
}, },
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
"version": "v2.0.19", "version": "v2.0.20",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/paragonie/random_compat.git", "url": "https://github.com/paragonie/random_compat.git",
"reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241" "reference": "0f1f60250fccffeaf5dda91eea1c018aed1adc2a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/446fc9faa5c2a9ddf65eb7121c0af7e857295241", "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0f1f60250fccffeaf5dda91eea1c018aed1adc2a",
"reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241", "reference": "0f1f60250fccffeaf5dda91eea1c018aed1adc2a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -910,20 +910,20 @@
"issues": "https://github.com/paragonie/random_compat/issues", "issues": "https://github.com/paragonie/random_compat/issues",
"source": "https://github.com/paragonie/random_compat" "source": "https://github.com/paragonie/random_compat"
}, },
"time": "2020-10-15T10:06:57+00:00" "time": "2021-04-17T09:33:01+00:00"
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.4.0", "version": "v6.4.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "050d430203105c27c30efd1dce7aa421ad882d01" "reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/050d430203105c27c30efd1dce7aa421ad882d01", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d",
"reference": "050d430203105c27c30efd1dce7aa421ad882d01", "reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -978,7 +978,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": { "support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues", "issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.0" "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.1"
}, },
"funding": [ "funding": [
{ {
@ -986,7 +986,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-03-31T20:06:42+00:00" "time": "2021-04-29T12:25:04+00:00"
}, },
{ {
"name": "phpseclib/phpseclib", "name": "phpseclib/phpseclib",

View file

@ -350,8 +350,7 @@ class YPTWallet extends PluginAbstract
return self::transferBalanceFromSiteOwner(User::getId(), $value); return self::transferBalanceFromSiteOwner(User::getId(), $value);
} }
public static function transferBalance($users_id_from, $users_id_to, $value, $forceDescription = "", $forceTransfer = false) public static function transferBalance($users_id_from, $users_id_to, $value, $forceDescription = "", $forceTransfer = false) {
{
global $global; global $global;
_error_log("transferBalance: $users_id_from, $users_id_to, $value, $forceDescription, $forceTransfer"); _error_log("transferBalance: $users_id_from, $users_id_to, $value, $forceDescription, $forceTransfer");
if (!User::isAdmin()) { if (!User::isAdmin()) {
@ -401,6 +400,20 @@ class YPTWallet extends PluginAbstract
WalletLog::addLog($wallet_id, $value, $description, "{}", "success", "transferBalance from"); WalletLog::addLog($wallet_id, $value, $description, "{}", "success", "transferBalance from");
return true; return true;
} }
public static function transferAndSplitBalanceWithSiteOwner($users_id_from, $users_id_to, $value, $siteowner_percentage, $forceDescription = "") {
$response1 = self::transferBalance($users_id_from, $users_id_to, $value, $forceDescription, true);
$response2 = true;
if(!empty($siteowner_percentage)){
$siteowner_value = ($value/100)*$siteowner_percentage;
if($response1){
$response2 = self::transferBalanceToSiteOwner($users_id_to, $siteowner_value, $forceDescription." {$siteowner_percentage}% fee",true);
}
}
return $response1 && $response2;
}
public function getHTMLMenuRight() public function getHTMLMenuRight()
{ {
@ -645,4 +658,17 @@ class YPTWallet extends PluginAbstract
return $js; return $js;
} }
static function setAddFundsSuccessRedirectURL($url){
_session_start();
$_SESSION['addFunds_Success'] = $url;
}
static function getAddFundsSuccessRedirectURL(){
return $_SESSION['addFunds_Success'];
}
static function setAddFundsSuccessRedirectToVideo($videos_id){
self::setAddFundsSuccessRedirectURL(getRedirectToVideo($videos_id));
}
} }

View file

@ -45,7 +45,7 @@ if (!empty($payment)) {
} }
$obj->error = false; $obj->error = false;
$obj->approvalLink = $payment->getApprovalLink(); $obj->approvalLink = $payment->getApprovalLink();
_session_start(); $url = "{$global['webSiteRootURL']}plugin/Subscription/showPlans.php";
$_SESSION['addFunds_Cancel'] = $_SESSION['addFunds_Success'] = "{$global['webSiteRootURL']}plugin/Subscription/showPlans.php"; YPTWallet::setAddFundsSuccessRedirectURL($url);
} }
die(json_encode($obj)); die(json_encode($obj));

View file

@ -138,7 +138,12 @@ $uid = uniqid();
// Send the token to your server. // Send the token to your server.
avideoToast("<?php echo __("Payment Success"); ?>"); avideoToast("<?php echo __("Payment Success"); ?>");
updateYPTWallet(); updateYPTWallet();
setTimeout(function(){location.reload();}, 3000); setTimeout(function(){
<?php
$url = YPTWallet::getAddFundsSuccessRedirectURL();
echo empty($url)?'location.reload();':"window.top.location.href='{$url}'";
?>
}, 3000);
} }
}); });
} else { } else {

View file

@ -183,7 +183,10 @@ $uid = uniqid();
avideoToast("<?php echo __("Payment Success"); ?>"); avideoToast("<?php echo __("Payment Success"); ?>");
updateYPTWallet(); updateYPTWallet();
setTimeout(function () { setTimeout(function () {
location.reload(); <?php
$url = YPTWallet::getAddFundsSuccessRedirectURL();
echo empty($url)?'location.reload();':"window.top.location.href='{$url}'";
?>
}, 3000); }, 3000);
} }
}); });

View file

@ -11,8 +11,8 @@ if (!empty($paypal)) {
$paypalObj = $paypal->getDataObject(); $paypalObj = $paypal->getDataObject();
} }
$options = _json_decode($obj->addFundsOptions); $options = _json_decode($obj->addFundsOptions);
unset($_SESSION['addFunds_Success']); //unset($_SESSION['addFunds_Success']);
unset($_SESSION['addFunds_Fail']); //unset($_SESSION['addFunds_Fail']);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>"> <html lang="<?php echo $_SESSION['language']; ?>">

View file

@ -1030,7 +1030,16 @@ function avideoModalIframeWithClassName(url, className) {
} }
function avideoModalIframeIsVisible() { function avideoModalIframeIsVisible() {
if ($('.swal-modal-iframe').parent().hasClass('swal-overlay--show-modal')) { var modal = '';
if($('.swal-modal-iframe-small').length){
modal = $('.swal-modal-iframe-small');
}else if($('.swal-modal-iframe-large').length){
modal = $('.swal-modal-iframe-large');
}else{
modal = $('.swal-modal-iframe');
}
if (modal.parent().hasClass('swal-overlay--show-modal')) {
return true; return true;
} else { } else {
return false; return false;