2 /************************************************************************
3 * MXChange v0.2.1 Start: 01/29/2006 *
4 * ================ Last change: 01/29/2006 *
6 * -------------------------------------------------------------------- *
7 * File : what-config_cache.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Configuration for the caching system *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Konfiguration des Caching-Systems *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
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. *
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. *
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, *
32 ************************************************************************/
34 // Some security stuff...
35 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // Add description as navigation point
41 ADD_DESCR("admin", __FILE__);
43 if (isset($_POST['ok'])) {
44 // Cache path has been not changed by default so don't test it again
45 $_POST['cache_tested'] = "N";
47 // Check if path has been changed
48 if ($_POST['cache_path'] != getConfig('cache_path')) {
49 // Okay, cache path has been altered so we have to test it again!
50 $_POST['cache_tested'] = "Y";
53 // Delete deactivated cache files
54 if (($_POST['cache_admins'] == "N") && ($cacheInstance->loadCacheFile("admins"))) {
55 $cacheInstance->destroyCacheFile();
57 if (($_POST['cache_acls'] == "N") && ($cacheInstance->loadCacheFile("acls"))) {
58 $cacheInstance->destroyCacheFile();
60 if (($_POST['cache_exts'] == "N") && ($cacheInstance->loadCacheFile("extensions", true))) {
61 $cacheInstance->destroyCacheFile();
63 if (($_POST['cache_config'] == "N") && ($cacheInstance->loadCacheFile("config"))) {
64 $cacheInstance->destroyCacheFile();
66 if (($_POST['cache_modreg'] == "N") && ($cacheInstance->loadCacheFile("modreg"))) {
67 $cacheInstance->destroyCacheFile();
69 if (($_POST['cache_refdepth'] == "N") && ($cacheInstance->loadCacheFile("refdepth"))) {
70 $cacheInstance->destroyCacheFile();
72 if (($_POST['cache_refsys'] == "N") && ($cacheInstance->loadCacheFile("refsys"))) {
73 $cacheInstance->destroyCacheFile();
77 ADMIN_SAVE_SETTINGS($_POST);
80 switch (getConfig('cache_admins')) {
82 define('__ADMINS_Y', " checked=\"checked\"");
83 define('__ADMINS_N', "");
87 define('__ADMINS_Y', "");
88 define('__ADMINS_N', " checked=\"checked\"");
92 switch (getConfig('cache_acls')) {
94 define('__ACLS_Y', " checked=\"checked\"");
95 define('__ACLS_N', "");
99 define('__ACLS_Y', "");
100 define('__ACLS_N', " checked=\"checked\"");
104 switch (getConfig('cache_exts')) {
106 define('__EXTS_Y', " checked=\"checked\"");
107 define('__EXTS_N', "");
111 define('__EXTS_Y', "");
112 define('__EXTS_N', " checked=\"checked\"");
116 switch (getConfig('cache_config')) {
118 define('__CONFIG_Y', " checked=\"checked\"");
119 define('__CONFIG_N', "");
123 define('__CONFIG_Y', "");
124 define('__CONFIG_N', " checked=\"checked\"");
128 switch (getConfig('cache_modreg')) {
130 define('__MODREG_Y', " checked=\"checked\"");
131 define('__MODREG_N', "");
135 define('__MODREG_Y', "");
136 define('__MODREG_N', " checked=\"checked\"");
140 switch (getConfig('cache_refdepth')) {
142 define('__REFDEPTH_Y', " checked=\"checked\"");
143 define('__REFDEPTH_N', "");
147 define('__REFDEPTH_Y', "");
148 define('__REFDEPTH_N', " checked=\"checked\"");
152 switch (getConfig('cache_refsys')) {
154 define('__REFSYS_Y', " checked=\"checked\"");
155 define('__REFSYS_N', "");
159 define('__REFSYS_Y', "");
160 define('__REFSYS_N', " checked=\"checked\"");
164 switch (getConfig('cache_themes')) {
166 define('__THEMES_Y', " checked=\"checked\"");
167 define('__THEMES_N', "");
171 define('__THEMES_Y', "");
172 define('__THEMES_N', " checked=\"checked\"");
176 switch (getConfig('cache_admin_menu')) {
178 define('__ADMIN_MENU_Y', " checked=\"checked\"");
179 define('__ADMIN_MENU_N', "");
183 define('__ADMIN_MENU_Y', "");
184 define('__ADMIN_MENU_N', " checked=\"checked\"");
188 define('__PATH', getConfig('cache_path'));
191 LOAD_TEMPLATE("admin_config_cache");