// is not false the API data is valid, else invalid
function PRIMERA_TEST_API () {
// Get new instance
- $api = new PrimeraApi($_POST['primera_api_name'], $_POST['primera_api_md5']);
+ $api = new PrimeraApi(REQUEST_POST('primera_api_name'), REQUEST_POST('primera_api_md5'));
// Was that fine?
return ($api->getPrimera() !== false);
}
// Execute the withdraw of a sponsor only!
function PRIMERA_EXECUTE_WITHDRAW ($primusNick, $userMd5, $amount) {
- global $_CONFIG;
-
// Is the sponsor extension installed?
if (!EXT_IS_ACTIVE("sponsor")) {
// No, abort here
$api = new PrimeraApi($primusNick, $userMd5);
// Prepare purpose
- $eval = "\$purpose = \"".COMPILE_CODE(sprintf(PRIMERA_API_PURPOSE_WITHDRAW, $_COOKIE['sponsorid']))."\";";
+ $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('PRIMERA_API_PURPOSE_WITHDRAW'), get_session('sponsorid')))."\";";
eval($eval);
// Pay the Primera
}
// Execute the payout
function PRIMERA_EXECUTE_PAYOUT ($primusNick, $userMd5, $amount) {
- global $_CONFIG;
-
// Get new instance
- $api = new PrimeraApi($_CONFIG['primera_api_name'], $_CONFIG['primera_api_md5']);
+ $api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5'));
// Prepare purpose
- $eval = "\$purpose = \"".COMPILE_CODE(sprintf(PRIMERA_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";";
+ $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('PRIMERA_API_PURPOSE_PAYOUT'), getUserId()))."\";";
eval($eval);
// Pay the Primera