X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fwernis_functions.php;h=6a3725ac021a8ffcffd921aa32fdbe6de882be9a;hp=4114845e9cdbc75227cfd28a2c180e353228fd21;hb=50cec5fbac1b8b7427f016bf02c93cb1aa7bb9e1;hpb=f4ef7580792a9e424e5456369f40c75a29dbfead diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 4114845e9c..6a3725ac02 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -212,10 +212,21 @@ function WERNIS_TEST_API () { // Widthdraw this amount function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) { global $_CONFIG; + + // Is the sponsor extension installed? + if (!EXT_IS_ACTIVE("sponsor")) { + // No, abort here + return false; + } elseif (!IS_SPONSOR()) { + // No sponsor, not allowed to withdraw! + return false; + } + + // Default is failed attempt $result = false; // Prepare the purpose - $eval = "\$purpose = \"".COMPILE_CODE(WERNIS_API_PURPOSE_WITHDRAW)."\";"; + $eval = "\$purpose = \"".COMPILE_CODE(sprintf(WERNIS_API_PURPOSE_WITHDRAW, $GLOBALS['userid']))."\";"; eval($eval); // Prepare the request data @@ -253,10 +264,12 @@ function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) { // Payout this amount function WERNIS_EXECUTE_PAYOUT ($wdsId, $userMd5, $amount) { global $_CONFIG; + + // Default is failed attempt $result = false; // Prepare the purpose - $eval = "\$purpose = \"".COMPILE_CODE(WERNIS_API_PURPOSE_PAYOUT)."\";"; + $eval = "\$purpose = \"".COMPILE_CODE(sprintf(WERNIS_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";"; eval($eval); // Prepare the request data