2 /************************************************************************
3 * MXChange v0.2.1 Start: 10/11/2003 *
4 * =============== Last change: 09/21/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-config_other.php *
8 * -------------------------------------------------------------------- *
9 * Short description : basic settings *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Grund Einstellungen *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
39 } elseif ((!EXT_IS_ACTIVE("other")) || (GET_EXT_VERSION("other") == "")) {
41 ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "other"));
46 // Add description as navigation point
47 ADD_DESCR("admin", basename(__FILE__));
49 // Stop saving data if one input field is !isset
50 if (isset($_POST['ok']))
52 if (function_exists('CREATE_TIME_SELECTIONS'))
54 // Calculate stamps and set calculated stamps
55 $_POST['online_timeout'] = CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout" , $_POST);
56 $_POST['url_tlock'] = CREATE_TIMESTAMP_FROM_SELECTIONS("url_tlock" , $_POST);
57 $_POST['profile_lock'] = CREATE_TIMESTAMP_FROM_SELECTIONS("profile_lock" , $_POST);
58 $_POST['profile_update'] = CREATE_TIMESTAMP_FROM_SELECTIONS("profile_update" , $_POST);
59 $_POST['resend_profile_update'] = CREATE_TIMESTAMP_FROM_SELECTIONS("resend_profile_update", $_POST);
62 // Online-Timeout shall be > 0 or your database will crow and crow and crow...
63 if (!isset($_POST['online_timeout'])) { unset($_POST['ok']); }
65 // Chedck other timestamps (which can be zero!)
66 if (!isset($_POST['profile_lock'])) { unset($_POST['ok']); }
67 if (!isset($_POST['url_tlock'])) { unset($_POST['ok']); }
68 if (!isset($_POST['profile_update'])) { unset($_POST['ok']); }
69 if (!isset($_POST['resend_profile_update'])) { unset($_POST['ok']); }
71 // Check other settings
72 if (!isset($_POST['max_send'])) { unset($_POST['ok']); }
73 if (!isset($_POST['max_tlength'])) { unset($_POST['ok']); }
74 if (!isset($_POST['unconfirmed'])) { unset($_POST['ok']); }
75 if (!isset($_POST['code_length'])) { unset($_POST['ok']); }
76 if (!isset($_POST['reject_url'])) { unset($_POST['ok']); }
79 OPEN_TABLE("100%", "admin_content admin_content_align", "");
80 if (isset($_POST['ok']))
82 // Update stamps directly
83 ADMIN_SAVE_SETTINGS($_POST, "_config", "config='0'");
87 // Transfer config data into constants for the template (DO NOT set $CONFIG as global in LOAD_TEMPLATE!!!)
88 define('_CFG_UNCONFIRMED' , $CONFIG['unconfirmed']);
89 define('_CFG_MAX_TLENGTH' , $CONFIG['max_tlength']);
90 define('_CFG_CODE_LENGTH' , $CONFIG['code_length']);
91 define('_CFG_ACT_SYSTEM' , $CONFIG['activate_xchange']);
92 define('_CFG_MAX_SEND' , $CONFIG['max_send']);
93 define('_CFG_REJECT_URL' , $CONFIG['reject_url']);
95 // Is there the pro-version function avaiable to create selection boxes instead of input boxes?
96 if (function_exists('CREATE_TIME_SELECTIONS'))
98 // Only pro versions: time selection boxes
99 define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS($CONFIG['online_timeout'], "ip_timeout" , "ms"));
100 define('_CFG_URL_TLOCK' , CREATE_TIME_SELECTIONS($CONFIG['url_tlock'] , "url_tlock" , "WDh"));
101 define('_CFG_PROFILE_LOCK' , CREATE_TIME_SELECTIONS($CONFIG['profile_lock'] , "profile_lock" , "WDh"));
102 define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS($CONFIG['profile_update'], "profile_update" , "YM"));
103 define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS($CONFIG['resend_profile_update'] , "resend_profile_update", "MWD"));
107 // Normal input boxes
108 define('_CFG_ONLINE_TIMEOUT', "<INPUT type=\"text\" name=\"online_timeout\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".$CONFIG['online_timeout']."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
109 define('_CFG_URL_TLOCK' , "<INPUT type=\"text\" name=\"url_tlock\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".$CONFIG['url_tlock'] ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
110 define('_CFG_PROFILE_LOCK' , "<INPUT type=\"text\" name=\"profile_lock\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".$CONFIG['profile_lock'] ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
111 define('_CFG_PROFILE_UPDATE', "<INPUT type=\"text\" name=\"profile_update\" class=\"admin_normal\" size=\"10\" maxlength=\"255\" value=\"".$CONFIG['profile_update']."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
112 define('_CFG_PROF_REUPDATE' , "<INPUT type=\"text\" name=\"resend_profile_update\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".$CONFIG['resend_profile_update'] ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
115 if ($CONFIG['test_text'] == "N")
117 define('_CFG_TEST_TEXT_N', " checked");
118 define('_CFG_TEST_TEXT_Y', "");
122 define('_CFG_TEST_TEXT_N', "");
123 define('_CFG_TEST_TEXT_Y', " checked");
125 if ($CONFIG['test_subj'] == "N")
127 define('_CFG_TEST_SUBJ_N', " checked");
128 define('_CFG_TEST_SUBJ_Y', "");
132 define('_CFG_TEST_SUBJ_N', "");
133 define('_CFG_TEST_SUBJ_Y', " checked");
135 if ($CONFIG['url_blacklist'] == "N")
137 define('_CFG_URL_BLIST_N', " checked");
138 define('_CFG_URL_BLIST_Y', "");
142 define('_CFG_URL_BLIST_N', "");
143 define('_CFG_URL_BLIST_Y', " checked");
145 if ($CONFIG['order_multi_page'] == "N")
147 define('_CFG_ORDER_MULTI_N', " checked");
148 define('_CFG_ORDER_MULTI_Y', "");
152 define('_CFG_ORDER_MULTI_N', "");
153 define('_CFG_ORDER_MULTI_Y', " checked");
155 if ($CONFIG['autosend_active'] == "N")
157 define('_CFG_AUTOSEND_ACTIVE_N', " checked");
158 define('_CFG_AUTOSEND_ACTIVE_Y', "");
162 define('_CFG_AUTOSEND_ACTIVE_N', "");
163 define('_CFG_AUTOSEND_ACTIVE_Y', " checked");
165 if ($CONFIG['send_prof_update'] == "N")
167 define('_CFG_SEND_UPDATE_N', " checked");
168 define('_CFG_SEND_UPDATE_Y', "");
172 define('_CFG_SEND_UPDATE_N', "");
173 define('_CFG_SEND_UPDATE_Y', " checked");
175 if ($CONFIG['admin_notify'] == "N")
177 define('_CFG_ADMIN_NOTIFY_N', " checked");
178 define('_CFG_ADMIN_NOTIFY_Y', "");
182 define('_CFG_ADMIN_NOTIFY_N', "");
183 define('_CFG_ADMIN_NOTIFY_Y', " checked");
185 if ($CONFIG['css_php'] == "DIRECT")
187 define('_CFG_CSS_PHP_DIRECT', " checked");
188 define('_CFG_CSS_PHP_FILE', "");
192 define('_CFG_CSS_PHP_DIRECT', "");
193 define('_CFG_CSS_PHP_FILE', " checked");
195 if ($CONFIG['guest_menu'] == "Y")
197 define('_CFG_GUEST_MENU_ACTIVE', " checked");
198 define('_CFG_GUEST_MENU_INACTIVE', "");
202 define('_CFG_GUEST_MENU_ACTIVE', "");
203 define('_CFG_GUEST_MENU_INACTIVE', " checked");
205 if ($CONFIG['member_menu'] == "Y")
207 define('_CFG_MEMBER_MENU_ACTIVE', " checked");
208 define('_CFG_MEMBER_MENU_INACTIVE', "");
212 define('_CFG_MEMBER_MENU_ACTIVE', "");
213 define('_CFG_MEMBER_MENU_INACTIVE', " checked");
215 if ($CONFIG['youre_here'] == "Y")
217 define('_CFG_YOURE_HERE_ACTIVE', " checked");
218 define('_CFG_YOURE_HERE_INACTIVE', "");
222 define('_CFG_YOURE_HERE_ACTIVE', "");
223 define('_CFG_YOURE_HERE_INACTIVE', " checked");
226 for ($i = 0; $i <= 5; $i++)
228 $eval = "define('_COMMA_DEF_".$i."', \"\");";
229 if ($CONFIG['max_comma'] == $i) $eval = "define('_COMMA_DEF_".$i."', \" selected\");";
234 LOAD_TEMPLATE("admin_config_other");