-if (isset($_POST['ok'])) {
- // Save settings
- ADMIN_SAVE_SETTINGS($_POST, "_config", "config='0'");
+ // 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) {
+ setPostRequestParameter('wernis_' . $revert, postRequestParameter('wernis_' . $revert));
+ } // END - if
+
+ // Hash the password and remove clear-text
+ setPostRequestParameter('wernis_pass_md5', md5(postRequestParameter('wernis_pass')));
+ unsetPostRequestParameter('wernis_pass');
+
+ // Save settings
+ adminSaveSettingsFromPostData();
+ } else {
+ // Failed to test the API!
+ loadTemplate('admin_settings_saved', false, GET_WERNIS_ERROR_MESSAGE());
+ }