// 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
// 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