Location: PHPKode > projects > CourierAdmin > srv/www/htdocs/courieradmin/show_log.php
<?php
/*
Courieradmin V1, Administration of Courier Mailserver
Copyright (C) 2003  Daniel Heule

This file is part of Courieradmin.

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

Courieradmin 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 Courieradmin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
require_once("common.php");
if($_SESSION['user']['domain'] != '*') exit;
if(!$CourierAdmin_ShowLog) exit;
if(!isset($_SESSION['showlog_anzahl'])) $_SESSION['showlog_anzahl'] = 100;
if(!isset($_SESSION['showlog_filter'])) $_SESSION['showlog_filter'] = "";
if(!isset($_SESSION['showlog_refresh'])) $_SESSION['showlog_refresh'] = 0;
if(isset($_REQUEST['showlog_anzahl'])) $_SESSION['showlog_anzahl'] = $_REQUEST['showlog_anzahl'];
if(isset($_REQUEST['showlog_filter'])) $_SESSION['showlog_filter'] = $_REQUEST['showlog_filter'];
if(isset($_REQUEST['showlog_refresh']) && $_REQUEST['showlog_refresh'] != "") $_SESSION['showlog_refresh'] = $_REQUEST['showlog_refresh'];
elseif(!isset($_REQUEST['showlog_refresh']) && $_REQUEST['showlog_act'] == "Werte neu Setzen")
{
 $_SESSION['showlog_refresh'] = 0;
}
if($_SESSION['showlog_filter'] == "")
{
 exec("sudo -u ".$CourierAdmin_sh_root_user." ".$CourierAdmin_path."/bin/sudo_root.php maillog_show ".$_SESSION['showlog_anzahl'],$output);
}
else
{
 exec("sudo -u ".$CourierAdmin_sh_root_user." ".$CourierAdmin_path."/bin/sudo_root.php maillog_show ".$_SESSION['showlog_anzahl']." ".$_SESSION['showlog_filter'],$output);
}
?>
<html>
<head>
<title>Anzeigen des Logs, Courieradmin (c) by Nerve</title>
<?php
if($_SESSION['showlog_refresh'] == 1)
{
 echo"<meta http-equiv=\"refresh\" content=\"".$CourierAdmin_default_refresh_time."\">";
}
?>
</head>
<body>
<h1>Logfile von Courier</h1>
<form name="Formular" method="post" action="<%=$self%>" target="_self">
<b>Anzahl Zeilen : </b><input size=20 name="showlog_anzahl" value="<?php print($_SESSION['showlog_anzahl']);?>"><br>
<b>Automatisch auffrischen ? : </b> <input type="checkbox" name="showlog_refresh" value="1" <?php if($_SESSION['showlog_refresh'] > 0) echo "checked";?>><br>
<b>Filter : </b><input size=20 name="showlog_filter" value="<?php echo $_SESSION['logins_filter']; ?>"><br>
<input type=submit name="showlog_act" value="Werte neu Setzen"><br>
</form><br><pre>
<?php
krsort($output);
foreach ($output as $key => $value)
{
 echo htmlspecialchars($value."\n");
}
?>
</pre></body>
</html>
                                                                                                                                                                                                                                                                                                            
Return current item: CourierAdmin