/**
 * constructor
 */
function wfSpecialLog($par = '')
{
    global $wgRequest;
    $logReader = new LogReader($wgRequest);
    if ($wgRequest->getVal('type') == '' && $par != '') {
        $logReader->limitType($par);
    }
    $logViewer = new LogViewer($logReader);
    $logViewer->show();
}
 /**
  * Muestra al usuario el dashboard
  * @return View
  */
 public function index()
 {
     //trae el nĂºmero de usuarios disponible en la app
     $users = DB::table('users')->count();
     //trae el total de registros del log
     $log_count = \LogViewer::total();
     $data = array('users' => $users, 'log_count' => $log_count);
     return view('backend.dashboard', $data);
 }
/**
 * constructor
 */
function wfSpecialLog($par = '')
{
    global $wgRequest;
    // BizzWiki begin {{
    global $wgOut, $wgUser;
    if (!$wgUser->isAllowed('readlog')) {
        $skin = $wgUser->getSkin();
        $wgOut->setPageTitle(wfMsg('log'));
        // existing message.
        $wgOut->addWikiText(wfMsg('badaccess'));
        // existing message.
        return;
    }
    // BizzWiki end }}
    $logReader = new LogReader($wgRequest);
    if ($wgRequest->getVal('type') == '' && $par != '') {
        $logReader->limitType($par);
    }
    $logViewer = new LogViewer($logReader);
    $logViewer->show();
}
 function showHistory()
 {
     global $wgLang, $wgContLang, $wgUser, $wgOut;
     $sk = $wgUser->getSkin();
     if ($this->mAllowed) {
         $wgOut->setPagetitle(wfMsg("undeletepage"));
     } else {
         $wgOut->setPagetitle(wfMsg('viewdeletedpage'));
     }
     $archive = new PageArchive($this->mTargetObj);
     /*
     $text = $archive->getLastRevisionText();
     if( is_null( $text ) ) {
     	$wgOut->addWikiMsg( "nohistory" );
     	return;
     }
     */
     if ($this->mAllowed) {
         $wgOut->addWikiMsg("undeletehistory");
     } else {
         $wgOut->addWikiMsg("undeletehistorynoadmin");
     }
     # List all stored revisions
     $revisions = $archive->listRevisions();
     $files = $archive->listFiles();
     $haveRevisions = $revisions && $revisions->numRows() > 0;
     $haveFiles = $files && $files->numRows() > 0;
     # Batch existence check on user and talk pages
     if ($haveRevisions) {
         $batch = new LinkBatch();
         while ($row = $revisions->fetchObject()) {
             $batch->addObj(Title::makeTitleSafe(NS_USER, $row->ar_user_text));
             $batch->addObj(Title::makeTitleSafe(NS_USER_TALK, $row->ar_user_text));
         }
         $batch->execute();
         $revisions->seek(0);
     }
     if ($haveFiles) {
         $batch = new LinkBatch();
         while ($row = $files->fetchObject()) {
             $batch->addObj(Title::makeTitleSafe(NS_USER, $row->fa_user_text));
             $batch->addObj(Title::makeTitleSafe(NS_USER_TALK, $row->fa_user_text));
         }
         $batch->execute();
         $files->seek(0);
     }
     if ($this->mAllowed) {
         $titleObj = SpecialPage::getTitleFor("Undelete");
         $action = $titleObj->getLocalURL("action=submit");
         # Start the form here
         $top = Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'undelete'));
         $wgOut->addHtml($top);
     }
     # Show relevant lines from the deletion log:
     $wgOut->addHTML("<h2>" . htmlspecialchars(LogPage::logName('delete')) . "</h2>\n");
     $logViewer = new LogViewer(new LogReader(new FauxRequest(array('page' => $this->mTargetObj->getPrefixedText(), 'type' => 'delete'))), LogViewer::NO_ACTION_LINK);
     $logViewer->showList($wgOut);
     if ($this->mAllowed && ($haveRevisions || $haveFiles)) {
         # Format the user-visible controls (comment field, submission button)
         # in a nice little table
         $align = $wgContLang->isRtl() ? 'left' : 'right';
         $table = Xml::openElement('fieldset') . Xml::openElement('table') . "<tr>\n\t\t\t\t\t\t<td colspan='2'>" . wfMsgWikiHtml('undeleteextrahelp') . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='{$align}'>" . Xml::label(wfMsg('undeletecomment'), 'wpComment') . "</td>\n\t\t\t\t\t\t<td>" . Xml::input('wpComment', 50, $this->mComment) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t<td>" . Xml::submitButton(wfMsg('undeletebtn'), array('name' => 'restore', 'id' => 'mw-undelete-submit')) . Xml::element('input', array('type' => 'reset', 'value' => wfMsg('undeletereset'), 'id' => 'mw-undelete-reset')) . "</td>\n\t\t\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('fieldset');
         $wgOut->addHtml($table);
     }
     $wgOut->addHTML("<h2>" . htmlspecialchars(wfMsg("history")) . "</h2>\n");
     if ($haveRevisions) {
         # The page's stored (deleted) history:
         $wgOut->addHTML("<ul>");
         $target = urlencode($this->mTarget);
         $remaining = $revisions->numRows();
         $earliestLiveTime = $this->getEarliestTime($this->mTargetObj);
         while ($row = $revisions->fetchObject()) {
             $remaining--;
             $ts = wfTimestamp(TS_MW, $row->ar_timestamp);
             if ($this->mAllowed) {
                 $checkBox = Xml::check("ts{$ts}");
                 $pageLink = $sk->makeKnownLinkObj($titleObj, $wgLang->timeanddate($ts, true), "target={$target}&timestamp={$ts}");
                 if ($remaining > 0 || $earliestLiveTime && $ts > $earliestLiveTime) {
                     $diffLink = '(' . $sk->makeKnownLinkObj($titleObj, wfMsgHtml('diff'), "target={$target}&timestamp={$ts}&diff=prev") . ')';
                 } else {
                     // No older revision to diff against
                     $diffLink = '';
                 }
             } else {
                 $checkBox = '';
                 $pageLink = $wgLang->timeanddate($ts, true);
                 $diffLink = '';
             }
             $userLink = $sk->userLink($row->ar_user, $row->ar_user_text) . $sk->userToolLinks($row->ar_user, $row->ar_user_text);
             $stxt = '';
             if (!is_null($size = $row->ar_len)) {
                 if ($size == 0) {
                     $stxt = wfMsgHtml('historyempty');
                 } else {
                     $stxt = wfMsgHtml('historysize', $wgLang->formatNum($size));
                 }
             }
             $comment = $sk->commentBlock($row->ar_comment);
             $wgOut->addHTML("<li>{$checkBox} {$pageLink} {$diffLink} . . {$userLink} {$stxt} {$comment}</li>\n");
         }
         $revisions->free();
         $wgOut->addHTML("</ul>");
     } else {
         $wgOut->addWikiMsg("nohistory");
     }
     if ($haveFiles) {
         $wgOut->addHtml("<h2>" . wfMsgHtml('filehist') . "</h2>\n");
         $wgOut->addHtml("<ul>");
         while ($row = $files->fetchObject()) {
             $ts = wfTimestamp(TS_MW, $row->fa_timestamp);
             if ($this->mAllowed && $row->fa_storage_key) {
                 $checkBox = Xml::check("fileid" . $row->fa_id);
                 $key = urlencode($row->fa_storage_key);
                 $target = urlencode($this->mTarget);
                 $pageLink = $sk->makeKnownLinkObj($titleObj, $wgLang->timeanddate($ts, true), "target={$target}&file={$key}");
             } else {
                 $checkBox = '';
                 $pageLink = $wgLang->timeanddate($ts, true);
             }
             $userLink = $sk->userLink($row->fa_user, $row->fa_user_text) . $sk->userToolLinks($row->fa_user, $row->fa_user_text);
             $data = wfMsgHtml('widthheight', $wgLang->formatNum($row->fa_width), $wgLang->formatNum($row->fa_height)) . ' (' . wfMsgHtml('nbytes', $wgLang->formatNum($row->fa_size)) . ')';
             $comment = $sk->commentBlock($row->fa_description);
             $wgOut->addHTML("<li>{$checkBox} {$pageLink} . . {$userLink} {$data} {$comment}</li>\n");
         }
         $files->free();
         $wgOut->addHTML("</ul>");
     }
     if ($this->mAllowed) {
         # Slip in the hidden controls here
         $misc = Xml::hidden('target', $this->mTarget);
         $misc .= Xml::hidden('wpEditToken', $wgUser->editToken());
         $misc .= Xml::closeElement('form');
         $wgOut->addHtml($misc);
     }
     return true;
 }
 /**
  * If there are rows in the deletion log for this page, show them,
  * along with a nice little note for the user
  *
  * @param OutputPage $out
  */
 private function showDeletionLog($out)
 {
     $title = $this->mTitle;
     $reader = new LogReader(new FauxRequest(array('page' => $title->getPrefixedText(), 'type' => 'delete')));
     if ($reader->hasRows()) {
         $out->addHtml('<div id="mw-recreate-deleted-warn">');
         $out->addWikiMsg('recreate-deleted-warn');
         $viewer = new LogViewer($reader);
         $viewer->showList($out);
         $out->addHtml('</div>');
     }
 }
 /**
  * Show deletion log fragments pertaining to the current file
  */
 private function showLogEntries()
 {
     global $wgOut;
     $wgOut->addHtml('<h2>' . htmlspecialchars(LogPage::logName('delete')) . "</h2>\n");
     $reader = new LogViewer(new LogReader(new FauxRequest(array('type' => 'delete', 'page' => $this->title->getPrefixedText()))));
     $reader->showList($wgOut);
 }
 /**
  * If there are rows in the deletion log for this file, show them,
  * along with a nice little note for the user
  *
  * @param OutputPage $out
  * @param string filename
  */
 private function showDeletionLog($out, $filename)
 {
     $reader = new LogReader(new FauxRequest(array('page' => $filename, 'type' => 'delete')));
     if ($reader->hasRows()) {
         $out->addHtml('<div id="mw-upload-deleted-warn">');
         $out->addWikiMsg('upload-wasdeleted');
         $viewer = new LogViewer($reader);
         $viewer->showList($out);
         $out->addHtml('</div>');
     }
 }
