<?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)  {

if ((!is_god($admin)) && (!is_user($user)) && (!is_admin($admin))) { redirect_url("".$admin_file.".php?op=modules"); }
$db2 = $db;
$prefix_install = $prefix;
define("INSTALL_MODULES", true);
global $currentlang;
if (file_exists("modules/$moduleinstall/max_sql/$currentlang/$moduleinstall-install.php")) {
	include_once ("modules/$moduleinstall/max_sql/$currentlang/$moduleinstall-install.php");
} elseif (file_exists("modules/$moduleinstall/max_sql/$moduleinstall-install.php")) {
	include_once ("modules/$moduleinstall/max_sql/$moduleinstall-install.php");
}

unset($db2);
unset($prefix_install);
$result = $db->sql_query("UPDATE `".TABLE_MODULES."` set `install`='1', `active`='0', `inmenu`='0' WHERE `mid`='$mid'");
define("INSTALL_MODULES", false);
$db->sql_query("OPTIMIZE TABLE `".TABLE_MODULES."` ");
redirect_url("".$admin_file.".php?op=modules");

}
} else {
	echo "Access Denied";
}