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

//***************************************************
//** Handles inserts updates and tasks
//***************************************************
$LOAD_DB = true;
require_once '../config/config.inc.php';
$Req = new fgObject($_POST);
//** Reply
$Response = new fgResponse();
try {
    //* check action is set
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
    if (!$action) {
        throw new fgException('no action', 'action variable set');
    }
    //* execute an action
    switch ($action) {
        case 'signup':
            $Auth = new fgAuth();
            $Auth->signUp($_REQUEST);
            break;
        case 'server':
            $S = new fgServer($Req->server_id);
            $obj->type = $Req->type;
            $obj->nick = $Req->nick;
            $obj->host = $Req->host;
            $obj->ip = $Req->ip;
            $obj->comment = $Req->comment;
            $obj->location = $Req->location;
            $obj->contact = $Req->contact;
Пример #2
0
function my_ssexception_handler($exception)
{
    echo "@Exception:" . $exception->getMessage();
    fgResponse::send_exception($exception);
}
Пример #3
0
<?php

require_once '../config/config.inc.php';
//$url = "sshttp://mpmap02.flightgear.org/fg_server_xml.cgi?mpserver02.flightgear.org:5001s";
//$xml_string = file_get_contents($url);
//echo "<pre>";
//print_r($xml_string);
//die;
//* Feed object
$Feed = new fgFeed();
$Response = new fgResponse();
try {
    //*  Process Request
    $feed_requested = isset($_REQUEST['feed']) ? $_REQUEST['feed'] : null;
    if ($feed_requested) {
        $Feed->validateFeed($feed_requested);
        $Response->add($Feed->getFeed($feed_requested));
    } else {
        $Response->add($Feed->welcomeIndex());
    }
    //header('Content-type: text/plain');
    //echo json_encode($data);
    $Response->sendPayload();
} catch (fgException $e) {
    //echo 'Caught exception: ',  $e->getMessage(), "\n";
    $Response->sendError($e);
}
Пример #4
0
<?php

//***************************************************
//** Handles inserts updates and tasks
//***************************************************
require_once '../config/config.inc.php';
$Response = new fgResponse();
//print_R($smarty);
//$Site = new fgSite('rpc','RPC');
fgHelper::plain();
try {
    //* check action is set
    $fetch = isset($_REQUEST['fetch']) ? $_REQUEST['fetch'] : null;
    if (!$fetch) {
        throw new fgException('no fetch', 'fetch variable set');
    }
    //* perform on action
    switch ($fetch) {
        case 'servers':
            $Response->add('servers', fgServer::index());
            break;
        case 'users':
            $Response->add('users', fgUser::index());
            break;
        case 'aircraft':
            $Response->add('aircraft', fgAero::index());
            break;
        case 'aero_info':
            $Aero = new fgAero($_REQUEST['aero_id']);
            $smarty->assign('Aero', $Aero);
            $html = $smarty->fetch("aircraft/ajax.aero.html");