Example #8
0
 function showLogFragment(&$out, &$title)
 {
     $out->addHtml(wfElement('h2', NULL, LogPage::logName('block')));
     $request = new FauxRequest(array('page' => $title->getPrefixedText(), 'type' => 'block'));
     $viewer = new LogViewer(new LogReader($request));
     $viewer->showList($out);
 }
Example #9
0
 function showHistory()
 {
     global $wgLang, $wgUser, $wgOut;
     $sk = $wgUser->getSkin();
     if ($this->mAllowed) {
         $wgOut->setPagetitle(wfMsg("undeletepage"));
     } else {
         $wgOut->setPagetitle(wfMsg('viewdeletedpage'));
     }
     $archive = new PageArchive($this->mTargetObj);
     $text = $archive->getLastRevisionText();
     /*
     if( is_null( $text ) ) {
     	$wgOut->addWikiText( wfMsg( "nohistory" ) );
     	return;
     }
     */
     if ($this->mAllowed) {
         $wgOut->addWikiText(wfMsg("undeletehistory"));
     } else {
         $wgOut->addWikiText(wfMsg("undeletehistorynoadmin"));
     }
     # List all stored revisions
     $revisions = $archive->listRevisions();
     $files = $archive->listFiles();
     $haveRevisions = $revisions && $revisions->numRows() > 0;
     $haveFiles = $files && $files->numRows() > 0;
     # Batch existence check on user and talk pages
     if ($haveRevisions) {
         $batch = new LinkBatch();
         while ($row = $revisions->fetchObject()) {
             $batch->addObj(Title::makeTitleSafe(NS_USER, $row->ar_user_text));
             $batch->addObj(Title::makeTitleSafe(NS_USER_TALK, $row->ar_user_text));
         }
         $batch->execute();
         $revisions->seek(0);
     }
     if ($haveFiles) {
         $batch = new LinkBatch();
         while ($row = $files->fetchObject()) {
             $batch->addObj(Title::makeTitleSafe(NS_USER, $row->fa_user_text));
             $batch->addObj(Title::makeTitleSafe(NS_USER_TALK, $row->fa_user_text));
         }
         $batch->execute();
         $files->seek(0);
     }
     if ($this->mAllowed) {
         $titleObj = Title::makeTitle(NS_SPECIAL, "Undelete");
         $action = $titleObj->getLocalURL("action=submit");
         # Start the form here
         $top = wfOpenElement('form', array('method' => 'post', 'action' => $action, 'id' => 'undelete'));
         $wgOut->addHtml($top);
     }
     # Show relevant lines from the deletion log:
     $wgOut->addHTML("<h2>" . htmlspecialchars(LogPage::logName('delete')) . "</h2>\n");
     $logViewer = new LogViewer(new LogReader(new FauxRequest(array('page' => $this->mTargetObj->getPrefixedText(), 'type' => 'delete'))));
     $logViewer->showList($wgOut);
     if ($this->mAllowed && ($haveRevisions || $haveFiles)) {
         # Format the user-visible controls (comment field, submission button)
         # in a nice little table
         $table = '<fieldset><table><tr>';
         $table .= '<td colspan="2">' . wfMsgWikiHtml('undeleteextrahelp') . '</td></tr><tr>';
         $table .= '<td align="right"><strong>' . wfMsgHtml('undeletecomment') . '</strong></td>';
         $table .= '<td>' . wfInput('wpComment', 50, $this->mComment) . '</td>';
         $table .= '</tr><tr><td>&nbsp;</td><td>';
         $table .= wfSubmitButton(wfMsg('undeletebtn'), array('name' => 'restore'));
         $table .= wfElement('input', array('type' => 'reset', 'value' => wfMsg('undeletereset')));
         $table .= '</td></tr></table></fieldset>';
         $wgOut->addHtml($table);
     }
     $wgOut->addHTML("<h2>" . htmlspecialchars(wfMsg("history")) . "</h2>\n");
     if ($haveRevisions) {
         # The page's stored (deleted) history:
         $wgOut->addHTML("<ul>");
         $target = urlencode($this->mTarget);
         while ($row = $revisions->fetchObject()) {
             $ts = wfTimestamp(TS_MW, $row->ar_timestamp);
             if ($this->mAllowed) {
                 $checkBox = wfCheck("ts{$ts}");
                 $pageLink = $sk->makeKnownLinkObj($titleObj, $wgLang->timeanddate($ts, true), "target={$target}&timestamp={$ts}");
             } else {
                 $checkBox = '';
                 $pageLink = $wgLang->timeanddate($ts, true);
             }
             $userLink = $sk->userLink($row->ar_user, $row->ar_user_text) . $sk->userToolLinks($row->ar_user, $row->ar_user_text);
             $comment = $sk->commentBlock($row->ar_comment);
             $wgOut->addHTML("<li>{$checkBox} {$pageLink} . . {$userLink} {$comment}</li>\n");
         }
         $revisions->free();
         $wgOut->addHTML("</ul>");
     } else {
         $wgOut->addWikiText(wfMsg("nohistory"));
     }
     if ($haveFiles) {
         $wgOut->addHtml("<h2>" . wfMsgHtml('imghistory') . "</h2>\n");
         $wgOut->addHtml("<ul>");
         while ($row = $files->fetchObject()) {
             $ts = wfTimestamp(TS_MW, $row->fa_timestamp);
             if ($this->mAllowed && $row->fa_storage_key) {
                 $checkBox = wfCheck("fileid" . $row->fa_id);
                 $key = urlencode($row->fa_storage_key);
                 $target = urlencode($this->mTarget);
                 $pageLink = $sk->makeKnownLinkObj($titleObj, $wgLang->timeanddate($ts, true), "target={$target}&file={$key}");
             } else {
                 $checkBox = '';
                 $pageLink = $wgLang->timeanddate($ts, true);
             }
             $userLink = $sk->userLink($row->fa_user, $row->fa_user_text) . $sk->userToolLinks($row->fa_user, $row->fa_user_text);
             $data = wfMsgHtml('widthheight', $wgLang->formatNum($row->fa_width), $wgLang->formatNum($row->fa_height)) . ' (' . wfMsgHtml('nbytes', $wgLang->formatNum($row->fa_size)) . ')';
             $comment = $sk->commentBlock($row->fa_description);
             $wgOut->addHTML("<li>{$checkBox} {$pageLink} . . {$userLink} {$data} {$comment}</li>\n");
         }
         $files->free();
         $wgOut->addHTML("</ul>");
     }
     if ($this->mAllowed) {
         # Slip in the hidden controls here
         $misc = wfHidden('target', $this->mTarget);
         $misc .= wfHidden('wpEditToken', $wgUser->editToken());
         $wgOut->addHtml($misc . '</form>');
     }
     return true;
 }
 private function showHistory()
 {
     global $wgLang, $wgContLang, $wgUser, $wgOut;
     $this->sk = $wgUser->getSkin();
     $wgOut->setPagetitle(wfMsg("mergehistory"));
     $this->showMergeForm();
     # List all stored revisions
     $revisions = new MergeHistoryPager($this, array(), $this->mTargetObj, $this->mDestObj);
     $haveRevisions = $revisions && $revisions->getNumRows() > 0;
     $titleObj = SpecialPage::getTitleFor("Mergehistory");
     $action = $titleObj->getLocalURL("action=submit");
     # Start the form here
     $top = Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'merge'));
     $wgOut->addHtml($top);
     if ($haveRevisions) {
         # Format the user-visible controls (comment field, submission button)
         # in a nice little table
         $align = $wgContLang->isRtl() ? 'left' : 'right';
         $table = Xml::openElement('fieldset') . Xml::openElement('table') . "<tr>\n\t\t\t\t\t\t<td colspan='2'>" . wfMsgExt('mergehistory-merge', array('parseinline'), $this->mTargetObj->getPrefixedText(), $this->mDestObj->getPrefixedText()) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='{$align}'>" . Xml::label(wfMsg('undeletecomment'), 'wpComment') . "</td>\n\t\t\t\t\t\t<td>" . Xml::input('wpComment', 50, $this->mComment) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t<td>" . Xml::submitButton(wfMsg('mergehistory-submit'), array('name' => 'merge', 'id' => 'mw-merge-submit')) . "</td>\n\t\t\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('fieldset');
         $wgOut->addHtml($table);
     }
     $wgOut->addHTML("<h2 id=\"mw-mergehistory\">" . wfMsgHtml("mergehistory-list") . "</h2>\n");
     if ($haveRevisions) {
         $wgOut->addHTML($revisions->getNavigationBar());
         $wgOut->addHTML("<ul>");
         $wgOut->addHTML($revisions->getBody());
         $wgOut->addHTML("</ul>");
         $wgOut->addHTML($revisions->getNavigationBar());
     } else {
         $wgOut->addWikiMsg("mergehistory-empty");
     }
     # Show relevant lines from the deletion log:
     $wgOut->addHTML("<h2>" . htmlspecialchars(LogPage::logName('merge')) . "</h2>\n");
     $logViewer = new LogViewer(new LogReader(new FauxRequest(array('page' => $this->mTargetObj->getPrefixedText(), 'type' => 'merge'))));
     $logViewer->showList($wgOut);
     # Slip in the hidden controls here
     # When we submit, go by page ID to avoid some nasty but unlikely collisions.
     # Such would happen if a page was renamed after the form loaded, but before submit
     $misc = Xml::hidden('targetID', $this->mTargetObj->getArticleID());
     $misc .= Xml::hidden('destID', $this->mDestObj->getArticleID());
     $misc .= Xml::hidden('target', $this->mTarget);
     $misc .= Xml::hidden('dest', $this->mDest);
     $misc .= Xml::hidden('wpEditToken', $wgUser->editToken());
     $misc .= Xml::closeElement('form');
     $wgOut->addHtml($misc);
     return true;
 }
