<?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)  {
		$active = $GLOBALS['db']->XMFbin($active);
		$mid    = $GLOBALS['db']->XMFnum($mid);
		$xmodule = stripslashes($xmodule);
		$GLOBALS['db']->sql_query("UPDATE `".TABLE_MODULES."` SET `active`='$active' WHERE `mid`='$mid'");

if ($active == 0) {
$GLOBALS['db']->sql_query("DELETE FROM `".TABLE_BLOCKSMANAGER."` WHERE title='$xmodule' ");
$GLOBALS['db']->sql_query("UPDATE `".TABLE_MODULES."` SET `active`='1', `view`='0', `inmenu`='1', `install`='1' WHERE `title`='Copyrights'");
$GLOBALS['db']->sql_query("OPTIMIZE TABLE ".TABLE_MODULES." ");
$GLOBALS['db']->sql_query("OPTIMIZE TABLE ".TABLE_BLOCKSMANAGER." ");
}
		redirect_url("".$admin_file.".php?op=modules");

}
}else {
	echo "Access Denied";
}