예제 #1
0
<?php

/*
 * WolfPanel (c) 2015 by Fursystems.de (Marcel Kallen)
 * 
 * WolfPanel is licensed under a
 * Creative Commons Attribution-NonCommercial 4.0 International License.
 * 
 * You should have received a copy of the license along with this
 * work. If not, see <http://creativecommons.org/licenses/by-nc/4.0/>. 
 */
include "../core.php";
if (isset($_POST["id"])) {
    // Gameserver ID
    $err = @Utils::checkInput($_POST['id'], "Gameserver ID", 1, 64, INPUT_TYPE_NUMERIC);
    if (strlen($err) != 0) {
        $error[] = $err;
    } else {
        if (!GameserverManager::existsById($_POST['id'])) {
            $error[] = "The given Gameserver doesnt exist.";
        } else {
            $gameserver = new Gameserver($_POST['id']);
            if ($gameserver->getOwnerId() != UserManager::GetLocalUser()->getData("id")) {
                $error[] = "You dont have permission to perform this command";
            } else {
                $smarty->assign("log", "<pre>" . $gameserver->getLatestLog() . "</pre>");
            }
        }
    }
    $smarty->display("ajax/getGameserverLog.tpl");
}