RevBomb patch applied (thanks to profi-concept)
[mailer.git] / inc / modules / admin / what-config_cache.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 01/29/2006 *
4  * ================                             Last change: 01/29/2006 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-config_cache.php                            *
8  * -------------------------------------------------------------------- *
9  * Short description : Configuration for the caching system             *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Konfiguration des Caching-Systems                *
12  * -------------------------------------------------------------------- *
13  * $Revision:: 856                                                    $ *
14  * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009)              $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author:: stelzi                                                   $ *
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 }
44
45 // Add description as navigation point
46 ADD_DESCR("admin", __FILE__);
47
48 if (IS_FORM_SENT()) {
49         // Cache path has been not changed by default so don't test it again
50         REQUEST_SET_POST('cache_tested', "N");
51
52         // Check if path has been changed
53         if (REQUEST_POST('cache_path') != getConfig('cache_path')) {
54                 // Okay, cache path has been altered so we have to test it again!
55                 REQUEST_SET_POST('cache_tested', "Y");
56         }
57
58         if ((REQUEST_POST('cache_admins') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("admins"))) {
59                 $GLOBALS['cache_instance']->destroyCacheFile();
60         }
61
62         if ((REQUEST_POST('cache_acls') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("acls"))) {
63                 $GLOBALS['cache_instance']->destroyCacheFile();
64         }
65
66         if ((REQUEST_POST('cache_exts') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("extensions", true))) {
67                 $GLOBALS['cache_instance']->destroyCacheFile();
68         }
69
70         if ((REQUEST_POST('cache_config') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("config"))) {
71                 $GLOBALS['cache_instance']->destroyCacheFile();
72         }
73
74         if ((REQUEST_POST('cache_modreg') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("modreg"))) {
75                 $GLOBALS['cache_instance']->destroyCacheFile();
76         }
77
78         if ((REQUEST_POST('cache_refdepth') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("refdepth"))) {
79                 $GLOBALS['cache_instance']->destroyCacheFile();
80         }
81
82         if ((REQUEST_POST('cache_refsys') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("refsys"))) {
83                 $GLOBALS['cache_instance']->destroyCacheFile();
84         }
85
86         // Save configuration
87         ADMIN_SAVE_SETTINGS_POST();
88 } else {
89         // Prepare data
90         switch (getConfig('cache_admins')) {
91                 case "Y":
92                         define('__ADMINS_Y', " checked=\"checked\"");
93                         define('__ADMINS_N', "");
94                         break;
95
96                 case "N":
97                         define('__ADMINS_Y', "");
98                         define('__ADMINS_N', " checked=\"checked\"");
99                         break;
100         }
101
102         switch (getConfig('cache_acls')) {
103                 case "Y":
104                         define('__ACLS_Y', " checked=\"checked\"");
105                         define('__ACLS_N', "");
106                         break;
107
108                 case "N":
109                         define('__ACLS_Y', "");
110                         define('__ACLS_N', " checked=\"checked\"");
111                         break;
112         }
113
114         switch (getConfig('cache_exts')) {
115                 case "Y":
116                         define('__EXTS_Y', " checked=\"checked\"");
117                         define('__EXTS_N', "");
118                         break;
119
120                 case "N":
121                         define('__EXTS_Y', "");
122                         define('__EXTS_N', " checked=\"checked\"");
123                         break;
124         }
125
126         switch (getConfig('cache_config')) {
127                 case "Y":
128                         define('__CONFIG_Y', " checked=\"checked\"");
129                         define('__CONFIG_N', "");
130                         break;
131
132                 case "N":
133                         define('__CONFIG_Y', "");
134                         define('__CONFIG_N', " checked=\"checked\"");
135                         break;
136         }
137
138         switch (getConfig('cache_modreg')) {
139                 case "Y":
140                         define('__MODREG_Y', " checked=\"checked\"");
141                         define('__MODREG_N', "");
142                         break;
143
144                 case "N":
145                         define('__MODREG_Y', "");
146                         define('__MODREG_N', " checked=\"checked\"");
147                         break;
148         }
149
150         switch (getConfig('cache_refdepth')) {
151                 case "Y":
152                         define('__REFDEPTH_Y', " checked=\"checked\"");
153                         define('__REFDEPTH_N', "");
154                         break;
155
156                 case "N":
157                         define('__REFDEPTH_Y', "");
158                         define('__REFDEPTH_N', " checked=\"checked\"");
159                         break;
160         }
161
162         switch (getConfig('cache_refsys')) {
163                 case "Y":
164                         define('__REFSYS_Y', " checked=\"checked\"");
165                         define('__REFSYS_N', "");
166                         break;
167
168                 case "N":
169                         define('__REFSYS_Y', "");
170                         define('__REFSYS_N', " checked=\"checked\"");
171                         break;
172         }
173
174         switch (getConfig('cache_themes')) {
175                 case "Y":
176                         define('__THEMES_Y', " checked=\"checked\"");
177                         define('__THEMES_N', "");
178                         break;
179
180                 case "N":
181                         define('__THEMES_Y', "");
182                         define('__THEMES_N', " checked=\"checked\"");
183                         break;
184         }
185
186         switch (getConfig('cache_admin_menu')) {
187                 case "Y":
188                         define('__ADMIN_MENU_Y', " checked=\"checked\"");
189                         define('__ADMIN_MENU_N', "");
190                         break;
191
192                 case "N":
193                         define('__ADMIN_MENU_Y', "");
194                         define('__ADMIN_MENU_N', " checked=\"checked\"");
195                         break;
196         }
197
198         define('__PATH', getConfig('cache_path'));
199
200         // Load template
201         LOAD_TEMPLATE("admin_config_cache");
202 }
203
204 //
205 ?>