Example #11
0
 /**
  * Show relevant lines from the deletion log
  */
 function showLogExtract($out)
 {
     $out->addHtml('<h2>' . htmlspecialchars(LogPage::logName('delete')) . '</h2>');
     $logViewer = new LogViewer(new LogReader(new FauxRequest(array('page' => $this->mTitle->getPrefixedText(), 'type' => 'delete'))));
     $logViewer->showList($out);
 }
Example #12
0
    eval("echo \"" . getTemplate("domains/domains") . "\";");
} elseif ($page === 'log') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains::log");
    require_once 'lib/classes/domains/class.logviewer.php';
    if ($action === 'newlines') {
        $type = 'access';
        $lastSize = 0;
        if (isset($_GET['type']) && in_array($_GET['type'], array('access', 'error'))) {
            $type = $_GET['type'];
        }
        if (isset($_GET['last_size'])) {
            $lastSize = (int) $_GET['last_size'];
        }
        $customerid_result = $db->query("SELECT loginname FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE customerid = " . (int) $userinfo['customerid']);
        $customerid_row = $db->fetch_array($customerid_result);
        $logview = new LogViewer($customerid_row['loginname']);
        echo json_encode($logview->newLines($type, $lastSize));
    } else {
        // Render template
        eval("echo \"" . getTemplate("domains/domains_log") . "\";");
    }
} elseif ($page == 'domains') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'd.documentroot' => $lng['panel']['path'], 'd.aliasdomain' => $lng['domains']['aliasdomain']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_DOMAINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id` WHERE `d`.`customerid`='" . (int) $userinfo['customerid'] . "' AND `d`.`email_only`='0' AND `d`.`id` <> " . (int) $userinfo['standardsubdomain'] . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
Example #13
0
    /**
      Define any javascript needed
      @return A javascript string
    function javascript_content(){
        $js="";
        return $js;
    }
    */
    function body_content()
    {
        include '../config.php';
        ob_start();
        echo showInstallTabs('Necessities');
        $self = basename($_SERVER['PHP_SELF']);
        echo "<form action='{$self}' method='post'>";
        if (!$this->themed) {
            echo "<h1 class='install'>{$this->header}</h1>";
        }
        // Path detection: Establish ../../
        $FILEPATH = rtrim(__FILE__, "{$self}");
        if (DIRECTORY_SEPARATOR == '\\') {
            $FILEPATH = str_replace(DIRECTORY_SEPARATOR, '/', $FILEPATH);
        }
        $URL = rtrim($_SERVER['SCRIPT_NAME'], "{$self}");
        $FILEPATH = rtrim($FILEPATH, '/');
        $URL = rtrim($URL, '/');
        $FILEPATH = rtrim($FILEPATH, 'install');
        $URL = rtrim($URL, 'install');
        $FANNIE_ROOT = $FILEPATH;
        $FANNIE_URL = $URL;
        if (function_exists('posix_getpwuid')) {
            $chk = posix_getpwuid(posix_getuid());
            echo "PHP is running as: " . $chk['name'] . "<br />";
        } else {
            echo "PHP is (probably) running as: " . get_current_user() . "<br />";
        }
        if (is_writable($FILEPATH . 'config.php')) {
            confset('FANNIE_ROOT', "'{$FILEPATH}'");
            confset('FANNIE_URL', "'{$URL}'");
            echo "<div class=\"alert alert-success\"><i>config.php</i> is writeable</div>";
            echo "<hr />";
        } else {
            echo "<div class=\"alert alert-danger\"><b>Error</b>: config.php is not writeable</div>";
            echo "<div class=\"well\">";
            echo "config.php ({$FILEPATH}config.php) is Fannie's main configuration file.";
            echo "<ul>";
            echo "<li>If this file exists, ensure it is writable by the user running PHP (see above)";
            echo "<li>If the file does not exist, copy config.dist.php ({$FILEPATH}config.dist.php) to config.php";
            echo "<li>If neither file exists, create a new config.php ({$FILEPATH}config.php) containing:";
            echo "</ul>";
            echo "<pre>\n&lt;?php\n?&gt;\n</pre>";
            echo "</div>";
            echo '<button type="submit" class="btn btn-default">Refresh this page</button>';
            echo "</form>";
            return ob_get_clean();
        }
        if (!is_dir(dirname(__FILE__) . '/../../vendor')) {
            echo "<div class=\"alert alert-warning\"><b>Warning</b>: dependencies appear to be missing.</div>";
            echo '<div class=\\"well\\">';
            echo 'Install <a href="https://getcomposer.org/">Composer</a> then run ';
            echo "<pre>";
            echo '$ cd "' . $FILEPATH . "\"\n";
            echo '$ /path/to/composer.phar update';
            echo '</pre>';
            echo '<a href="https://github.com/CORE-POS/IS4C/wiki/Installation#composer">More info about Composer</a>';
            echo '</div>';
        } else {
            $json = file_get_contents(dirname(__FILE__) . '/../../composer.json');
            $obj = json_decode($json);
            $missing = false;
            foreach (get_object_vars($obj->require) as $package => $version) {
                if (!is_dir(dirname(__FILE__) . '/../../vendor/' . $package)) {
                    $missing = true;
                    echo "<div class=\"alert alert-danger\"><b>Warning</b>: package " . $package . " is not installed.</div>";
                }
            }
            if ($missing) {
                echo '<div class="well">Install dependencies by running';
                echo "<pre>";
                echo '$ cd "' . substr($FILEPATH, 0, strlen($FILEPATH) - 7) . "\"\n";
                echo '$ /path/to/composer.phar update';
                echo '</pre></div>';
            }
        }
        /**
            Detect databases that are supported
        */
        $supportedTypes = \COREPOS\common\sql\Lib::getDrivers();
        if (count($supportedTypes) == 0) {
            echo "<div class=\"alert alert-danger\"><b>Error</b>: no database driver available</div>";
            echo "<div class=\"well\">";
            echo 'Install at least one of the following PHP extensions: pdo_mysql, mysqli, mysql,
                or mssql. If you installed one or more of these and are still seeing this
                error, make sure they are enabled in your PHP configuration and try 
                restarting your web server.';
            echo "</div>";
            return false;
        }
        $db_keys = array_keys($supportedTypes);
        $defaultDbType = $db_keys[0];
        echo '<h4 class="install"><a href="" onclick="$(\'#serverConfTable\').toggle(); return false;">Main Server</a> +</h4>';
        echo '<table id="serverConfTable">';
        echo '<tr><td>Server Database Host</td>' . '<td>' . installTextField('FANNIE_SERVER', $FANNIE_SERVER, '127.0.0.1') . '</td></tr>';
        echo '<tr><td>Server Database Type</td>' . '<td>' . installSelectField('FANNIE_SERVER_DBMS', $FANNIE_SERVER_DBMS, $supportedTypes, $defaultDbType) . '</td></tr>';
        echo '<tr><td>Server Database Username</td>' . '<td>' . installTextField('FANNIE_SERVER_USER', $FANNIE_SERVER_USER, 'root') . '</td></tr>';
        echo '<tr><td>Server Database Password</td>' . '<td> ' . installTextField('FANNIE_SERVER_PW', $FANNIE_SERVER_PW, '', true, array('type' => 'password')) . '</td></tr>';
        echo '<tr><td>Server Operational DB name</td>' . '<td>' . installTextField('FANNIE_OP_DB', $FANNIE_OP_DB, 'core_op') . '</td></tr>';
        echo '<tr><td>Server Transaction DB name</td>' . '<td>' . installTextField('FANNIE_TRANS_DB', $FANNIE_TRANS_DB, 'core_trans') . '</td></tr>';
        echo '</table>';
        $sql = db_test_connect($FANNIE_SERVER, $FANNIE_SERVER_DBMS, $FANNIE_OP_DB, $FANNIE_SERVER_USER, $FANNIE_SERVER_PW);
        $createdOps = false;
        if ($sql === false) {
            echo "<div class=\"alert alert-danger\">Testing Operational DB connection failed</div>";
        } else {
            echo "<div class=\"alert alert-success\">Testing Operational DB connection succeeded</div>";
            $msgs = $this->create_op_dbs($sql, $FANNIE_OP_DB);
            $createdOps = true;
            foreach ($msgs as $msg) {
                if ($msg['error'] == 0) {
                    continue;
                }
                echo $msg['error_msg'] . '<br />';
            }
        }
        $sql = db_test_connect($FANNIE_SERVER, $FANNIE_SERVER_DBMS, $FANNIE_TRANS_DB, $FANNIE_SERVER_USER, $FANNIE_SERVER_PW);
        $createdTrans = false;
        if ($sql === false) {
            echo "<div class=\"alert alert-danger\">Testing Transaction DB connection failed</div>";
        } else {
            echo "<div class=\"alert alert-success\">Testing Transaction DB connection succeeded</div>";
            $msgs = $this->create_trans_dbs($sql, $FANNIE_TRANS_DB, $FANNIE_OP_DB);
            foreach ($msgs as $msg) {
                if ($msg['error'] == 0) {
                    continue;
                }
                echo $msg['error_msg'] . '<br />';
            }
            $createdTrans = true;
        }
        if ($createdOps && $createdTrans) {
            // connected to both databases
            // collapse config fields
            $this->add_onload_command('$(\'#serverConfTable\').hide();');
        }
        ?>
        <hr />
        <?php 
        echo '<h4 class="install"><a href="" onclick="$(\'#archiveConfTable\').toggle(); return false;">Transaction Archiving</a> +</h4>';
        echo '<table id="archiveConfTable">';
        echo '<tr><td>Archive DB name</td>' . '<td>' . installTextField('FANNIE_ARCHIVE_DB', $FANNIE_ARCHIVE_DB, 'trans_archive') . '</td></tr>';
        echo '<tr><td>Archive Method</td>' . '<td>' . installSelectField('FANNIE_ARCHIVE_METHOD', $FANNIE_ARCHIVE_METHOD, array('partitions', 'tables'), 'partitions') . '</td></tr>';
        echo '</table>';
        //local archiving - set up now
        $sql = db_test_connect($FANNIE_SERVER, $FANNIE_SERVER_DBMS, $FANNIE_ARCHIVE_DB, $FANNIE_SERVER_USER, $FANNIE_SERVER_PW);
        if ($sql === false) {
            echo "<div class=\"alert alert-danger\">Testing Archive DB connection failed</div>";
        } else {
            echo "<div class=\"alert alert-success\">Testing Archive DB connection succeeded</div>";
            $msgs = $this->create_archive_dbs($sql, $FANNIE_ARCHIVE_DB, $FANNIE_ARCHIVE_METHOD);
            foreach ($msgs as $msg) {
                if ($msg['error'] == 0) {
                    continue;
                }
                echo $msg['error_msg'] . '<br />';
            }
            $this->add_onload_command('$(\'#archiveConfTable\').hide();');
        }
        ?>
        <hr />
        <h4 class="install">Lanes</h4>
        Number of lanes
        <?php 
        if (!isset($FANNIE_NUM_LANES)) {
            $FANNIE_NUM_LANES = 0;
        }
        if (isset($_REQUEST['FANNIE_NUM_LANES'])) {
            $FANNIE_NUM_LANES = $_REQUEST['FANNIE_NUM_LANES'];
        }
        confset('FANNIE_NUM_LANES', "{$FANNIE_NUM_LANES}");
        echo "<input type=text name=FANNIE_NUM_LANES value=\"{$FANNIE_NUM_LANES}\" size=3 />";
        ?>
        <br />
        <?php 
        if ($FANNIE_NUM_LANES == 0) {
            confset('FANNIE_LANES', 'array()');
        } else {
            ?>
        <script type=text/javascript>
        function showhide(i,num){
            for (var j=0; j<num; j++){
                if (j == i)
                    document.getElementById('lanedef'+j).style.display='block';
                else
                    document.getElementById('lanedef'+j).style.display='none';
            }
        }
        </script>
        <?php 
            echo "<select onchange=\"showhide(this.value,{$FANNIE_NUM_LANES});\">";
            for ($i = 0; $i < $FANNIE_NUM_LANES; $i++) {
                echo "<option value={$i}>Lane " . ($i + 1) . "</option>";
            }
            echo "</select><br />";
            $conf = 'array(';
            for ($i = 0; $i < $FANNIE_NUM_LANES; $i++) {
                $style = $i == 0 ? '' : 'class="collapse"';
                echo "<div id=\"lanedef{$i}\" {$style}>";
                if (!isset($FANNIE_LANES[$i])) {
                    $FANNIE_LANES[$i] = array();
                }
                $conf .= 'array(';
                if (!isset($FANNIE_LANES[$i]['host'])) {
                    $FANNIE_LANES[$i]['host'] = '127.0.0.1';
                }
                if (isset($_REQUEST["LANE_HOST_{$i}"])) {
                    $FANNIE_LANES[$i]['host'] = $_REQUEST["LANE_HOST_{$i}"];
                }
                $conf .= "'host'=>'{$FANNIE_LANES[$i]['host']}',";
                echo "Lane " . ($i + 1) . " Database Host: <input type=text name=LANE_HOST_{$i} value=\"{$FANNIE_LANES[$i]['host']}\" /><br />";
                if (!isset($FANNIE_LANES[$i]['type'])) {
                    $FANNIE_LANES[$i]['type'] = $defaultDbType;
                }
                if (isset($_REQUEST["LANE_TYPE_{$i}"])) {
                    $FANNIE_LANES[$i]['type'] = $_REQUEST["LANE_TYPE_{$i}"];
                }
                $conf .= "'type'=>'{$FANNIE_LANES[$i]['type']}',";
                echo "Lane " . ($i + 1) . " Database Type: <select name=LANE_TYPE_{$i}>";
                foreach ($supportedTypes as $val => $label) {
                    printf('<option value="%s" %s>%s</option>', $val, $FANNIE_LANES[$i]['type'] == $val ? 'selected' : '', $label);
                }
                echo "</select><br />";
                if (!isset($FANNIE_LANES[$i]['user'])) {
                    $FANNIE_LANES[$i]['user'] = '******';
                }
                if (isset($_REQUEST["LANE_USER_{$i}"])) {
                    $FANNIE_LANES[$i]['user'] = $_REQUEST["LANE_USER_{$i}"];
                }
                $conf .= "'user'=>'{$FANNIE_LANES[$i]['user']}',";
                echo "Lane " . ($i + 1) . " Database Username: <input type=text name=LANE_USER_{$i} value=\"{$FANNIE_LANES[$i]['user']}\" /><br />";
                if (!isset($FANNIE_LANES[$i]['pw'])) {
                    $FANNIE_LANES[$i]['pw'] = '';
                }
                if (isset($_REQUEST["LANE_PW_{$i}"])) {
                    $FANNIE_LANES[$i]['pw'] = $_REQUEST["LANE_PW_{$i}"];
                }
                $conf .= "'pw'=>'{$FANNIE_LANES[$i]['pw']}',";
                echo "Lane " . ($i + 1) . " Database Password: <input type=password name=LANE_PW_{$i} value=\"{$FANNIE_LANES[$i]['pw']}\" /><br />";
                if (!isset($FANNIE_LANES[$i]['op'])) {
                    $FANNIE_LANES[$i]['op'] = 'opdata';
                }
                if (isset($_REQUEST["LANE_OP_{$i}"])) {
                    $FANNIE_LANES[$i]['op'] = $_REQUEST["LANE_OP_{$i}"];
                }
                $conf .= "'op'=>'{$FANNIE_LANES[$i]['op']}',";
                echo "Lane " . ($i + 1) . " Operational DB: <input type=text name=LANE_OP_{$i} value=\"{$FANNIE_LANES[$i]['op']}\" /><br />";
                if (!isset($FANNIE_LANES[$i]['trans'])) {
                    $FANNIE_LANES[$i]['trans'] = 'translog';
                }
                if (isset($_REQUEST["LANE_TRANS_{$i}"])) {
                    $FANNIE_LANES[$i]['trans'] = $_REQUEST["LANE_TRANS_{$i}"];
                }
                $conf .= "'trans'=>'{$FANNIE_LANES[$i]['trans']}'";
                echo "Lane " . ($i + 1) . " Transaction DB: <input type=text name=LANE_TRANS_{$i} value=\"{$FANNIE_LANES[$i]['trans']}\" /><br />";
                $conf .= ")";
                echo "</div>";
                if ($i == $FANNIE_NUM_LANES - 1) {
                    $conf .= ")";
                } else {
                    $conf .= ",";
                }
            }
            confset('FANNIE_LANES', $conf);
        }
        ?>
        <a href="LaneConfigPages/index.php">Edit Global Lane Configuration Page</a>
        <hr />
        <h4 class="install">Logs &amp; Debugging</h4>
        Fannie writes to the following log files:
        <?php 
        if (!class_exists('LogViewer')) {
            include dirname(__FILE__) . '/../logs/LogViewer.php';
        }
        $log = new LogViewer();
        ?>
        <ul>
        <li><?php 
        check_writeable('../logs/fannie.log');
        ?>
            <ul>
            <li>Contains info, notice, warning, error, critical, alert, and emergency level messages.</li>
            <li>
            <a href="" onclick="$('#dayendLogView').toggle(); return false;">See Recent Entries</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="../logs/LogViewer.php?logfile=<?php 
        echo base64_encode('fannie.log');
        ?>
">View Entire Log</a>
            <?php 
        $dayend = $log->getLogFile('../logs/fannie.log', 100);
        ?>
            <pre id="dayendLogView" class="tailedLog highlight"><?php 
        echo $dayend;
        ?>
</pre>
            </li>
            <li>If this file is missing, messages may be written to legacy log file dayend.log</li>
            </ul>  
        <li><?php 
        check_writeable('../logs/debug_fannie.log');
        ?>
            <ul>
            <li>Contains debug level messages including failed queries and PHP notice/warning/error messages.</li>
            <li>
            <a href="" onclick="$('#dayendLogView').toggle(); return false;">See Recent Entries</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="../logs/LogViewer.php?logfile=<?php 
        echo base64_encode('debug_fannie.log');
        ?>
">View Entire Log</a>
            <?php 
        $dayend = $log->getLogFile('../logs/debug_fannie.log', 100);
        ?>
            <pre id="dayendLogView" class="tailedLog highlight"><?php 
        echo $dayend;
        ?>
</pre>
            </li>
            <li>If this file is missing, messages may be written to legacy log file php_errors.log &amp; queries.log</li>
            </ul>  
        </ul>
        <?php 
        echo '<div class="row form-group">
              <label class="control-label col-sm-2">Color-Highlighted Logs</label>
              <div class="col-sm-3">' . installSelectField('FANNIE_PRETTY_LOGS', $FANNIE_PRETTY_LOGS, array('true' => 'Yes', 'false' => 'No'), false, false) . '</div></div>';
        echo '<div class="row form-group">
                <label class="control-label col-sm-2">Log Rotation Count</label>
                <div class="col-sm-3">' . installTextField('FANNIE_LOG_COUNT', $FANNIE_LOG_COUNT, 5, false) . '</div></div>';
        $errorOpts = array(1 => 'Yes', 0 => 'No');
        if ($FANNIE_CUSTOM_ERRORS > 1) {
            $FANNIE_CUSTOM_ERRORS = 1;
        }
        echo '<div class="row form-group">
                <label class="control-label col-sm-2">Verbose Debug Messages</label>
                <div class="col-sm-3">' . installSelectField('FANNIE_CUSTOM_ERRORS', $FANNIE_CUSTOM_ERRORS, $errorOpts, false, false) . '</div></div>';
        $taskOpts = array(99 => 'Never email on error', 0 => 'Emergency', 1 => 'Alert', 2 => 'Critical', 3 => 'Error', 4 => 'Warning', 5 => 'Notice', 6 => 'Info', 7 => 'Debug');
        echo '<div class="row form-group">
                <label class="control-label col-sm-2">Task Error Severity resulting in emails</label>
                <div class="col-sm-3">' . installSelectField('FANNIE_TASK_THRESHOLD', $FANNIE_TASK_THRESHOLD, $taskOpts, 99, false) . '</div></div>';
        echo '<p>
            CORE can send logs to a remote syslog server if a host name or IP
            is provided.
            </p>';
        echo '<div class="row form-group">
            <label class="control-label col-sm-2">Remote Syslog Host</label>
            <div class="col-sm-3">' . installTextField('FANNIE_SYSLOG_SERVER', $FANNIE_SYSLOG_SERVER) . '</div>
            </div>';
        echo '<div class="row form-group">
            <label class="control-label col-sm-2">Remote Syslog Port</label>
            <div class="col-sm-3">' . installTextField('FANNIE_SYSLOG_PORT', $FANNIE_SYSLOG_PORT, 514) . '</div>
            </div>';
        echo '<div class="row form-group">
            <label class="control-label col-sm-2">Remote Syslog Protocol</label>
            <div class="col-sm-3">' . installSelectField('FANNIE_SYSLOG_PROTOCOL', $FANNIE_SYSLOG_PROTOCOL, array('tcp', 'udp'), 'udp') . '</div>
            </div>';
        ?>
        <hr />
        <h4 class="install">Co-op</h4>
        Use this to identify code that is specific to your co-op.
        <br />Particularly important if you plan to contribute to the CORE IT code base.
        <br />Try to use a code that will not be confused with any other, e.g. "WEFC_Toronto" instead of "WEFC".
        <br />Co-op ID: 
        <?php 
        echo installTextField('FANNIE_COOP_ID', $FANNIE_COOP_ID);
        ?>
        <br />Home Page (URL)
        <br />Normally the item editor is displayed by default but another page or site can
        be designated instead.
        <?php 
        echo installTextField('FANNIE_HOME_PAGE', $FANNIE_HOME_PAGE, 'item/ItemEditorPage.php');
        ?>

        <hr />
        <h4 class="install">Locale</h4>
        Set the Country and Language where Fannie will run.
        <br />If these are not set in Fannie configuration but are set in the Linux environment the environment values will be used as
        defaults that can be overridden by settings here.

        <?php 
        echo '<br />Country: ';
        //Use I18N country codes.
        $countries = array("US" => "USA", "CA" => "Canada");
        echo installSelectField('FANNIE_COUNTRY', $FANNIE_COUNTRY, $countries, '');
        echo '<br />Language: ';
        //Use I18N language codes.
        $langs = array("en" => "English", "fr" => "French", "sp" => "Spanish");
        echo installSelectField('FANNIE_LANGUAGE', $FANNIE_LANGUAGE, $langs, '');
        ?>
        <hr />
        <h4 class="install">Back Office Transactions</h4>
        <i>Values used when generating transaction data via Fannie
        instead of through an actual POS terminal. The corrections department
        is only used for balancing individual transactions. Total sales
        to that department via generated transactions should always be
        zero. The catch-all department is used when generated transactions
        will generate a sale (or refund) but it is not known where the 
        amount belongs for accounting purposes.
        </i><br />
        <?php 
        echo '<table>';
        echo '<tr><td>Employee#</td>' . '<td>' . installTextField('FANNIE_EMP_NO', $FANNIE_EMP_NO, 1001, false) . '</td></tr>';
        echo '<tr><td>Register#</td>' . '<td>' . installTextField('FANNIE_REGISTER_NO', $FANNIE_REGISTER_NO, 30, false) . '</td></tr>';
        echo '<tr><td>Corrections Dept#</td>' . '<td>' . installTextField('FANNIE_CORRECTION_DEPT', $FANNIE_CORRECTION_DEPT, 800, false) . '</td></tr>';
        echo '<tr><td>Patronage Transfer Dept#</td>' . '<td>' . installTextField('FANNIE_PATRONAGE_DEPT', $FANNIE_PATRONAGE_DEPT, 800, false) . '</td></tr>';
        echo '<tr><td>Catch-all Dept#</td>' . '<td>' . installTextField('FANNIE_MISC_DEPT', $FANNIE_MISC_DEPT, 800, false) . '</td></tr>';
        echo '</table>';
        ?>
        <hr />
        <p>
            <button type="submit" class="btn btn-default">Save Configuration</button>
        </p>
        </form>


        <?php 
        return ob_get_clean();
        // body_content()
    }
Example #14
0
 public function LoadLog($field)
 {
     $this->_serverLog = PathTool::GetAbsFile($this->_servData->GetChildVal('errorlog'), 'SR');
     if ($field == SInfo::DATA_DASH_LOG) {
         $logdata = LogViewer::GetDashErrLog($this->_serverLog);
     } else {
         $logdata = LogViewer::GetErrLog($this->_serverLog);
     }
     return $logdata;
 }
 /**
  * Get a log or fail
  *
  * @param  string  $date
  *
  * @return Log|null
  */
 private function getLogOrFail($date)
 {
     $log = null;
     try {
         $log = \LogViewer::get($date);
     } catch (LogNotFound $e) {
         abort(404, $e->getMessage());
     }
     return $log;
 }
Example #16
0
 /**
  * Show the bot status log entries for the specified user
  * @param $user User to show the log for
  */
 function showLogEntries(&$user, $logtype = 'makebot')
 {
     global $wgOut;
     $title = $user->getUserPage();
     $wgOut->addHTML(Xml::element('h2', null, htmlspecialchars(LogPage::logName($logtype))));
     $logViewer = new LogViewer(new LogReader(new FauxRequest(array('page' => $title->getPrefixedText(), 'type' => $logtype))));
     $logViewer->showList($wgOut);
 }
Example #17
0
 /**
  * @param $file
  * @param bool $download
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function getShow($file)
 {
     LogViewer::setFile(base64_decode($file));
     return view('dashboard::container.systems.log', ['logs' => LogViewer::all(), 'files' => LogViewer::getFiles(true), 'current_file' => LogViewer::getFileName()]);
 }
Example #18
0
 function view()
 {
     $log = new LogViewer();
     $log->display(LogViewer::MODE_ECHO);
 }
Example #19
0
 /**
  * @param OutputPage $out
  * @access private
  */
 function showLogExtract(&$out)
 {
     # Show relevant lines from the deletion log:
     $out->addHTML("<h2>" . htmlspecialchars(LogPage::logName('protect')) . "</h2>\n");
     require_once 'SpecialLog.php';
     $logViewer = new LogViewer(new LogReader(new FauxRequest(array('page' => $this->mTitle->getPrefixedText(), 'type' => 'protect'))));
     $logViewer->showList($out);
 }
 /**
  * Show a rights log fragment for the specified user
  *
  * @param User $user User to show log for
  * @param OutputPage $output OutputPage to use
  */
 protected function showLogFragment($user, $output)
 {
     $viewer = new LogViewer(new LogReader(new FauxRequest(array('type' => 'rights', 'page' => $user->getUserPage()->getPrefixedText()))));
     $output->addHtml("<h2>" . htmlspecialchars(LogPage::logName('rights')) . "</h2>\n");
     $viewer->showList($output);
 }
Example #21
0
 function showLogExtract($username, $type, &$out)
 {
     global $wgOut;
     # Show relevant lines from the logs:
     $wgOut->addHtml(Xml::element('h2', null, LogPage::logName($type)) . "\n");
     $logViewer = new LogViewer(new LogReader(new FauxRequest(array('page' => $username->getPrefixedText(), 'type' => $type))));
     $logViewer->showList($out);
 }
 protected function __flushLog()
 {
     require_once dirname(__FILE__) . '/lib/class.logviewer.php';
     $log = new LogViewer();
     $log->flush();
 }