0cc236cc3cadd907b0c1ffb0b356d148d25190fc
[mailer.git] / inc / modules / admin / what-config_other.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 10/11/2003 *
4  * ===============                              Last change: 09/21/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-config_other.php                            *
8  * -------------------------------------------------------------------- *
9  * Short description : basic settings                                   *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Grund Einstellungen                              *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
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                  *
22  *                                                                      *
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.                                  *
27  *                                                                      *
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.                         *
32  *                                                                      *
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,               *
36  * MA  02110-1301  USA                                                  *
37  ************************************************************************/
38
39 // Some security stuff...
40 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
41         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
42         require($INC);
43 } elseif (!EXT_IS_ACTIVE('other')) {
44         // Missing extension!
45         addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveMessage('other'));
46         return;
47 }
48
49 // Add description as navigation point
50 ADD_DESCR('admin', __FILE__);
51
52 // Stop saving data if one input field is !isset
53 if (isFormSent()) {
54         // Calculate stamps and set calculated stamps
55         REQUEST_POST('online_timeout')        = createTimestampFromSelections('ip_timeout'           , REQUEST_POST_ARRAY());
56         REQUEST_POST('url_tlock')             = createTimestampFromSelections('url_tlock'            , REQUEST_POST_ARRAY());
57         REQUEST_POST('profile_lock')          = createTimestampFromSelections('profile_lock'         , REQUEST_POST_ARRAY());
58         REQUEST_POST('profile_update')        = createTimestampFromSelections('profile_update'       , REQUEST_POST_ARRAY());
59         REQUEST_SET_POST('resend_profile_update', createTimestampFromSelections('resend_profile_update', REQUEST_POST_ARRAY()));
60
61         // Online-Timeout shall be > 0 or your database will crow and crow and crow...
62         if (!REQUEST_ISSET_POST(('online_timeout')))        { REQUEST_UNSET_POST('ok'); }
63
64         // Chedck other timestamps (which can be zero!)
65         if (!REQUEST_ISSET_POST(('profile_lock')))          { REQUEST_UNSET_POST('ok'); }
66         if (!REQUEST_ISSET_POST(('url_tlock')))             { REQUEST_UNSET_POST('ok'); }
67         if (!REQUEST_ISSET_POST(('profile_update')))        { REQUEST_UNSET_POST('ok'); }
68         if (!REQUEST_ISSET_POST(('resend_profile_update'))) { REQUEST_UNSET_POST('ok'); }
69
70         // Check other settings
71         if (!REQUEST_ISSET_POST(('max_send')))              { REQUEST_UNSET_POST('ok'); }
72         if (!REQUEST_ISSET_POST(('code_length')))           { REQUEST_UNSET_POST('ok'); }
73         if (!REQUEST_ISSET_POST(('reject_url')))            { REQUEST_UNSET_POST('ok'); }
74 }
75
76 if (isFormSent()) {
77         // Update stamps directly
78         ADMIN_SAVE_SETTINGS_POST();
79 } else {
80         // Transfer config data into constants for the template
81         define('_CFG_CODE_LENGTH', getConfig('code_length'));
82         define('_CFG_ACT_SYSTEM' , getConfig('activate_xchange'));
83         define('_CFG_MAX_SEND'   , getConfig('max_send'));
84         define('_CFG_REJECT_URL' , getConfig('reject_url'));
85         define('_CFG_MIN_AGE'    , getConfig('min_age'));
86
87         // Time selection boxes
88         define('_CFG_ONLINE_TIMEOUT', createTimeSelections(getConfig('online_timeout'), 'ip_timeout'           , 'ms'));
89         define('_CFG_URL_TLOCK'     , createTimeSelections(getConfig('url_tlock')     , 'url_tlock'            , 'WDh'));
90         define('_CFG_PROFILE_LOCK'  , createTimeSelections(getConfig('profile_lock')  , 'profile_lock'         , 'WDh'));
91         define('_CFG_PROFILE_UPDATE', createTimeSelections(getConfig('profile_update'), 'profile_update'       , 'YM'));
92         define('_CFG_PROF_REUPDATE' , createTimeSelections(getConfig('resend_profile_update') , 'resend_profile_update', 'MWD'));
93
94         if (getConfig('order_multi_page') != 'Y') {
95                 define('_CFG_ORDER_MULTI_N', ' checked="checked"');
96                 define('_CFG_ORDER_MULTI_Y', '');
97         } else {
98                 define('_CFG_ORDER_MULTI_N', '');
99                 define('_CFG_ORDER_MULTI_Y', ' checked="checked"');
100         }
101
102         if (getConfig('autosend_active') != 'Y') {
103                 define('_CFG_AUTOSEND_ACTIVE_N', ' checked="checked"');
104                 define('_CFG_AUTOSEND_ACTIVE_Y', '');
105         } else {
106                 define('_CFG_AUTOSEND_ACTIVE_N', '');
107                 define('_CFG_AUTOSEND_ACTIVE_Y', ' checked="checked"');
108         }
109
110         if (getConfig('send_prof_update') != 'Y') {
111                 define('_CFG_SEND_UPDATE_N', ' checked="checked"');
112                 define('_CFG_SEND_UPDATE_Y', '');
113         } else {
114                 define('_CFG_SEND_UPDATE_N', '');
115                 define('_CFG_SEND_UPDATE_Y', ' checked="checked"');
116         }
117
118         if (getConfig('admin_notify') != 'Y') {
119                 define('_CFG_ADMIN_NOTIFY_N', ' checked="checked"');
120                 define('_CFG_ADMIN_NOTIFY_Y', '');
121         } else {
122                 define('_CFG_ADMIN_NOTIFY_N', '');
123                 define('_CFG_ADMIN_NOTIFY_Y', ' checked="checked"');
124         }
125
126         if (getConfig('css_php') == 'DIRECT') {
127                 define('_CFG_CSS_PHP_DIRECT', ' checked="checked"');
128                 define('_CFG_CSS_PHP_FILE', '');
129         } else {
130                 define('_CFG_CSS_PHP_DIRECT', '');
131                 define('_CFG_CSS_PHP_FILE', ' checked="checked"');
132         }
133
134         if (getConfig('guest_menu') == 'Y') {
135                 define('_CFG_GUEST_MENU_ACTIVE', ' checked="checked"');
136                 define('_CFG_GUEST_MENU_INACTIVE', '');
137         } else {
138                 define('_CFG_GUEST_MENU_ACTIVE', '');
139                 define('_CFG_GUEST_MENU_INACTIVE', ' checked="checked"');
140         }
141
142         if (getConfig('member_menu') == 'Y') {
143                 define('_CFG_MEMBER_MENU_ACTIVE', ' checked="checked"');
144                 define('_CFG_MEMBER_MENU_INACTIVE', '');
145         } else {
146                 define('_CFG_MEMBER_MENU_ACTIVE', '');
147                 define('_CFG_MEMBER_MENU_INACTIVE', ' checked="checked"');
148         }
149
150         if (getConfig('youre_here') == 'Y') {
151                 define('_CFG_YOURE_HERE_ACTIVE', ' checked="checked"');
152                 define('_CFG_YOURE_HERE_INACTIVE', '');
153         } else {
154                 define('_CFG_YOURE_HERE_ACTIVE', '');
155                 define('_CFG_YOURE_HERE_INACTIVE', ' checked="checked"');
156         }
157
158         if (getConfig('show_timings') == 'Y') {
159                 define('_CFG_SHOW_TIMINGS_Y', ' checked="checked"');
160                 define('_CFG_SHOW_TIMINGS_N', '');
161         } else {
162                 define('_CFG_SHOW_TIMINGS_Y', '');
163                 define('_CFG_SHOW_TIMINGS_N', ' checked="checked"');
164         }
165
166         if (getConfig('show_points_unconfirmed') == 'Y') {
167                 define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', ' checked="checked"');
168                 define('_CFG_SHOW_POINTS_UNCONFIRMED_N', '');
169         } else {
170                 define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', '');
171                 define('_CFG_SHOW_POINTS_UNCONFIRMED_N', ' checked="checked"');
172         }
173
174         if (getConfig('mailid_error_redirect') == 'INDEX') {
175                 define('_CFG_MAILID_REDIRECT_INDEX', ' checked="checked"');
176                 define('_CFG_MAILID_REDIRECT_REJECT', '');
177         } else {
178                 define('_CFG_MAILID_REDIRECT_INDEX', '');
179                 define('_CFG_MAILID_REDIRECT_REJECT', ' checked="checked"');
180         }
181
182         for ($i = 0; $i <= 5; $i++) {
183                 $eval = "define('_COMMA_DEF_".$i."', \"\");";
184                 if (getConfig('max_comma') == $i) $eval = "define('_COMMA_DEF_".$i."', ' selected=\"selected\"');";
185                 eval($eval);
186         }
187
188         // Load template
189         LOAD_TEMPLATE("admin_config_other");
190 }
191
192 //
193 ?>