2 /************************************************************************
3 * MXChange v0.2.1 Start: 12/26/2007 *
4 * ================ Last change: 12/26/2007 *
6 * -------------------------------------------------------------------- *
7 * File : what-config_wernis.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Configure wernis sub-system *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Auszahlungensarten editieren *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2008 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Some security stuff...
40 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
41 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
45 // Add description as navigation point
46 ADD_DESCR('admin', __FILE__);
49 // First merge temporarily the new API data into the current config
50 mergeConfig(REQUEST_POST_ARRAY());
52 // Let's test the API first (hold your horses here, cowboy! Thank you. :) )
53 if (WERNIS_TEST_API()) {
54 // Revert german commata
55 foreach (array('payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent') as $revert) {
56 REQUEST_SET_POST('wernis_'.$revert, convertCommaToDot(REQUEST_POST('wernis_'.$revert)));
59 // Hash the password and remove clear-text
60 REQUEST_SET_POST('wernis_pass_md5', md5(REQUEST_POST('wernis_pass')));
61 REQUEST_UNSET_POST(('wernis_pass'));
64 ADMIN_SAVE_SETTINGS_POST();
66 // Failed to test the API!
67 LOAD_TEMPLATE('admin_settings_saved', false, GET_WERNIS_ERROR_MESSAGE());
70 // Prepare data for template output
72 'min_payout' => getConfig(('wernis_min_payout')),
73 'min_withdraw' => getConfig(('wernis_min_withdraw')),
74 'api_id' => getConfig(('wernis_api_id')),
75 'api_md5' => getConfig('wernis_api_md5'),
76 'api_url' => getConfig('wernis_api_url'),
77 'refid' => getConfig(('wernis_refid')),
78 'payout_factor' => translateComma(getConfig('wernis_payout_factor')),
79 'withdraw_factor' => translateComma(getConfig('wernis_withdraw_factor')),
80 'payout_fee_percent' => translateComma(getConfig('wernis_payout_fee_percent')),
81 'withdraw_fee_percent' => translateComma(getConfig('wernis_withdraw_fee_percent')),
82 'payout_fee_fix' => getConfig(('wernis_payout_fee_fix')),
83 'withdraw_fee_fix' => getConfig(('wernis_withdraw_fee_fix'))
86 // Prepare payout Y/N selection
87 if (getConfig('wernis_payout_active') == 'Y') {
89 define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', ' checked="checked"');
90 define('__CFG_WERNIS_PAYOUT_ACTIVE_N', '');
93 define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', '');
94 define('__CFG_WERNIS_PAYOUT_ACTIVE_N', ' checked="checked"');
97 // Prepare withdraw Y/N selection
98 if (getConfig('wernis_withdraw_active') == 'Y') {
100 define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', ' checked="checked"');
101 define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', '');
104 define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', '');
105 define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', ' checked="checked"');
109 LOAD_TEMPLATE("admin_config_wernis", false, $content);