2 /************************************************************************
\r
3 * MXChange v0.2.1 Start: 01/29/2006 *
\r
4 * ================ Last change: 01/29/2006 *
\r
6 * -------------------------------------------------------------------- *
\r
7 * File : what-config_cache.php *
\r
8 * -------------------------------------------------------------------- *
\r
9 * Short description : Configuration for the caching system *
\r
10 * -------------------------------------------------------------------- *
\r
11 * Kurzbeschreibung : Konfiguration des Caching-Systems *
\r
12 * -------------------------------------------------------------------- *
\r
14 * -------------------------------------------------------------------- *
\r
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
\r
16 * For more information visit: http://www.mxchange.org *
\r
18 * This program is free software; you can redistribute it and/or modify *
\r
19 * it under the terms of the GNU General Public License as published by *
\r
20 * the Free Software Foundation; either version 2 of the License, or *
\r
21 * (at your option) any later version. *
\r
23 * This program is distributed in the hope that it will be useful, *
\r
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
\r
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
\r
26 * GNU General Public License for more details. *
\r
28 * You should have received a copy of the GNU General Public License *
\r
29 * along with this program; if not, write to the Free Software *
\r
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
\r
31 * MA 02110-1301 USA *
\r
32 ************************************************************************/
\r
34 // Some security stuff...
\r
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
\r
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
\r
40 // Add description as navigation point
\r
41 ADD_DESCR("admin", basename(__FILE__));
\r
43 if (isset($_POST['ok']))
\r
45 // Cache path has been not changed by default so don't test it again
\r
46 $_POST['cache_tested'] = "N";
\r
48 // Check if path has been changed
\r
49 if ($_POST['cache_path'] != $CONFIG['cache_path'])
\r
51 // Okay, cache path has been altered so we have to test it again!
\r
52 $_POST['cache_tested'] = "Y";
\r
55 // Delete deactivated cache files
\r
56 if (($_POST['cache_admins'] == "N") && ($CACHE->cache_file("admins", true)))
\r
58 $CACHE->cache_destroy();
\r
60 if (($_POST['cache_acls'] == "N") && ($CACHE->cache_file("acls", true)))
\r
62 $CACHE->cache_destroy();
\r
64 if (($_POST['cache_exts'] == "N") && ($CACHE->cache_file("extensions", true)))
\r
66 $CACHE->cache_destroy();
\r
68 if (($_POST['cache_config'] == "N") && ($CACHE->cache_file("config", true)))
\r
70 $CACHE->cache_destroy();
\r
72 if (($_POST['cache_modreg'] == "N") && ($CACHE->cache_file("modreg", true)))
\r
74 $CACHE->cache_destroy();
\r
76 if (($_POST['cache_refdepth'] == "N") && ($CACHE->cache_file("refdepth", true)))
\r
78 $CACHE->cache_destroy();
\r
80 if (($_POST['cache_refsys'] == "N") && ($CACHE->cache_file("refsys", true)))
\r
82 $CACHE->cache_destroy();
\r
85 // Save configuration
\r
86 ADMIN_SAVE_SETTINGS($_POST, "_config", "config='0'");
\r
91 switch ($CONFIG['cache_admins'])
\r
93 case "Y": define('__ADMINS_Y', " checked"); define('__ADMINS_N', ""); break;
\r
94 case "N": define('__ADMINS_Y', ""); define('__ADMINS_N', " checked"); break;
\r
96 switch ($CONFIG['cache_acls'])
\r
98 case "Y": define('__ACLS_Y', " checked"); define('__ACLS_N', ""); break;
\r
99 case "N": define('__ACLS_Y', ""); define('__ACLS_N', " checked"); break;
\r
101 switch ($CONFIG['cache_exts'])
\r
103 case "Y": define('__EXTS_Y', " checked"); define('__EXTS_N', ""); break;
\r
104 case "N": define('__EXTS_Y', ""); define('__EXTS_N', " checked"); break;
\r
106 switch ($CONFIG['cache_config'])
\r
108 case "Y": define('__CONFIG_Y', " checked"); define('__CONFIG_N', ""); break;
\r
109 case "N": define('__CONFIG_Y', ""); define('__CONFIG_N', " checked"); break;
\r
111 switch ($CONFIG['cache_modreg'])
\r
113 case "Y": define('__MODREG_Y', " checked"); define('__MODREG_N', ""); break;
\r
114 case "N": define('__MODREG_Y', ""); define('__MODREG_N', " checked"); break;
\r
116 switch ($CONFIG['cache_refdepth'])
\r
118 case "Y": define('__REFDEPTH_Y', " checked"); define('__REFDEPTH_N', ""); break;
\r
119 case "N": define('__REFDEPTH_Y', ""); define('__REFDEPTH_N', " checked"); break;
\r
121 switch ($CONFIG['cache_refsys'])
\r
123 case "Y": define('__REFSYS_Y', " checked"); define('__REFSYS_N', ""); break;
\r
124 case "N": define('__REFSYS_Y', ""); define('__REFSYS_N', " checked"); break;
\r
126 define('__PATH', $CONFIG['cache_path']);
\r
129 LOAD_TEMPLATE("admin_config_cache");
\r