Location: PHPKode > projects > IPTables log analyzer > iptablelog/admin/index.php
<?php
/////////////////////////////////////////////////////////////////////////////////////
// IPTable log analyzer
// Copyright (C) 2002 Gerald GARCIA
//
// 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, or (at your option) any later version.
//
// This program 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 this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Plac<B2>e - Suite 330, Boston, MA  02111-1307, USA.
//
// Contact author : hide@address.com
/////////////////////////////////////////////////////////////////////////////////////

// $Id: index.php,v 1.2 2007/02/22 16:51:02 tarbuck Exp $

require_once("../conf/config.php");
require_once("conf/config.php");
#require_once("elems.php");


  pageHeader(); 
#  include "admin/resolve.php";
#  echo "<br>\nSorry, (Mostly) Not implemented yet !!!";

  if (strlen($_REQUEST['target'])) {
  	$target = $_REQUEST['target'];
	if ((strpos($target,".") !== FALSE) && (strpos($target,"/") !== FALSE)) {
		$messages->add("Security error: admin script targets must not contain periods or slashes.");
	} else {
  		$target = "modules/" . $target . ".inc";
  		if (file_exists($target)) {
			include $target;
		} else {
			$messages->add("Error: file $target not found.");
		}
	}
  }

  $messages->show("<b>Messages</b>");
  
  $admin_parts = array();
  $parts = 0;
  if ($handle = opendir('./modules')) {
     while (false !== ($file = readdir($handle))) {
     	if (substr($file,-4,4) == ".php") {
		$admin_parts[$parts++] = "modules/" . $file;
		#echo $admin_parts[$parts-1] . " $file  $parts<BR>";
	}
     }
     closedir($handle);
  } else { echo "Bad handle<br>"; }
  sort($admin_parts);
  for($i=0;$i < $parts;$i++) {
  	include($admin_parts[$i]);
	echo "\n<br>\n";
	#echo $admin_parts[$i] . " <br>";
  }

  pageFooter(); 
?>
Return current item: IPTables log analyzer