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 ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // Add description as navigation point
41 ADD_DESCR("admin", basename(__FILE__));
43 if (isset($_POST['ok']))
45 // Cache path has been not changed by default so don't test it again
46 $_POST['cache_tested'] = 'N';
48 // Check if path has been changed
49 if ($_POST['cache_path'] != $_CONFIG['cache_path'])
51 // Okay, cache path has been altered so we have to test it again!
52 $_POST['cache_tested'] = 'Y';
55 // Delete deactivated cache files
56 if (($_POST['cache_admins'] == 'N') && ($cacheInstance->cache_file("admins", true)))
58 $cacheInstance->cache_destroy();
60 if (($_POST['cache_acls'] == 'N') && ($cacheInstance->cache_file("acls", true)))
62 $cacheInstance->cache_destroy();
64 if (($_POST['cache_exts'] == 'N') && ($cacheInstance->cache_file("extensions", true)))
66 $cacheInstance->cache_destroy();
68 if (($_POST['cache_config'] == 'N') && ($cacheInstance->cache_file("config", true)))
70 $cacheInstance->cache_destroy();
72 if (($_POST['cache_modreg'] == 'N') && ($cacheInstance->cache_file("modreg", true)))
74 $cacheInstance->cache_destroy();
76 if (($_POST['cache_refdepth'] == 'N') && ($cacheInstance->cache_file("refdepth", true)))
78 $cacheInstance->cache_destroy();
80 if (($_POST['cache_refsys'] == 'N') && ($cacheInstance->cache_file("refsys", true)))
82 $cacheInstance->cache_destroy();
86 ADMIN_SAVE_SETTINGS($_POST);
91 switch ($_CONFIG['cache_admins'])
93 case 'Y': define('__ADMINS_Y', ' checked'); define('__ADMINS_N', ""); break;
94 case 'N': define('__ADMINS_Y', ""); define('__ADMINS_N', ' checked'); break;
96 switch ($_CONFIG['cache_acls'])
98 case 'Y': define('__ACLS_Y', ' checked'); define('__ACLS_N', ""); break;
99 case 'N': define('__ACLS_Y', ""); define('__ACLS_N', ' checked'); break;
101 switch ($_CONFIG['cache_exts'])
103 case 'Y': define('__EXTS_Y', ' checked'); define('__EXTS_N', ""); break;
104 case 'N': define('__EXTS_Y', ""); define('__EXTS_N', ' checked'); break;
106 switch ($_CONFIG['cache_config'])
108 case 'Y': define('__CONFIG_Y', ' checked'); define('__CONFIG_N', ""); break;
109 case 'N': define('__CONFIG_Y', ""); define('__CONFIG_N', ' checked'); break;
111 switch ($_CONFIG['cache_modreg'])
113 case 'Y': define('__MODREG_Y', ' checked'); define('__MODREG_N', ""); break;
114 case 'N': define('__MODREG_Y', ""); define('__MODREG_N', ' checked'); break;
116 switch ($_CONFIG['cache_refdepth'])
118 case 'Y': define('__REFDEPTH_Y', ' checked'); define('__REFDEPTH_N', ""); break;
119 case 'N': define('__REFDEPTH_Y', ""); define('__REFDEPTH_N', ' checked'); break;
121 switch ($_CONFIG['cache_refsys'])
123 case 'Y': define('__REFSYS_Y', ' checked'); define('__REFSYS_N', ""); break;
124 case 'N': define('__REFSYS_Y', ""); define('__REFSYS_N', ' checked'); break;
126 define('__PATH', $_CONFIG['cache_path']);
129 LOAD_TEMPLATE("admin_config_cache");