<?php
/**************************************************************************
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.
@Authors: Ryan Thompson(hide@address.com)
***************************************************************************/
//Not yet used. Needs rewrite
?>
<h3>Access Logs</h3>
<p>
This feature has been removed temporarily.
</p>
<?php
if(isset($_POST['rotate']))
{
rename($osgw['site']['dir'] ."/logs/access_log", $osgw['site']['dir'] ."/logs/access_log_". date(dmY));
$fp = fopen($osgw['site']['dir'] ."/logs/access_log", 'w');
fclose($fp);
} elseif(isset($_POST['delete']))
{
unlink($osgw['site']['dir'] ."/logs/access_log");
$fp = fopen($osgw['site']['dir'] ."/logs/access_log", 'w');
fclose($fp);
}
$file = $osgw['site']['dir'] ."/logs/access_log";
if(!$fp = @fopen($file, 'r'))
{
echo "File doesn't exists";
} else {
while(!@feof($fp))
{
echo fgets($fp);
echo "<br>";
}
}
@fclose($fp);
$link = $O->create_link("/logs/access_log");
?>
<table>
<tr>
<td>
</form>
<form>
<input type="submit" class="button1" onClick="window.location='<?php echo $link?>'" value="Save Access Log" name="save">
</form>
</td><td>
<form action="<?php echo $_SERVER['PHP_SELF']. "?x=". $_GET['x']. "&s=". $_GET['s']?>" method="post">
<input type="submit" class="button1" value="Rotate Logs" name="rotate">
</form>
</td><td>
<form action="<?php echo $_SERVER['PHP_SELF']. "?x=". $_GET['x']. "&s=". $_GET['s']?>" method="post">
<input type="submit" class="button1" value="Delete Log" name="delete">
</form>
</td>
</tr>
</table>