<?php
// Simple Text-File Login (SiTeFiLo).
// Copyright ©2004 by Mario A. Valdez-Ramirez
// http://www.mariovaldez.net/

// 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 Place - Suite 330,
// Boston, MA 02111-1307, USA.

// You can contact Mario A. Valdez-Ramirez by email
// at mario@mariovaldez.org or paper mail at
// Olmos 809, San Nicolas, NL. 66495, Mexico.
session_start();
$slogin_noauthpage = 0;
$slogin_pagetitle = "";
include_once ("slogin_lib.inc.php");
include_once ("header.inc.php");


if (strtoupper ($slogin_Username) == "ADMIN") {
  if ($slogin_canusefopen) {
    if ($_GET["log"]) {
      $showlog = abs (trim ($_GET["log"]));
    }
    else {
      $showlog = 0;
    }
    if ($showlog) {
      echo "<p class=\"maintext\">\n";
      echo "<A href=\"$slogin_php_self\">{$slogin_text[$slogin_lang]["ReturnLogList"]}</a>";
      echo "</p>";
      echo "<pre>";
      @include (SLOGIN_LOG_PREFIX . $showlog . SLOGIN_LOG_SUFFIX . ".txt");
      echo "</pre>";
      echo "<p class=\"maintext\">\n";
      echo "<A href=\"$slogin_php_self\">{$slogin_text[$slogin_lang]["ReturnLogList"]}</a>";
      echo "</p>";
    }
    else {
      echo "<p class=\"maintext\">\n";
      echo "<A href=\"index.php\">{$slogin_text[$slogin_lang]["ReturnHome"]}</a>";
      echo "</p>";
      fslogin_show_logs ();
      echo "<p class=\"maintext\">\n";
      echo "<A href=\"index.php\">{$slogin_text[$slogin_lang]["ReturnHome"]}</a>";
      echo "</p>";
    }
  }
  else {
    echo "<div align=\"center\">{$slogin_text[$slogin_lang]["CantLog"]}</div>";
  }
}
else {
  echo "<div align=\"center\">{$slogin_text[$slogin_lang]["NoAdmin"]}</div>";
}




include_once ("footer.inc.php");
?>