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

    incoh();

    $id = $db->XMFnum($id);
    $sql = "SELECT `graphic_admin` from `".TABLE_NSNSECUREADMIN_CONFIG."`";
    if ( !($graf = $db->sql_query($sql)) )
{ query_die(GENERAL_ERROR, 'Could not obtain config nsnsecureadmin', '', __LINE__, __FILE__, $sql);}
    $row = $db->sql_fetchrow($graf);
    $grafic_admin = $db->XMFnum($row['graphic_admin']);

    if ($grafic_admin == 1) { GraphicAdmin();}

    nsnsecureadminmenu();

    Max_OpenTable();
    echo "<center><font class='title'><b>"._SECUREADMIN."</b></font></center>";
    Max_CloseTable();

    br('1');
    $row = $db->sql_fetchrow($db->sql_query("SELECT `id`, `name`, `ipfixe`, `host` from `".TABLE_NSNSECUREADMIN."` WHERE `id`='$id'"));
    $name   = stripslashes($row['name']);
    $ipfixe = stripslashes($row['ipfixe']);
    $host   = stripslashes($row['host']);

    Max_OpenTable();
    echo "<center><font class='title'><b>"._EDITNAME."</b></font></center>";
    $logs_ip   = getenv("REMOTE_ADDR");
    $logs_host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
    echo "<center><font color='red'>"._YOURIP." : $logs_ip   &nbsp;&nbsp;-&nbsp;&nbsp;  "._YOURHOST." : $logs_host</font></center><br />";
    echo "<center><form action=\"".$admin_file.".php\" method=\"post\">"
	."<br /><b>"._NAME.":&nbsp;&nbsp;</b>";
if ($id =='1'){
    echo "<font size='2'><input type=\"hidden\" name=\"name\" value=\"$name\">$name</font><br /><br />";}
else {echo "<input type=\"text\" name=\"name\" value=\"$name\" size=\"50\" maxlength=\"50\"><br /><br />";}
    echo "<br /><b>"._HOSTFIXE.":&nbsp;&nbsp;</b>"
	."<input type=\"text\" name=\"host2\" value=\"$host\" size=\"50\" maxlength=\"50\"><br /><i>"._HOSTCOMM."</i><br />"
        . "<br /><b>"._IPFIXE.":&nbsp;&nbsp;</b>"
	."<input type=\"text\" name=\"ipfixe\" value=\"$ipfixe\" size=\"50\" maxlength=\"50\"><br /><i>"._IPFIXECOMM."</i><br /><br />"
	."<input type=\"hidden\" name=\"id\" value=\"$id\">"
	."<input type=\"hidden\" name=\"op\" value=\"savensnsecureadmin\">"
	."<br /><input type=\"submit\" value=\"" . _SAVECHANGES . "\">"
	."</form></center>";
	echo "<center><a href=\"_GOBACK\">"._GOBACK."</A></center>";
    Max_CloseTable();

    incof();


}
}else {
	echo "Access Denied";
}