]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/primera_functions.php
Fixed logfile writing in installation phase, .revision is now ignored
[mailer.git] / inc / libs / primera_functions.php
index 1d19c960a73467df51e8830c879fd9120f4c96ec..04228a1cfe247eadfe50c9d2bb02916c4a895b98 100644 (file)
@@ -236,15 +236,13 @@ class PrimeraApi {
 // 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
@@ -258,7 +256,7 @@ function PRIMERA_EXECUTE_WITHDRAW ($primusNick, $userMd5, $amount) {
        $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
@@ -266,13 +264,11 @@ function PRIMERA_EXECUTE_WITHDRAW ($primusNick, $userMd5, $amount) {
 }
 // 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'), $GLOBALS['userid']))."\";";
        eval($eval);
 
        // Pay the Primera