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

Max_OpenTable();
echo "<b>"._GESTIONMODULES."</b><br />";
echo "<table border='1' width='100%'><tr>";
echo "<td align='center'><b>"._FOLDERS."</b></td><td align='center'><b>"._RAPPORT."</b></td></tr><tr>";
echo "<td>&nbsp;&nbsp; modules</td>";

if (!file_exists("modules/index.html")) { 
	$a++; echo "<td>&nbsp;&nbsp;$imgno "._FILENOEXISTS."</td></tr>"; 
	} else { 
	echo "<td>&nbsp;&nbsp;$imgok  "._FILEINDEXEXIT."</td></tr>"; 

}
    $handle=opendir("modules");
     $tlist = "";
    while ($file = readdir($handle)) {
        if (!ereg("[.]",$file)) {
            $tlist .= "$file ";
        }
    }
    closedir($handle);
    $tlist = explode(" ", $tlist);
    sort($tlist);
    for ($i=0; $i < sizeof($tlist); $i++) {
        if($tlist[$i]!="") {
        echo "<tr><td valign='top'>&nbsp;&nbsp; modules/$tlist[$i]</td><td valign='top'>";

if (!file_exists("modules/$tlist[$i]/index.html")) {
	 $a++; echo "&nbsp;&nbsp;$imgno "._FILENOEXISTS." modules/$tlist[$i]/index.html <br />"; 
} else {
	echo "&nbsp;&nbsp;$imgok  "._FILEINDEXEXIT."<br />"; 
}

// admin
if ( is_dir("modules/$tlist[$i]/admin") ) {

	if (!file_exists("modules/$tlist[$i]/admin/index.html")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILEADMININDEXNOEXISTS."<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILEADMININDEXEXIT."<br />"; 
	}

	if ( $tlist[$i] != "Forums") {

	        if (!file_exists("modules/$tlist[$i]/admin/.htaccess")) { 
			$a++; echo "&nbsp;&nbsp;$imgno "._FILEADMINHTACCESSNOEXISTS."<br />"; 
		} else { 
			echo "&nbsp;&nbsp;$imgok  "._FILEADMINHTACCESSEXIT."<br />"; 
		}
	}
}
// images
if ( is_dir("modules/$tlist[$i]/images") ) {

 	if (!file_exists("modules/$tlist[$i]/images/index.html")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILENOEXISTS.": modules/$tlist[$i]/images/index.html<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILEINDEXEXIT."<br />"; 
	}
}
// includes
if ( is_dir("modules/$tlist[$i]/includes") ) {

	if (!file_exists("modules/$tlist[$i]/includes/index.html"))  { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILEINCLUDESINDEXNOEXISTS."<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILEINCLUDESINDEXEXIT."<br />"; 
	}
        
	if (!file_exists("modules/$tlist[$i]/includes/.htaccess")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILEINCLUDESHTACCESSNOEXISTS."<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILEINCLUDESHTACCESSEXIT."<br />"; 
	}
}
// language
if ( is_dir("modules/$tlist[$i]/language")) {
        if (!file_exists("modules/$tlist[$i]/language/index.html")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILELANGUAGEINDEXNOEXISTS."<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILELANGUAGEINDEXEXIT."<br />"; 
	}

        if (!file_exists("modules/$tlist[$i]/language/.htaccess")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILELANGUAGEHTACCESSNOEXISTS."<br />"; 
		} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILELANGUAGEHTACCESSEXIT."<br />"; 
	}
}
// max_sql
if ( is_dir("modules/$tlist[$i]/max_sql") ) {

	if (!file_exists("modules/$tlist[$i]/max_sql/index.html")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILEMAXSQLINDEXNOEXISTS."<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILEMAXSQLINDEXEXIT."<br />"; 
	}
        if (!file_exists("modules/$tlist[$i]/max_sql/.htaccess")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILEMAXSQLHTACCESSNOEXISTS."<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILEMAXSQLHTACCESSEXIT."<br />"; 
	}
}

// public
if ( is_dir("modules/$tlist[$i]/public") ) {

	if (!file_exists("modules/$tlist[$i]/public/index.html")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILEPUBLICINDEXNOEXISTS."<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILEPUBLICINDEXEXIT."<br />"; 
	}
        if (!file_exists("modules/$tlist[$i]/public/.htaccess")) { 
		$a++; echo "&nbsp;&nbsp;$imgno "._FILEPUBLICHTACCESSNOEXISTS."<br />"; 
	} else { 
		echo "&nbsp;&nbsp;$imgok  "._FILEPUBLICHTACCESSEXIT."<br />"; 
	}
}

}
echo "</td></tr>";

    }
    echo "</tr></table>";
Max_CloseTable();
echo "<br /><center><a href='javascript: self.close ()'>"._CLOSE_WINDOWS."</a></center>";
if ($a) { echo "<br /><center><font size='6' color='red'>"._WARNING."</FONT></center>"; }
die();

}
}else {
	echo "Access Denied";
}