<?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($view == 4) { $ingroups = implode("-",$groups); }
    if($view < 4) { $ingroups = ""; }
    $mid = $GLOBALS['db']->XMFnum($mid);
    if ($view != 1) { $mod_group = 0; }
    $result = $GLOBALS['db']->sql_query("UPDATE `".TABLE_MODULES."` SET `custom_title`='$custom_title', `view`='$view', `groups`='$ingroups', `inmenu`='$inmenu', `mod_group`='$mod_group' WHERE `mid`='$mid'");
    $result = $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."` ");
    redirect_url("".$admin_file.".php?op=modules");
}
} else {
	echo "Access Denied";
}