X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_wernis.php;h=95b848394f753b7e7c5d64f80ae5e517592a3c04;hb=095f5ab59b539834d2c67e5d409d01820e10d8be;hp=7acf89891c3005189802e1f4a4ec270992c34425;hpb=b7a3b394d4639834ad8466fbc4ab06694a4d4569;p=mailer.git diff --git a/inc/modules/admin/what-config_wernis.php b/inc/modules/admin/what-config_wernis.php index 7acf89891c..95b848394f 100644 --- a/inc/modules/admin/what-config_wernis.php +++ b/inc/modules/admin/what-config_wernis.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2013 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -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'); }