54226ccbc5fdc82e3feec1a2206417243ddd2e4e
[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 - 2009 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')) || (!isAdmin())) {
41         die();
42 } // END - if
43
44 // Add description as navigation point
45 addMenuDescription('admin', __FILE__);
46
47 if (!isExtensionActive('other')) {
48         // Missing extension!
49         loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('other'));
50         return;
51 } // END - if
52
53 // Stop saving data if one input field is !isset
54 if (isFormSent()) {
55         // Calculate stamps and set calculated stamps
56         setRequestPostElement('online_timeout'       , createTimestampFromSelections('ip_timeout'           , postRequestArray()));
57         setRequestPostElement('url_tlock'            , createTimestampFromSelections('url_tlock'            , postRequestArray()));
58         setRequestPostElement('profile_lock'         , createTimestampFromSelections('profile_lock'         , postRequestArray()));
59         setRequestPostElement('profile_update'       , createTimestampFromSelections('profile_update'       , postRequestArray()));
60         setRequestPostElement('resend_profile_update', createTimestampFromSelections('resend_profile_update', postRequestArray()));
61
62         // Online-Timeout shall be > 0 or your database will crow and crow and crow...
63         if (!isPostRequestElementSet('online_timeout'))        { unsetPostRequestElement('ok'); }
64
65         // Chedck other timestamps (which can be zero!)
66         if (!isPostRequestElementSet('profile_lock'))          { unsetPostRequestElement('ok'); }
67         if (!isPostRequestElementSet('url_tlock'))             { unsetPostRequestElement('ok'); }
68         if (!isPostRequestElementSet('profile_update'))        { unsetPostRequestElement('ok'); }
69         if (!isPostRequestElementSet('resend_profile_update')) { unsetPostRequestElement('ok'); }
70
71         // Check other settings
72         if (!isPostRequestElementSet('max_send'))              { unsetPostRequestElement('ok'); }
73         if (!isPostRequestElementSet('code_length'))           { unsetPostRequestElement('ok'); }
74         if (!isPostRequestElementSet('reject_url'))            { unsetPostRequestElement('ok'); }
75 }
76
77 if (isFormSent()) {
78         // Update stamps directly
79         adminSaveSettingsFromPostData();
80 } else {
81         // Time selection boxes
82         $content['online_timeout']   = createTimeSelections(getConfig('online_timeout'), 'ip_timeout'           , 'ms');
83         $content['url_tlock']        = createTimeSelections(getConfig('url_tlock')     , 'url_tlock'            , 'WDh');
84         $content['profile_lock']     = createTimeSelections(getConfig('profile_lock')  , 'profile_lock'         , 'WDh');
85         $content['profile_update']   = createTimeSelections(getConfig('profile_update'), 'profile_update'       , 'YM');
86         $content['profile_reupdate'] = createTimeSelections(getConfig('resend_profile_update') , 'resend_profile_update', 'MWD');
87
88         // Prepare more Y/N selections
89         foreach(array('show_points_unconfirmed','show_timings','youre_here','member_menu','guest_menu','order_multi_page','autosend_active','send_prof_update','admin_notify','display_debug_sqls') as $entry) {
90                 $content[$entry . '_y'] = '';
91                 $content[$entry . '_n'] = '';
92                 $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
93         } // END - foreach
94
95         // Prepare more
96         foreach (array('css_php_direct','css_php_file','css_php_inline','mailid_error_redirect_index','mailid_error_redirect_reject') as $entry) {
97                 $content[$entry] = '';
98         } // END - foreach
99
100         // Set selections
101         foreach (array('css_php','mailid_error_redirect') as $entry) {
102                 $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
103         } // END - foreach
104
105         for ($i = 0; $i <= 5; $i++) {
106                 $content['comma_def_' . $i] = '';
107         } // END - for
108
109         // Set selection
110         $content['comma_def_' . getConfig('max_comma')] = ' selected="selected"';
111
112         // Load template
113         loadTemplate('admin_config_other', false, $content);
114 }
115
116 // [EOF]
117 ?>