]> git.mxchange.org Git - mailer.git/blob - inc/modules/admin/what-config_cache.php
Editing of bank packages added (updating records not finished!)
[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 ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
36 {
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
38         require($INC);
39 }
40 // Add description as navigation point
41 ADD_DESCR("admin", basename(__FILE__));
42
43 if (isset($_POST['ok']))
44 {
45         // Cache path has been not changed by default so don't test it again
46         $_POST['cache_tested'] = 'N';
47
48         // Check if path has been changed
49         if ($_POST['cache_path'] != $_CONFIG['cache_path'])
50         {
51                 // Okay, cache path has been altered so we have to test it again!
52                 $_POST['cache_tested'] = 'Y';
53         }
54
55         // Delete deactivated cache files
56         if (($_POST['cache_admins'] == 'N') && ($cacheInstance->cache_file("admins", true)))
57         {
58                 $cacheInstance->cache_destroy();
59         }
60         if (($_POST['cache_acls'] == 'N') && ($cacheInstance->cache_file("acls", true)))
61         {
62                 $cacheInstance->cache_destroy();
63         }
64         if (($_POST['cache_exts'] == 'N') && ($cacheInstance->cache_file("extensions", true)))
65         {
66                 $cacheInstance->cache_destroy();
67         }
68         if (($_POST['cache_config'] == 'N') && ($cacheInstance->cache_file("config", true)))
69         {
70                 $cacheInstance->cache_destroy();
71         }
72         if (($_POST['cache_modreg'] == 'N') && ($cacheInstance->cache_file("modreg", true)))
73         {
74                 $cacheInstance->cache_destroy();
75         }
76         if (($_POST['cache_refdepth'] == 'N') && ($cacheInstance->cache_file("refdepth", true)))
77         {
78                 $cacheInstance->cache_destroy();
79         }
80         if (($_POST['cache_refsys'] == 'N') && ($cacheInstance->cache_file("refsys", true)))
81         {
82                 $cacheInstance->cache_destroy();
83         }
84
85         // Save configuration
86         ADMIN_SAVE_SETTINGS($_POST);
87 }
88  else
89 {
90         // Prepare data
91         switch ($_CONFIG['cache_admins'])
92         {
93                 case 'Y': define('__ADMINS_Y', ' checked'); define('__ADMINS_N', "");         break;
94                 case 'N': define('__ADMINS_Y', "");         define('__ADMINS_N', ' checked'); break;
95         }
96         switch ($_CONFIG['cache_acls'])
97         {
98                 case 'Y': define('__ACLS_Y', ' checked'); define('__ACLS_N', "");         break;
99                 case 'N': define('__ACLS_Y', "");         define('__ACLS_N', ' checked'); break;
100         }
101         switch ($_CONFIG['cache_exts'])
102         {
103                 case 'Y': define('__EXTS_Y', ' checked'); define('__EXTS_N', "");         break;
104                 case 'N': define('__EXTS_Y', "");         define('__EXTS_N', ' checked'); break;
105         }
106         switch ($_CONFIG['cache_config'])
107         {
108                 case 'Y': define('__CONFIG_Y', ' checked'); define('__CONFIG_N', "");         break;
109                 case 'N': define('__CONFIG_Y', "");         define('__CONFIG_N', ' checked'); break;
110         }
111         switch ($_CONFIG['cache_modreg'])
112         {
113                 case 'Y': define('__MODREG_Y', ' checked'); define('__MODREG_N', "");         break;
114                 case 'N': define('__MODREG_Y', "");         define('__MODREG_N', ' checked'); break;
115         }
116         switch ($_CONFIG['cache_refdepth'])
117         {
118                 case 'Y': define('__REFDEPTH_Y', ' checked'); define('__REFDEPTH_N', "");         break;
119                 case 'N': define('__REFDEPTH_Y', "");         define('__REFDEPTH_N', ' checked'); break;
120         }
121         switch ($_CONFIG['cache_refsys'])
122         {
123                 case 'Y': define('__REFSYS_Y', ' checked'); define('__REFSYS_N', "");         break;
124                 case 'N': define('__REFSYS_Y', "");         define('__REFSYS_N', ' checked'); break;
125         }
126         define('__PATH', $_CONFIG['cache_path']);
127
128         // Load template
129         LOAD_TEMPLATE("admin_config_cache");
130 }
131 //
132 ?>