X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_wernis.php;h=8bfd67aeb15fcf17156a6355e0bf2d48c4836e8d;hb=8ce32e702f3caa76b8d446902948e83e1e6854c8;hp=ea86768545a0c198b50d8ab36e779058078e88a4;hpb=75ad748a68473ace540251427a74fb781b1145e9;p=mailer.git diff --git a/inc/modules/admin/what-config_wernis.php b/inc/modules/admin/what-config_wernis.php index ea86768545..8bfd67aeb1 100644 --- a/inc/modules/admin/what-config_wernis.php +++ b/inc/modules/admin/what-config_wernis.php @@ -1,7 +1,7 @@ $CONFIG['wernis_min_amount'], - 'api_id' => $CONFIG['wernis_api_id'], - 'api_md5' => $CONFIG['wernis_api_md5'] - ); +if (isFormSent()) { + // First merge temporarily the new API data into the current config + mergeConfig(postRequestArray()); + // Let's test the API first (hold your horses here, cowboy! Thank you. :) ) + if (WERNIS_TEST_API()) { + // Revert german commata + foreach (array('payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent') as $revert) { + setPostRequestElement('wernis_' . $revert, postRequestElement('wernis_' . $revert)); + } // END - if + + // Hash the password and remove clear-text + setPostRequestElement('wernis_pass_md5', md5(postRequestElement('wernis_pass'))); + unsetPostRequestElement('wernis_pass'); + + // Save settings + adminSaveSettingsFromPostData(); + } else { + // Failed to test the API! + displayMessage(GET_WERNIS_ERROR_MESSAGE()); + } +} else { // Load template - LOAD_TEMPLATE("admin_config_wernis", false, $content); + loadTemplate('admin_config_wernis'); } -// +// [EOF] ?>