Fixes for stripped HTML tags, and false warnings in debug log
[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  *                                                                      *
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", __FILE__);
42
43 if (IS_FORM_SENT()) {
44         // Cache path has been not changed by default so don't test it again
45         REQUEST_SET_POST('cache_tested', "N");
46
47         // Check if path has been changed
48         if (REQUEST_POST('cache_path') != getConfig('cache_path')) {
49                 // Okay, cache path has been altered so we have to test it again!
50                 REQUEST_SET_POST('cache_tested', "Y");
51         }
52
53         if ((REQUEST_POST('cache_admins') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("admins"))) {
54                 $GLOBALS['cache_instance']->destroyCacheFile();
55         }
56
57         if ((REQUEST_POST('cache_acls') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("acls"))) {
58                 $GLOBALS['cache_instance']->destroyCacheFile();
59         }
60
61         if ((REQUEST_POST('cache_exts') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("extensions", true))) {
62                 $GLOBALS['cache_instance']->destroyCacheFile();
63         }
64
65         if ((REQUEST_POST('cache_config') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("config"))) {
66                 $GLOBALS['cache_instance']->destroyCacheFile();
67         }
68
69         if ((REQUEST_POST('cache_modreg') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("modreg"))) {
70                 $GLOBALS['cache_instance']->destroyCacheFile();
71         }
72
73         if ((REQUEST_POST('cache_refdepth') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("refdepth"))) {
74                 $GLOBALS['cache_instance']->destroyCacheFile();
75         }
76
77         if ((REQUEST_POST('cache_refsys') == "N") && ($GLOBALS['cache_instance']->loadCacheFile("refsys"))) {
78                 $GLOBALS['cache_instance']->destroyCacheFile();
79         }
80
81         // Save configuration
82         ADMIN_SAVE_SETTINGS_POST();
83 } else {
84         // Prepare data
85         switch (getConfig('cache_admins')) {
86                 case "Y":
87                         define('__ADMINS_Y', " checked=\"checked\"");
88                         define('__ADMINS_N', "");
89                         break;
90
91                 case "N":
92                         define('__ADMINS_Y', "");
93                         define('__ADMINS_N', " checked=\"checked\"");
94                         break;
95         }
96
97         switch (getConfig('cache_acls')) {
98                 case "Y":
99                         define('__ACLS_Y', " checked=\"checked\"");
100                         define('__ACLS_N', "");
101                         break;
102
103                 case "N":
104                         define('__ACLS_Y', "");
105                         define('__ACLS_N', " checked=\"checked\"");
106                         break;
107         }
108
109         switch (getConfig('cache_exts')) {
110                 case "Y":
111                         define('__EXTS_Y', " checked=\"checked\"");
112                         define('__EXTS_N', "");
113                         break;
114
115                 case "N":
116                         define('__EXTS_Y', "");
117                         define('__EXTS_N', " checked=\"checked\"");
118                         break;
119         }
120
121         switch (getConfig('cache_config')) {
122                 case "Y":
123                         define('__CONFIG_Y', " checked=\"checked\"");
124                         define('__CONFIG_N', "");
125                         break;
126
127                 case "N":
128                         define('__CONFIG_Y', "");
129                         define('__CONFIG_N', " checked=\"checked\"");
130                         break;
131         }
132
133         switch (getConfig('cache_modreg')) {
134                 case "Y":
135                         define('__MODREG_Y', " checked=\"checked\"");
136                         define('__MODREG_N', "");
137                         break;
138
139                 case "N":
140                         define('__MODREG_Y', "");
141                         define('__MODREG_N', " checked=\"checked\"");
142                         break;
143         }
144
145         switch (getConfig('cache_refdepth')) {
146                 case "Y":
147                         define('__REFDEPTH_Y', " checked=\"checked\"");
148                         define('__REFDEPTH_N', "");
149                         break;
150
151                 case "N":
152                         define('__REFDEPTH_Y', "");
153                         define('__REFDEPTH_N', " checked=\"checked\"");
154                         break;
155         }
156
157         switch (getConfig('cache_refsys')) {
158                 case "Y":
159                         define('__REFSYS_Y', " checked=\"checked\"");
160                         define('__REFSYS_N', "");
161                         break;
162
163                 case "N":
164                         define('__REFSYS_Y', "");
165                         define('__REFSYS_N', " checked=\"checked\"");
166                         break;
167         }
168
169         switch (getConfig('cache_themes')) {
170                 case "Y":
171                         define('__THEMES_Y', " checked=\"checked\"");
172                         define('__THEMES_N', "");
173                         break;
174
175                 case "N":
176                         define('__THEMES_Y', "");
177                         define('__THEMES_N', " checked=\"checked\"");
178                         break;
179         }
180
181         switch (getConfig('cache_admin_menu')) {
182                 case "Y":
183                         define('__ADMIN_MENU_Y', " checked=\"checked\"");
184                         define('__ADMIN_MENU_N', "");
185                         break;
186
187                 case "N":
188                         define('__ADMIN_MENU_Y', "");
189                         define('__ADMIN_MENU_N', " checked=\"checked\"");
190                         break;
191         }
192
193         define('__PATH', getConfig('cache_path'));
194
195         // Load template
196         LOAD_TEMPLATE("admin_config_cache");
197 }
198
199 //
200 ?>