<?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();
    $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>"._SAJOURNAL."</b></font><br /><br /><table border=\"1\" width=\"100%\" bgcolor=\"$bgcolor1\">"
	."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._ID."</b></td>"
	."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._IP."</b></td>"
	."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._HOSTNAME."</b></td>"
	."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._DATE."</b></td>"
	."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._TIME."</b></td>"
	."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._NAME."</b></td>"
	."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._AGENT."</b></td>"
	."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._OS."</b></td>";
if ($active_ban == 1) {
echo "<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._BAN."</b></td>";
}
    echo "<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._FUNCTION."</b></td></tr>";
    $lresult = $db->sql_query("select `idlogs`, `logs_ip`, `logs_hostname`, `logs_date`, `logs_time`, `logs_name`, `logs_agent`, `logs_os`, `logs_ban` from ".TABLE_NSNSECUREADMIN_LOGS." ORDER by `logs_date` desc");
    while(list($idlogs, $logs_ip, $logs_hostname, $logs_date, $logs_time, $logs_name, $logs_agent, $logs_os, $logs_ban) = $db->sql_fetchrow($lresult)) {




	echo "<tr><td align=\"center\" width=\"5%\"><b>$idlogs</b>"
	    ."</td><td align=\"center\" width=\"20%\"><b>$logs_ip</b>"
            ."</td><td align=\"center\" width=\"20%\"><b>$logs_hostname</b>"
	    ."</td><td align=\"center\" width=\"20%\">$logs_date</a>"
	    ."</td><td align=\"center\" width=\"20%\"><b>$logs_time</b>"
	    ."</td><td align=\"center\" width=\"20%\"><b>$logs_name</b>"
	    ."</td><td align=\"center\" width=\"20%\"><b>$logs_agent</b>"
	    ."</td><td align=\"center\" width=\"20%\"><b>$logs_os</b>";
if ($active_ban == 1) {
echo "</td><td align=\"center\" width=\"20%\"><b>$logs_ban</b>";
}
	 echo "</td><td align=\"center\" width=\"20%\"><a href=\"".$admin_file.".php?op=deletensnsecureadminjournal&idlogs=$idlogs\">" . _DELETE . "</a>"
	    ."</td></tr>";
    }
    echo "</table></center><br />"
        ."<form action=\"".$admin_file.".php?op=deletensnsecureadminalljournal\" method=\"post\">"
	."<input type=\"hidden\" value=\"".$admin_file.".php?op=deletensnsecureadminalljournal\">"
	."<center><input type=\"submit\" value=\""._DELETELIST."\"></center>"
        ."<br /><CENTER><a href=\"_GOBACK\">"._GOBACK."</A></CENTER>";

    Max_CloseTable();

    incof();


}
}else {
	echo "Access Denied";
}