(no commit message)
[mailer.git] / 0.2.1 / inc / modules / admin / what-config_cache.php
1 <?php\r
2 /************************************************************************\r
3  * MXChange v0.2.1                                    Start: 01/29/2006 *\r
4  * ================                             Last change: 01/29/2006 *\r
5  *                                                                      *\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
13  *                                                                      *\r
14  * -------------------------------------------------------------------- *\r
15  * Copyright (c) 2003 - 2007 by Roland Haeder                           *\r
16  * For more information visit: http://www.mxchange.org                  *\r
17  *                                                                      *\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
22  *                                                                      *\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
27  *                                                                      *\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
33 \r
34 // Some security stuff...\r
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))\r
36 {\r
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";\r
38         require($INC);\r
39 }\r
40 // Add description as navigation point\r
41 ADD_DESCR("admin", basename(__FILE__));\r
42 \r
43 if (isset($_POST['ok']))\r
44 {\r
45         // Cache path has been not changed by default so don't test it again\r
46         $_POST['cache_tested'] = "N";\r
47 \r
48         // Check if path has been changed\r
49         if ($_POST['cache_path'] != $CONFIG['cache_path'])\r
50         {\r
51                 // Okay, cache path has been altered so we have to test it again!\r
52                 $_POST['cache_tested'] = "Y";\r
53         }\r
54 \r
55         // Delete deactivated cache files\r
56         if (($_POST['cache_admins'] == "N") && ($CACHE->cache_file("admins", true)))\r
57         {\r
58                 $CACHE->cache_destroy();\r
59         }\r
60         if (($_POST['cache_acls'] == "N") && ($CACHE->cache_file("acls", true)))\r
61         {\r
62                 $CACHE->cache_destroy();\r
63         }\r
64         if (($_POST['cache_exts'] == "N") && ($CACHE->cache_file("extensions", true)))\r
65         {\r
66                 $CACHE->cache_destroy();\r
67         }\r
68         if (($_POST['cache_config'] == "N") && ($CACHE->cache_file("config", true)))\r
69         {\r
70                 $CACHE->cache_destroy();\r
71         }\r
72         if (($_POST['cache_modreg'] == "N") && ($CACHE->cache_file("modreg", true)))\r
73         {\r
74                 $CACHE->cache_destroy();\r
75         }\r
76         if (($_POST['cache_refdepth'] == "N") && ($CACHE->cache_file("refdepth", true)))\r
77         {\r
78                 $CACHE->cache_destroy();\r
79         }\r
80         if (($_POST['cache_refsys'] == "N") && ($CACHE->cache_file("refsys", true)))\r
81         {\r
82                 $CACHE->cache_destroy();\r
83         }\r
84 \r
85         // Save configuration\r
86         ADMIN_SAVE_SETTINGS($_POST, "_config", "config='0'");\r
87 }\r
88  else\r
89 {\r
90         // Prepare data\r
91         switch ($CONFIG['cache_admins'])\r
92         {\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
95         }\r
96         switch ($CONFIG['cache_acls'])\r
97         {\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
100         }\r
101         switch ($CONFIG['cache_exts'])\r
102         {\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
105         }\r
106         switch ($CONFIG['cache_config'])\r
107         {\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
110         }\r
111         switch ($CONFIG['cache_modreg'])\r
112         {\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
115         }\r
116         switch ($CONFIG['cache_refdepth'])\r
117         {\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
120         }\r
121         switch ($CONFIG['cache_refsys'])\r
122         {\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
125         }\r
126         define('__PATH', $CONFIG['cache_path']);\r
127 \r
128         // Load template\r
129         LOAD_TEMPLATE("admin_config_cache");\r
130 }\r
131 //\r
132 ?>\r