<?php
// ----------------------------------------------------------------------
// Copyright (C) 2007 by GREGORY LE BRAS
// ----------------------------------------------------------------------
// LICENSE
//
// This file is part of ODCNMS - Open DataCenter Network Management System
//
// ODCNMS 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, or
// (at your option) any later version.
//
// Foobar is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Foobar; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// ----------------------------------------------------------------------
// Original Author of file: GREGORY LE BRAS - http://www.odcnms.org/
// ----------------------------------------------------------------------
$request=mysql_query("SELECT administrator FROM $name_table_users WHERE username=\"$login\"") or die ("ERROR!");
while($tmp_request=mysql_fetch_array($request))
{
$user_privilege = $tmp_request['administrator'];
}
if ($user_privilege=="2")
{
// Control dynamic style sheet
$styleBodyIndent=true;
$styleBodyBGcolor="#ededed";
if (file_exists( 'TreeMenuXL.php' ))
include_once( 'TreeMenuXL.php' );
else
include_once( $_SERVER['DOCUMENT_ROOT'] . '/bin/TreeMenuXL.php' );
// Menu00 -- Based on the original example
// Should be as basic as possible.
$menu00 = new HTML_TreeMenuXL();
$node0 = new HTML_TreeNodeXL(" ".TXT_CONFIGURATION, "index.php?include=administration&page=configuration", array("icon"=>"configuration.gif"));
$node1 = new HTML_TreeNodeXL (" ".TXT_USER, "index.php?include=administration&page=user", array("icon"=>"user.gif"));
$menu00->addItem($node0);
$menu00->addItem($node1);
?>
<table id="configurationcontainer" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="configurationmenu">
<?php
$example010 = &new HTML_TreeMenu_DHTMLXL($menu00, array("images"=>"images"));
$example010->printMenu();
?>
</td>
<td id="configurationcontent">
<?php if (empty($page)) $page = "mainpage"; if (strlen($page) > 50) $page = "pagenotfound"; else if (!file_exists("include/administration_page/".$page.".php")) $page = "pagenotfound"; include("include/administration_page/".$page.".php"); ?>
</td>
</tr>
</table>
<?php
}
else
{
echo "<center><div id=\"status\" style=\"color:red\"><img src=\"images/forbidden.png\" alt=\"FORBIDDEN\"><br><br>";
echo TXT_FORBIDDEN_ACTION;
echo "</div></center>";
}
?>