WeakWiki


modules\logm\logm.include.php



/********************************************************************************
WeakWiki (WeakWiki logm include file: logm.include.php)
Copyright (C) 2010 Alexander Lang

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 3 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, see .

Project Home: http://weakwiki.robnet.wmweb.at/
Contact:      robbiblubber@robnet.wmweb.at
********************************************************************************/



if(!isAdmin())
{
	echo("




" . _L_LOGM_0060 . "
\n" . _L_LOGM_0061 . "

\n"); return true; } $pm = new PageMenu(); $pm->add("" . _L_US_0010 . ""); $pm->add("" . _L_US_0013 .""); $pm->write(); echo("
\n"); echo("" . _L_LOGM_0001 . "\n"); echo("
\n"); $op = "ops"; if(isset($_GET['op'])) { $op = $_GET['op']; } if($op == "arc") { if(file_exists("./history/" . $_POST['arcf'])) { echo("


" . _L_LOGM_0030 . "
\n" . _L_LOGM_0031 . "

\n"); } else { $m = gzencode(file_get_contents("./history/current.log")); if(file_put_contents("./history/" . $_POST['arcf'], $m) === false) { echo("


" . _L_LOGM_0030 . "
\n" . _L_LOGM_0035 . "

\n"); } else { unlink("./history/current.log"); jwrite("archived system log into **./history/" . $_POST['arcf'] . "**"); echo("


" . _L_LOGM_0032 . "
\n" . _L_LOGM_0033 . "" . $_POST['arcf'] . "" . _L_LOGM_0034 . "

\n"); } } $op = "ops"; } echo("

\n"); echo("" . _L_LOGM_0002 . "  \n"); echo("" . _L_LOGM_0003 . "  \n"); echo("" . _L_LOGM_0004 . "  \n"); echo("" . _L_LOGM_0005 . "  \n"); echo("
\n"); switch($op) { case "details": echo("

"); echo($this->getDetails()); break; case "history": echo("

"); foreach($this->getFiles() as $f) { if(substr($f, strlen($f) - 6) == ".hfile") { echo("" . fromTitle(substr($f, 0, strlen($f) - 6)) . "
\n"); } } echo("
"); break; case "ops": echo("

\n"); if(!file_exists("./history/current.log")) { echo(_L_LOGM_0020 . "
\n"); echo("
" . _L_LOGM_0021 . "" . _L_LOGM_0018 . "" . _L_LOGM_0023 . "
\n

\n"); break; } echo(_L_LOGM_0010 . " " . filesize("./history/current.log") . "" . _L_LOGM_0011 . "\n

\n"); echo(_L_LOGM_0012 . "" . _L_LOGM_0003 . "" . _L_LOGM_0013 . "\n


\n"); echo("
"); echo("\n"); echo("
\n"); echo(_L_LOGM_0014 . "  "); echo("
"); echo("" . _L_LOGM_0016 . "
\n"); echo("
\n"); echo("
" . _L_LOGM_0017 . "" . _L_LOGM_0018 . "" . _L_LOGM_0019 . "
\n

\n"); break; case "syslog": echo("
"); if(!file_exists("./history/current.log")) { echo(_L_LOGM_0020 . "
\n"); echo("
" . _L_LOGM_0021 . "" . _L_LOGM_0018 . "" . _L_LOGM_0023 . "
\n

\n"); break; } $m = "System Log\n\n\n|**timestamp** |**user** |**action** |**document** |\n"; $m .= file_get_contents('./history/current.log'); echo(wikiParse($m)); break; case "files": $mode = "list"; if(isset($_GET['mode'])) { $mode = $_GET['mode']; } $f = ""; if(isset($_GET['file'])) { $f = $_GET['file']; } $pm = new PageMenu(0, false); $pm->add("" . _L_LOGM_0040 . ""); $pm->add("" . _L_LOGM_0041 . ""); $pm->add("" . _L_LOGM_0042 . ""); $pm->add("" . _L_LOGM_0043 . ""); switch($mode) { case "plain": $pm->write(); echo(""); echo(file_get_contents("./history/" . $f)); echo(""); break; case "source": $pm->write(); $m = file_get_contents("./history/" . $f); if($f != 'current.log') { $m = _gzdecode($m); } echo(""); echo(formatSource($m)); echo(""); break; case "page": $pm->write(); if(filesize("./history/" . $f) > 200) { echo("


" . _L_LOGM_0050 . "
\n" . _L_LOGM_0051 . "



\n"); break; } $m = file_get_contents("./history/" . $f); if($f != 'current.log') { $m = _gzdecode($m); } echo(wikiParse($m)); break; case "log": $pm->write(); if(substr($f, strlen($f) - 6) == ".hfile") { echo("


" . _L_LOGM_0050 . "
\n" . _L_LOGM_0052 . "



\n"); break; } $m = ""; if($f == 'current.log') { $m = "System Log\n\n\n|**timestamp** |**user** |**action** |**document** |\n"; $m .= file_get_contents('./history/current.log'); echo(wikiParse($m)); break; } $m = _getHistory($f, false); echo(wikiParse($m)); break; case "delete": foreach($_POST['delfiles'] as $i) { unlink('./history/' . $i); jwrite("deleted system file **./history/" . $i . "**"); } default: echo("

"); echo("
"); echo(""); echo("\n"); foreach($this->getFiles() as $f) { echo("\n"); echo("\n"); echo("\n"); echo("\n"); echo("\n"); echo("\n"); echo("\n"); echo("\n"); echo("\n"); echo("\n"); } echo("
delete selected  
" . $f . "    " . $this->tof($f) . "    " . _L_LOGM_0040 . "  " . _L_LOGM_0041 . "  " . _L_LOGM_0042 . "  " . _L_LOGM_0043 . "  " . _L_LOGM_0044 . "  

\n"); break; } break; } echo("
\n"); ?>

WeakWiki