<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}
if ($acces == 1) {
if($admintest && $adminsecu)  {

$file = fopen("".$cache."/Configuration/".$cache_prefix."_cMax_config.php", "w");
$content = "";
$content .= "<?php\n defined(\"MAXIMUS\") or  Header(\"Location: ../index.php\"); \n";
$content .= "\n";
$content .= "define( 'CACHE_VPLAN', '$vplan' );\n";
$content .= "define( 'CACHE_VCONTENT', '$vcontent' );\n";
$content .= "define( 'CACHE_VDOWNLOADS', '$vdownloads' );\n";
$content .= "define( 'CACHE_UDOWNLOADS', '$udownloads' );\n";
$content .= "define( 'CACHE_ADOWNLOADS', '$adownloads' );\n";
$content .= "define( 'CACHE_VENCYCLO', '$vencyclo' );\n";
$content .= "define( 'CACHE_VFAQ', '$vfaq' );\n";
$content .= "define( 'CACHE_VFAQ1', '$vfaq1' );\n";
$content .= "define( 'CACHE_VLINKS', '$vlinks' );\n";
$content .= "define( 'CACHE_VNEWS', '$vnews' );\n";
$content .= "define( 'CACHE_ANEWS', '$anews' );\n";
$content .= "define( 'CACHE_VANEWS', '$vanews' );\n";
$content .= "define( 'CACHE_AANEWS', '$aanews' );\n";
$content .= "define( 'CACHE_VREVIEWS', '$vreviews' );\n";
$content .= "define( 'CACHE_VSECTIONS', '$vsections' );\n";
$content .= "define( 'CACHE_USECTIONS', '$usections' );\n";
$content .= "define( 'CACHE_ASECTIONS', '$asections' );\n";
$content .= "define( 'CACHE_VARCHIVES', '$varchives' );\n";
$content .= "define( 'CACHE_VARCHIVES1', '$varchives1' );\n";
$content .= "define( 'CACHE_VARCHIVES2', '$varchives2' );\n";
$content .= "define( 'CACHE_VSUPPORTERS', '$vsupporters' );\n";
$content .= "define( 'CACHE_ASUPPORTERS', '$asupporters' );\n";
$content .= "define( 'CACHE_VTOP', '$vtop' );\n";
$content .= "define( 'CACHE_VTOPICS', '$vtopics' );\n";
$content .= "\n";
$content .= "define( 'CACHE_BL_BIG_STORY', '$blbigstory' );\n";
$content .= "define( 'CACHE_BL_AD_LEFTBA', '$bladleftba' );\n";
$content .= "define( 'CACHE_BL_AD_RIGHTBA', '$bladrightba' );\n";
$content .= "define( 'CACHE_BL_CATEGORIES', '$blcategories' );\n";
$content .= "define( 'CACHE_BL_CONTENT', '$blcontent' );\n";
$content .= "define( 'CACHE_BL_ENCYCLOP', '$blencyclop' );\n";
$content .= "define( 'CACHE_BL_FORUM', '$blforum' );\n";
$content .= "define( 'CACHE_BL_LANGUAGE', '$bllanguage' );\n";
$content .= "define( 'CACHE_BL_LAST5ARTICLES', '$bllastarticles' );\n";
$content .= "define( 'CACHE_BL_REFERER', '$blreferer' );\n";
$content .= "define( 'CACHE_BL_MAXWHOISONLINE', '$blmaxwhoisonline' );\n";
$content .= "define( 'CACHE_BL_MODULES', '$blmodules' );\n";
$content .= "define( 'CACHE_BL_NSNGDACCESS', '$blnsngdaccess' );\n";
$content .= "define( 'CACHE_BL_NSNGDHOT', '$blnsngdhot' );\n";
$content .= "define( 'CACHE_BL_NSNGDNEW', '$blnsngdnew' );\n";
$content .= "define( 'CACHE_BL_OLDARTICLES', '$bloldarticles' );\n";
$content .= "define( 'CACHE_BL_REVIEWS', '$blreviews' );\n";
$content .= "define( 'CACHE_BL_SCROLLSENTINEL', '$blscrollsentinel' );\n";
$content .= "define( 'CACHE_BL_SENTINEL', '$blsentinel' );\n";
$content .= "define( 'CACHE_BL_SUPPORTERDN', '$blsupporterdn' );\n";
$content .= "define( 'CACHE_BL_SUPPORTERSLT', '$blsupporterslt' );\n";
$content .= "define( 'CACHE_BL_SUPPORTERSRN', '$blsupportersrn' );\n";
$content .= "define( 'CACHE_BL_SUPPORTERSRT', '$blsupportersrt' );\n";
$content .= "define( 'CACHE_BL_SUPPORTERSUP', '$blsupportersup' );\n";
$content .= "define( 'CACHE_BL_SURVEYS', '$blsurveys' );\n";
$content .= "define( 'CACHE_BL_TOP10LINKS', '$bltop10links' );\n";
$content .= "define( 'CACHE_BL_TOTALHITS', '$bltotalhits' );\n";
$content .= "define( 'CACHE_BL_USERINFO', '$bluserinfo' );\n";
$content .= "define( 'CACHE_BL_USERMENU', '$blusermenu' );\n";
$content .= "define( 'CACHE_BL_WHOISWHERE', '$blwhoiswhere' );\n";

fwrite($file, $content);
fclose($file);


if ( $folder == 'blocks' ) {
	redirect_url("".$admin_file.".php?op=cMaxCache_Blocks");
} else {
	redirect_url("".$admin_file.".php?op=cMaxCache_Modules");
}

}
}else {
	echo "Access Denied";
}