Password reset for admin login added (still buggy if cache is installed and sql_patch...
[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 ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin()))
36 {
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
38         require($INC);
39 }
40
41 // Add description as navigation point
42 ADD_DESCR("admin", basename(__FILE__));
43
44 if (isset($_POST['ok']))
45 {
46         // Translate german decimal commas to computer decimal dots
47         $_POST['beg_points']       = str_replace(",", ".", $_POST['beg_points']      );
48         $_POST['beg_points_max']   = str_replace(",", ".", $_POST['beg_points_max']  );
49         $_POST['beg_notify_bonus'] = str_replace(",", ".", $_POST['beg_notify_bonus']);
50
51         // Save settings
52         ADMIN_SAVE_SETTINGS($_POST);
53
54         // Remember new settings
55         $_CONFIG['beg_rallye']        = $_POST['beg_rallye'];
56         $_CONFIG['beg_ral_en_notify'] = $_POST['beg_ral_en_notify'];
57         $_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify'];
58
59         // Include sending out mails
60         if ((($_CONFIG['beg_rallye'] == "Y") && ($_CONFIG['beg_ral_en_notify'] == "Y")) || (($_CONFIG['beg_rallye'] == "N") && ($_CONFIG['beg_ral_di_notify'] == "Y")))
61         {
62                 include(PATH."inc/mails/beg_mails.php");
63         }
64 }
65  else
66 {
67         // Prepare constants for the template
68         define('__BEG_POINTS'           , TRANSLATE_COMMA($_CONFIG['beg_points']      , false));
69         define('__BEG_POINTS_MAX'       , TRANSLATE_COMMA($_CONFIG['beg_points_max']  , false));
70         define('__BEG_NOTIFY_BONUS'     , TRANSLATE_COMMA($_CONFIG['beg_notify_bonus'], false));
71         define('__BEG_TIMEOUT'          , CREATE_TIME_SELECTIONS($_CONFIG['beg_timeout']    , "beg_timeout"    , "Dhm"));
72         define('__BEG_UID_TIMEOUT'      , CREATE_TIME_SELECTIONS($_CONFIG['beg_uid_timeout'], "beg_uid_timeout", "Dhm"));
73         define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['beg_ip_timeout'] , "beg_ip_timeout" , "Dhm"));
74         define('__WAIT_SELECTION'       , CREATE_TIME_SELECTIONS($_CONFIG['beg_notify_wait'], "beg_notify_wait", "ms" ));
75         define('__BEG_RANKS', $_CONFIG['beg_ranks']);
76
77         // Activate / Deactivate beg rallye (Y/N)
78         switch ($_CONFIG['beg_rallye'])
79         {
80         case 'Y':
81                 define('__BEG_RALLYE_Y', ' checked');
82                 define('__BEG_RALLYE_N', "");
83                 break;
84
85         case 'N':
86                 define('__BEG_RALLYE_Y', "");
87                 define('__BEG_RALLYE_N', ' checked');
88                 break;
89         }
90         switch ($_CONFIG['beg_active'])
91         {
92         case 'Y':
93                 define('__BEG_ACTIVE_Y', ' checked');
94                 define('__BEG_ACTIVE_N', "");
95                 break;
96
97         case 'N':
98                 define('__BEG_ACTIVE_Y', "");
99                 define('__BEG_ACTIVE_N', ' checked');
100                 break;
101         }
102         switch ($_CONFIG['beg_mode'])
103         {
104         case "DIRECT":
105                 define('__BEG_MODE_DIRECT', ' checked');
106                 define('__BEG_MODE_REF'   , "");
107                 break;
108
109         case "REF":
110                 define('__BEG_MODE_DIRECT', "");
111                 define('__BEG_MODE_REF'   , ' checked');
112                 break;
113         }
114         switch ($_CONFIG['beg_ral_en_notify'])
115         {
116         case 'Y':
117                 define('__BEG_RAL_EN_NOTIFY_Y', ' checked');
118                 define('__BEG_RAL_EN_NOTIFY_N', "");
119                 break;
120
121         case 'N':
122                 define('__BEG_RAL_EN_NOTIFY_Y', "");
123                 define('__BEG_RAL_EN_NOTIFY_N', ' checked');
124                 break;
125         }
126         switch ($_CONFIG['beg_ral_di_notify'])
127         {
128         case 'Y':
129                 define('__BEG_RAL_DI_NOTIFY_Y', ' checked');
130                 define('__BEG_RAL_DI_NOTIFY_N', "");
131                 break;
132
133         case 'N':
134                 define('__BEG_RAL_DI_NOTIFY_Y', "");
135                 define('__BEG_RAL_DI_NOTIFY_N', ' checked');
136                 break;
137         }
138         switch ($_CONFIG['beg_new_mem_notify'])
139         {
140         case 'Y':
141                 define('__BEG_NEW_MEMBER_NOTIFY_Y', ' checked');
142                 define('__BEG_NEW_MEMBER_NOTIFY_N', "");
143                 break;
144
145         case 'N':
146                 define('__BEG_NEW_MEMBER_NOTIFY_Y', "");
147                 define('__BEG_NEW_MEMBER_NOTIFY_N', ' checked');
148                 break;
149         }
150         switch ($_CONFIG['beg_include_own'])
151         {
152         case 'Y':
153                 define('__BEG_INCLUDE_OWN_Y', ' checked');
154                 define('__BEG_INCLUDE_OWN_N', "");
155                 break;
156
157         case 'N':
158                 define('__BEG_INCLUDE_OWN_Y', "");
159                 define('__BEG_INCLUDE_OWN_N', ' checked');
160                 break;
161         }
162
163         // Add data to constant __MEMBER_SELECTION
164         ADD_MEMBER_SELECTION_BOX(false, true, true, $_CONFIG['beg_uid']);
165
166         // Load form template
167         LOAD_TEMPLATE("admin_config_beg");
168 }
169 //
170 ?>