// Widthdraw this amount
function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) {
// Is the sponsor extension installed?
- if (getConfig('wernis_withdraw_active') == "N") {
+ if (getConfig('wernis_withdraw_active') != "Y") {
if (!EXT_IS_ACTIVE("sponsor")) {
// No, abort here
return false;
// Payout this amount
function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) {
- global $_CONFIG;
-
// Default is failed attempt
$result = false;
// Prepare the purpose
- $eval = "\$purpose = \"".COMPILE_CODE(sprintf(WERNIS_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";";
+ $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('WERNIS_API_PURPOSE_PAYOUT'), $GLOBALS['userid']))."\";";
eval($eval);
// Prepare the request data
$requestData = array(
'sub_request' => "send",
't_uid' => getConfig('wernis_refid'),
- 't_md5' => $_CONFIG['wernis_pass_md5'],
+ 't_md5' => getConfig('wernis_pass_md5'),
'r_uid' => bigintval($wdsId),
'amount' => bigintval($amount),
'purpose' => urlencode(base64_encode($purpose))
// Log the transfer
function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = "", $status = "") {
// Register this wernis movement
- SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_wernis` (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_wernis` (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
array($GLOBALS['userid'], bigintval($wdsId), bigintval($amount), $type, $message, $status), __FILE__, __LINE__);
}