Location: PHPKode > projects > PHP Half-Life Monitor > phlmon-1.0.2-beta/default.php
<?php

#    PHP Half-Life Monitor 1.0.2-beta
#
#    $Id: default.php,v 1.10 2004/04/02 21:06:12 sloede Exp $
#
#    This file is part of the PHP Half-Life Monitor program
#
#    (c) 2002-2004 by Michael Schlottke <hide@address.com> <http://phlmon.sloede.com>
#
#    PHP Half-Life Monitor (short: PHLMon ) 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 PHLMon; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


if (!file_exists("functions.php")) {
    die("ERROR - Functions file missing: <b>functions.php</b><br><br>Aborting...");
}
include("functions.php");

if (!file_exists("config.inc.php")) {
    die("ERROR - Config file missing: <b>config.inc.php</b><br><br>Aborting...");
}
include("config.inc.php");

if (!file_exists("template.php")) {
    die("ERROR - Template file missing: <b>template.php</b><br><br>Aborting...");
}
include("template.php");

if (!file_exists($phlmonConfig['languageFile'])) {
    generateError("ERROR - Language file missing: <b>$languageFile</b><br><br>Aborting...");
}
include($phlmonConfig['languageFile']);

if (!file_exists("Halfc.class.php")) {
    generateError("ERROR - Halfc class file missing: <b>Halfc.class.php</b><br><br>Aborting...");
}
include("Halfc.class.php");

if (!file_exists($phlmonConfig['fileNames']['serverList'])) {
    generateError("ERROR - Server file missing: <b>".$phlmonConfig['fileNames']['serverList']."p</b><br><br>Aborting...");
}

if (!file_exists($phlmonConfig['fileNames']['configList'])) {
    generateError("ERROR - Server config file missing: <b>".$phlmonConfig['fileNames']['configList']."</b><br><br>Aborting...");
}

if (!is_writable($phlmonConfig['fileNames']['serverList']) || !is_writable($phlmonConfig['fileNames']['serverList'])) {
    generateError("ERROR - Missing access rights: <b>".$phlmonConfig['fileNames']['serverList']."</b> and
        <b>".$phlmonConfig['fileNames']['configList']."</b> must be writable (chmod 666)<br><br>
        Aborting...");
}

if (!is_dir($phlmonConfig['configDirectory'])) {
    generateError("ERROR - Wrong config settings(configDirectory): <b>".$phlmonConfig['configDirectory']."</b> is not a valid directory!<br><br>
        Aborting...");
}

if (!is_readable($phlmonConfig['configDirectory'])) {
    generateError("ERROR - Missing access rights: directory <b>".$phlmonConfig['configDirectory']."</b> must be readable (chmod 755)<br><br>
        Aborting...");
}

loadServerList();
loadConfigList();

$halfc = new Halfc();

$server = array();
$action = isset($_POST['action']) ? $_POST['action'] : $_GET['action'];
$ID = isset($_POST['ID']) ? $_POST['ID'] : $_GET['ID'];
$serializedData = isset($_POST['serializedData']) ? $_POST['serializedData'] : $_GET['serializedData'];

define("VERSION", "1.0.2-beta");

if ($phlmonConfig['useSessions'] != "no") {
    session_start();
    define("SESSION","PHPSESSID=".session_id());
} else {
    $unserializedData = unserialize(base64_decode($serializedData));
}

initAuthentication();
initServer();
initHostnames();

?>
Return current item: PHP Half-Life Monitor