X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_wernis.php;h=a5fb7df05470ad43fe3c5983070aebacefd97659;hb=87229cb5d7b5396793e85fd0b4172d473195835c;hp=7acf89891c3005189802e1f4a4ec270992c34425;hpb=a00ad7dd8c36a5322e28f38d8d641efb90c00c92;p=mailer.git diff --git a/inc/modules/admin/what-config_wernis.php b/inc/modules/admin/what-config_wernis.php index 7acf89891c..a5fb7df054 100644 --- a/inc/modules/admin/what-config_wernis.php +++ b/inc/modules/admin/what-config_wernis.php @@ -43,30 +43,40 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { // Add description as navigation point addYouAreHereLink('admin', __FILE__); +// Form sent? if (isFormSent('save_config')) { - // Hash the password and remove clear-text - setPostRequestElement('wernis_pass_md5', hashSha256(postRequestElement('wernis_pass'))); + // Is wernis_pass set? + if (isPostRequestElementSet('wernis_pass')) { + // Hash the password and remove clear-text + setPostRequestElement('wernis_pass_md5', hashSha256(postRequestElement('wernis_pass'))); - // First merge temporarily the new API data into the current config - mergeConfig(postRequestArray()); + // 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 + // Let's test the API first (hold your horses here, cowboy! Thank you. :) ) + if (doAdminTestWernisApi()) { + // 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 + // Remove clear password + unsetPostRequestElement('wernis_pass'); + + // Save settings + adminSaveSettingsFromPostData(); + } else { + // Failed to test the API! + displayMessage(getWernisErrorMessage()); + } + } else { // Remove clear password unsetPostRequestElement('wernis_pass'); - // Save settings + // Save it, anyway adminSaveSettingsFromPostData(); - } else { - // Failed to test the API! - displayMessage(GET_WERNIS_ERROR_MESSAGE()); } -} else { +} else { // Load template loadTemplate('admin_config_wernis'); }