<?php
/*
 * @version $Id: HEADER 15930 2011-10-30 15:47:55Z tsmr $
 -------------------------------------------------------------------------
 Eventlog plugin for GLPI
 Copyright (C) 2003-2011 by the Eventlog Development Team.

 https://forge.indepnet.net/projects/eventlog
 -------------------------------------------------------------------------

 LICENSE
		
 This file is part of Eventlog.

 Eventlog 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.

 Eventlog 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 Eventlog. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
 */

define('GLPI_ROOT', '../../..');
include (GLPI_ROOT."/inc/includes.php");

if (isset($_GET)) $tab = $_GET;
if (empty($tab) && isset($_POST)) $tab = $_POST;
if (empty($tab["id"])) $tab["id"] = "";
if (empty($tab["eventlogservers_id"])) $tab["eventlogservers_id"] = "";
if (empty($tab["computer"])) $tab["computer"] = "";

$eventlog = new PluginEventlogEventlog();

if (isset($_POST["delete"])) {

	$eventlog->deleteEvent($tab["id"],$tab["eventlogservers_id"]);
	Html::redirect(Toolbox::getItemTypeFormURL('PluginEventlogEventlog').
	"?eventlogservers_id=".$_POST["eventlogservers_id"]."&computer=".$_POST["computer"]."&acked=0");

} else {

	$eventlog->checkGlobal("r");

	Html::header($LANG['plugin_eventlog']['title'][0],'',"plugins","eventlog");

	$eventlog->showForm($_GET["id"], array('eventlogservers_id' => $_GET["eventlogservers_id"]));

	Html::footer();
}

?>