]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/wernis_functions.php
Some fixes:
[mailer.git] / inc / libs / wernis_functions.php
index 0868db2f3d48c51182f8bda817e5a41cde43531a..b7c369d21b62051ff9bc65b9659ade678af95121 100644 (file)
@@ -190,7 +190,7 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) {
                                break;
 
                        default: // Unknown error (maybe new?)
-                               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown error %s from WDS66 API received.", $data[1]));
+                               logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unknown error %s from WDS66 API received.', $data[1]));
                                $return = array(
                                        'status'  => 'request_failed',
                                        'message' => '{%message,WERNIS_API_REQUEST_FAILED=' . $data[1] . '%}'
@@ -211,11 +211,20 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) {
 
 // Tests the function by calling balance.php on the API
 function WERNIS_TEST_API () {
+       // Only as admin
+       assert(isAdmin());
+
        // Result is always failed
        $result = FALSE;
 
+       // Prepare the request data
+       $requestData = array(
+               't_uid'       => getWernisRefid(),
+               't_md5'       => getWernisPassMd5()
+       );
+
        // Return the result from the lower functions
-       $return = WERNIS_SEND_REQUEST('balance.php');
+       $return = WERNIS_SEND_REQUEST('balance.php', $requestData);
 
        // Did it went smoothly?
        if ($return['status'] == 'OK') {