mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
Missing functions
This commit is contained in:
parent
06273135e8
commit
0826de71b7
7 changed files with 76 additions and 33 deletions
48
composer.lock
generated
48
composer.lock
generated
|
@ -387,16 +387,16 @@
|
|||
},
|
||||
{
|
||||
"name": "google/auth",
|
||||
"version": "v1.15.0",
|
||||
"version": "v1.15.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/googleapis/google-auth-library-php.git",
|
||||
"reference": "b346c07de6613e26443d7b4830e5e1933b830dc4"
|
||||
"reference": "4e0c9367719df9703e96f5ad613041b87742471c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/b346c07de6613e26443d7b4830e5e1933b830dc4",
|
||||
"reference": "b346c07de6613e26443d7b4830e5e1933b830dc4",
|
||||
"url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/4e0c9367719df9703e96f5ad613041b87742471c",
|
||||
"reference": "4e0c9367719df9703e96f5ad613041b87742471c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -410,7 +410,7 @@
|
|||
"require-dev": {
|
||||
"guzzlehttp/promises": "0.1.1|^1.3",
|
||||
"kelvinmo/simplejwt": "^0.2.5|^0.5.1",
|
||||
"phpseclib/phpseclib": "^2",
|
||||
"phpseclib/phpseclib": "^2.0.31",
|
||||
"phpunit/phpunit": "^4.8.36|^5.7",
|
||||
"sebastian/comparator": ">=1.2.3",
|
||||
"squizlabs/php_codesniffer": "^3.5"
|
||||
|
@ -438,9 +438,9 @@
|
|||
"support": {
|
||||
"docs": "https://googleapis.github.io/google-auth-library-php/master/",
|
||||
"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",
|
||||
|
@ -570,16 +570,16 @@
|
|||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "1.8.1",
|
||||
"version": "1.8.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "35ea11d335fd638b5882ff1725228b3d35496ab1"
|
||||
"reference": "dc960a912984efb74d0a90222870c72c87f10c91"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1",
|
||||
"reference": "35ea11d335fd638b5882ff1725228b3d35496ab1",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
|
||||
"reference": "dc960a912984efb74d0a90222870c72c87f10c91",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -639,9 +639,9 @@
|
|||
],
|
||||
"support": {
|
||||
"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",
|
||||
|
@ -860,16 +860,16 @@
|
|||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v2.0.19",
|
||||
"version": "v2.0.20",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/random_compat.git",
|
||||
"reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241"
|
||||
"reference": "0f1f60250fccffeaf5dda91eea1c018aed1adc2a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/446fc9faa5c2a9ddf65eb7121c0af7e857295241",
|
||||
"reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/0f1f60250fccffeaf5dda91eea1c018aed1adc2a",
|
||||
"reference": "0f1f60250fccffeaf5dda91eea1c018aed1adc2a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -910,20 +910,20 @@
|
|||
"issues": "https://github.com/paragonie/random_compat/issues",
|
||||
"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",
|
||||
"version": "v6.4.0",
|
||||
"version": "v6.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "050d430203105c27c30efd1dce7aa421ad882d01"
|
||||
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/050d430203105c27c30efd1dce7aa421ad882d01",
|
||||
"reference": "050d430203105c27c30efd1dce7aa421ad882d01",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d",
|
||||
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -978,7 +978,7 @@
|
|||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"support": {
|
||||
"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": [
|
||||
{
|
||||
|
@ -986,7 +986,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-03-31T20:06:42+00:00"
|
||||
"time": "2021-04-29T12:25:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
|
|
|
@ -350,8 +350,7 @@ class YPTWallet extends PluginAbstract
|
|||
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;
|
||||
_error_log("transferBalance: $users_id_from, $users_id_to, $value, $forceDescription, $forceTransfer");
|
||||
if (!User::isAdmin()) {
|
||||
|
@ -402,6 +401,20 @@ class YPTWallet extends PluginAbstract
|
|||
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()
|
||||
{
|
||||
global $global;
|
||||
|
@ -645,4 +658,17 @@ class YPTWallet extends PluginAbstract
|
|||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ if (!empty($payment)) {
|
|||
}
|
||||
$obj->error = false;
|
||||
$obj->approvalLink = $payment->getApprovalLink();
|
||||
_session_start();
|
||||
$_SESSION['addFunds_Cancel'] = $_SESSION['addFunds_Success'] = "{$global['webSiteRootURL']}plugin/Subscription/showPlans.php";
|
||||
$url = "{$global['webSiteRootURL']}plugin/Subscription/showPlans.php";
|
||||
YPTWallet::setAddFundsSuccessRedirectURL($url);
|
||||
}
|
||||
die(json_encode($obj));
|
|
@ -138,7 +138,12 @@ $uid = uniqid();
|
|||
// Send the token to your server.
|
||||
avideoToast("<?php echo __("Payment Success"); ?>");
|
||||
updateYPTWallet();
|
||||
setTimeout(function(){location.reload();}, 3000);
|
||||
setTimeout(function(){
|
||||
<?php
|
||||
$url = YPTWallet::getAddFundsSuccessRedirectURL();
|
||||
echo empty($url)?'location.reload();':"window.top.location.href='{$url}'";
|
||||
?>
|
||||
}, 3000);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -183,7 +183,10 @@ $uid = uniqid();
|
|||
avideoToast("<?php echo __("Payment Success"); ?>");
|
||||
updateYPTWallet();
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
<?php
|
||||
$url = YPTWallet::getAddFundsSuccessRedirectURL();
|
||||
echo empty($url)?'location.reload();':"window.top.location.href='{$url}'";
|
||||
?>
|
||||
}, 3000);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -11,8 +11,8 @@ if (!empty($paypal)) {
|
|||
$paypalObj = $paypal->getDataObject();
|
||||
}
|
||||
$options = _json_decode($obj->addFundsOptions);
|
||||
unset($_SESSION['addFunds_Success']);
|
||||
unset($_SESSION['addFunds_Fail']);
|
||||
//unset($_SESSION['addFunds_Success']);
|
||||
//unset($_SESSION['addFunds_Fail']);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $_SESSION['language']; ?>">
|
||||
|
|
|
@ -1030,7 +1030,16 @@ function avideoModalIframeWithClassName(url, className) {
|
|||
}
|
||||
|
||||
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;
|
||||
} else {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue