Fix for double-included file
[mailer.git] / inc / modules / admin / what-config_beg.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 01/09/2005 *
4  * ================                             Last change: 01/09/2005 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-config_beg.php                              *
8  * -------------------------------------------------------------------- *
9  * Short description : Setup beg link                                   *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Bettel-Link einstellen                           *
12  * -------------------------------------------------------------------- *
13  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
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.                                  *
22  *                                                                      *
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.                         *
27  *                                                                      *
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,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if ((!defined('__SECURITY')) || (!is_admin())) {
36         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
37         require($INC);
38 }
39
40 // Add description as navigation point
41 ADD_DESCR("admin", basename(__FILE__));
42
43 if (isset($_POST['ok'])) {
44         // Translate german decimal commas to computer decimal dots
45         $_POST['beg_points']       = REVERT_COMMA($_POST['beg_points']      );
46         $_POST['beg_points_max']   = REVERT_COMMA($_POST['beg_points_max']  );
47         $_POST['beg_notify_bonus'] = REVERT_COMMA($_POST['beg_notify_bonus']);
48
49         // Save settings
50         ADMIN_SAVE_SETTINGS($_POST);
51
52         // Remember new settings
53         $_CONFIG['beg_rallye']        = $_POST['beg_rallye'];
54         $_CONFIG['beg_ral_en_notify'] = $_POST['beg_ral_en_notify'];
55         $_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify'];
56 } else {
57         // Prepare constants for the template
58         define('__BEG_POINTS'           , TRANSLATE_COMMA($_CONFIG['beg_points']      , false));
59         define('__BEG_POINTS_MAX'       , TRANSLATE_COMMA($_CONFIG['beg_points_max']  , false));
60         define('__BEG_NOTIFY_BONUS'     , TRANSLATE_COMMA($_CONFIG['beg_notify_bonus'], false));
61         define('__BEG_TIMEOUT'          , CREATE_TIME_SELECTIONS($_CONFIG['beg_timeout']    , "beg_timeout"    , "Dhm"));
62         define('__BEG_UID_TIMEOUT'      , CREATE_TIME_SELECTIONS($_CONFIG['beg_uid_timeout'], "beg_uid_timeout", "Dhm"));
63         define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['beg_ip_timeout'] , "beg_ip_timeout" , "Dhm"));
64         define('__WAIT_SELECTION'       , CREATE_TIME_SELECTIONS($_CONFIG['beg_notify_wait'], "beg_notify_wait", "ms" ));
65         define('__BEG_RANKS', $_CONFIG['beg_ranks']);
66
67         // Activate / Deactivate beg rallye (Y/N)
68         switch ($_CONFIG['beg_rallye'])
69         {
70         case 'Y':
71                 define('__BEG_RALLYE_Y', " checked=\"checked\"");
72                 define('__BEG_RALLYE_N', "");
73                 break;
74
75         case 'N':
76                 define('__BEG_RALLYE_Y', "");
77                 define('__BEG_RALLYE_N', " checked=\"checked\"");
78                 break;
79         }
80         switch ($_CONFIG['beg_active'])
81         {
82         case 'Y':
83                 define('__BEG_ACTIVE_Y', " checked=\"checked\"");
84                 define('__BEG_ACTIVE_N', "");
85                 break;
86
87         case 'N':
88                 define('__BEG_ACTIVE_Y', "");
89                 define('__BEG_ACTIVE_N', " checked=\"checked\"");
90                 break;
91         }
92         switch ($_CONFIG['beg_mode'])
93         {
94         case "DIRECT":
95                 define('__BEG_MODE_DIRECT', " checked=\"checked\"");
96                 define('__BEG_MODE_REF'   , "");
97                 break;
98
99         case "REF":
100                 define('__BEG_MODE_DIRECT', "");
101                 define('__BEG_MODE_REF'   , " checked=\"checked\"");
102                 break;
103         }
104         switch ($_CONFIG['beg_ral_en_notify'])
105         {
106         case 'Y':
107                 define('__BEG_RAL_EN_NOTIFY_Y', " checked=\"checked\"");
108                 define('__BEG_RAL_EN_NOTIFY_N', "");
109                 break;
110
111         case 'N':
112                 define('__BEG_RAL_EN_NOTIFY_Y', "");
113                 define('__BEG_RAL_EN_NOTIFY_N', " checked=\"checked\"");
114                 break;
115         }
116         switch ($_CONFIG['beg_ral_di_notify'])
117         {
118         case 'Y':
119                 define('__BEG_RAL_DI_NOTIFY_Y', " checked=\"checked\"");
120                 define('__BEG_RAL_DI_NOTIFY_N', "");
121                 break;
122
123         case 'N':
124                 define('__BEG_RAL_DI_NOTIFY_Y', "");
125                 define('__BEG_RAL_DI_NOTIFY_N', " checked=\"checked\"");
126                 break;
127         }
128         switch ($_CONFIG['beg_new_mem_notify'])
129         {
130         case 'Y':
131                 define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\"");
132                 define('__BEG_NEW_MEMBER_NOTIFY_N', "");
133                 break;
134
135         case 'N':
136                 define('__BEG_NEW_MEMBER_NOTIFY_Y', "");
137                 define('__BEG_NEW_MEMBER_NOTIFY_N', " checked=\"checked\"");
138                 break;
139         }
140         switch ($_CONFIG['beg_include_own'])
141         {
142         case 'Y':
143                 define('__BEG_INCLUDE_OWN_Y', " checked=\"checked\"");
144                 define('__BEG_INCLUDE_OWN_N', "");
145                 break;
146
147         case 'N':
148                 define('__BEG_INCLUDE_OWN_Y', "");
149                 define('__BEG_INCLUDE_OWN_N', " checked=\"checked\"");
150                 break;
151         }
152
153         // Add data to constant __MEMBER_SELECTION
154         define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['beg_uid'], false, true, true, "beg_uid"));
155
156         // Load form template
157         LOAD_TEMPLATE("admin_config_beg");
158 }
159 //
160 ?>