Пример #1
0
<?php

$root = Config::$dir . '/files/';
$folder = '';
if (isset($_GET["folder"])) {
    $folder = str_replace('..', '', base64_decode(GETSafe('folder')));
}
include 'index.logic.php';
$header = '';
$headerhtml = '';
$inroot = strlen($folder) == 0 || streq('..', $folder) || streq('\\', $folder) || streq('/', $folder);
include 'browse.php';
if ($inroot) {
    $headerhtml = $master->GetTemplate('fileshare.header.htm');
}
$master->Smarty->assign("fs_folder_raw", $folder);
$master->Smarty->assign("fs_folder", GETSafe('folder'));
$master->Smarty->assign("fs_header_html", $headerhtml);
$master->Smarty->assign("fs_header", $header);
$space = disk_free_space($root);
$master->Smarty->assign("fs_freespace", decodeSize($space));
Пример #2
0
<?php

if (isset($_GET["uid"])) {
    $user = new Lan_users();
    if ($user->get(GETSafe("uid"))) {
        $user->updateSteamData();
        $user->update();
        if (strlen($user->avatar) == 0) {
            $user->avatar = Config::$webPath . "images/other.png";
        }
        $master->Smarty->assign("steamdata", $user->getSteamData());
        $master->Smarty->assign("user", $user);
        //Find if attending this lan
        $attendance = new Lan_attendees();
        $attendance->user_id = $user->user_id;
        $attendance->lan_id = getCurrentLID();
        $master->Smarty->assign("attending", $attendance->count() != 0);
        //Get seat
        if ($attendance->count() != 0) {
            $seat = new lan_seats();
            $seat->user_id = $user->user_id;
            $seat->lan_id = getCurrentLID();
            $seat->find();
            if ($seat->fetch()) {
                $master->Smarty->assign("seat", $seat);
            }
        }
        //Find if arrived
        $arrivals = new Lan_arrivals();
        $arrivals->user_id = $user->user_id;
        $arrivals->lan_id = getCurrentLID();
Пример #3
0
<?php

include_once 'core.php';
include 'skins/' . Config::$theme . '/setup.php';
include_once 'integration/integration.php';
//Pull through user ID
$frontend = new FrontEnd();
setCurrentUser($frontend->getUserId());
startSession(getCurrentUID(), $frontend->getName(getCurrentUID()));
//Check user is in db and run checks.
$frontend->pullUserInfo(getCurrentUID());
$frontend->checkGroups(getCurrentUID(), getCurrentLID());
$frontend->disconnect();
$page = new Lan_pages();
$page->name = GETSafe('page');
$page->find();
if ($page->fetch()) {
    $file = 'modules/' . $page->module . '/' . $page->file . '.php';
    if (file_exists($file)) {
        include $file;
        $master->RenderPage($page->module . '.' . $page->file . '.htm');
    } else {
        $master->AddError("The file for this page does not exist!");
    }
} else {
    $master->AddError("Unknown page!");
}
if ($master->HasFatalError()) {
    $master->RenderPage('error.htm');
}
$master->RenderSite('master.integration.htm');
Пример #4
0
                $list[] = $server;
            }
        }
    } catch (Exception $ex) {
    }
}
$gamelist = $q->GetGameList();
$master->Smarty->assign("gameslist", $gamelist);
foreach ($list as $server) {
    $name = $server->game;
    if (array_key_exists($server->game, $gamelist)) {
        $server->game = $gamelist[$server->game];
    }
}
$master->Smarty->assign("servers", $list);
$master->Smarty->assign("userlist", $userlist);
$master->Smarty->assign("variablelist", $variablelist);
if (isset($_GET["action"]) && streq($_GET["action"], "showplayers")) {
    $master->Smarty->assign("forceshowplayers", GETSafe("sid"));
}
$offservercount = 0;
$unoffservercount = 0;
foreach ($list as $server) {
    if (streq($server->type, "1")) {
        $offservercount++;
    } else {
        $unoffservercount++;
    }
}
$master->Smarty->assign("hasoffical", $offservercount > 0);
$master->Smarty->assign("hasunofficial", $unoffservercount > 0);
Пример #5
0
<?php

include 'editprofile.logic.php';
$userid = getCurrentUID();
if (isset($_GET["uid"])) {
    $userid = GETSafe("uid");
}
if (streq("0", $userid)) {
    $master->AddError("You must login to edit your profile!");
} else {
    $user = new Lan_users();
    if ($user->get($userid)) {
        $master->Smarty->assign("theuser", $user);
    } else {
        $master->AddError("Unknown user!");
    }
}
Пример #6
0
<?php

if (isset($_GET["action"]) && streq($_GET["action"], "edit") && isset($_POST["address"])) {
    $server = new Lan_servers();
    if ($server->get(GETSafe('sid'))) {
        $server->address = POSTSafe("address");
        $server->cport = POSTSafe("port");
        $server->qport = POSTSafe("qport");
        $server->hostnameoverride = POSTSafe("hostnameoverride");
        $server->comment = POSTSafe("comment");
        if (isset($_POST["official"])) {
            $server->type = 1;
        } else {
            $server->type = 0;
        }
        if (isset($_POST["delete"])) {
            $server->delete();
            header("Location: ?page=serverlist");
            die;
        } else {
            $server->update();
        }
    }
}
Пример #7
0
<?php

include_once 'core/util.php';
$cachedir = "cache/images/";
$source = "images/" . GETSafe('img');
$x = GETSafe('x');
$y = GETSafe('y');
$cachefile = md5($source . $x . $y);
$path = pathinfo($source);
$ext = strtolower($path["extension"]);
if (!$source || !$x || !$y) {
    die("Missing Params");
}
if (!file_exists($cachedir . $cachefile)) {
    if (!is_dir($cachedir)) {
        mkdir($cachedir, 0777);
    }
    smart_resize_image($source, $x, $y, false, $cachedir . $cachefile, false, false);
}
$im = file_get_contents($cachedir . $cachefile);
header('Expires: ' . gmdate('D, d M Y H:i:s', strtotime("+20 week")) . 'GMT');
switch ($ext) {
    case "jpeg":
    case "jpg":
        header('Content-type: image/jpeg');
        header('Content-transfer-encoding: binary');
        break;
    case "gif":
        header('Content-type: image/gif');
        header('Content-transfer-encoding: binary');
        break;
Пример #8
0
<?php

$allowed = true;
if (!CheckPermission("admin", "change permissions")) {
    $master->AddError("You do not have permission to access this page!");
    $allowed = false;
}
if ($allowed && isset($_POST["update"])) {
    $mode = new Lan_permission_modes();
    if ($mode->get(GETSafe("mode"))) {
        //Clear down settings for the current mode
        $settings = new Lan_permission_settings();
        $settings->mode_id = $mode->mode_id;
        $settings->find();
        while ($settings->fetch()) {
            $settings->delete();
        }
        //Add settings for the current mode
        foreach ($_POST as $k => $v) {
            if (!streq("update", $k) || streq("1", $v)) {
                $values = explode("-", $k);
                if (2 == count($values)) {
                    //	echo "perm " . $values[0] . " group " . $values[1];
                    $settings = new Lan_permission_settings();
                    $settings->group_id = $values[1];
                    $settings->mode_id = $mode->mode_id;
                    $settings->permission_id = $values[0];
                    $settings->insert();
                }
            }
        }