aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-base/www/policy/public/rpc/rpc-pre.php
blob: 30336e9e67fd29cd4d7e486e8f25a050d116a49b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
    module: mayor-base

    A alap metódusok RPC kezelője

*/
    require_once('include/share/ssl/ssl.php');

    try 
    {
	/* 
	    rights.php:
		$RPC = new Interconnect();
		$RPC->setRemoteHostByNodeId($senderNodeId);
		$REQUEST = $RPC->processRequest();
	*/
	$REQUEST = $RPC->getIncomingRequest();
	$func = $REQUEST['func'];

    }
    catch (Exception $e)
    {
	$func='';
	$DATA = array('error'=>$e->getMessage());	
    }
    // processing
    $DATA = array();
    if (isset($func) && $func!='') {
	switch ($func) {
	    // itt a currens verziót kellene visszaadni
	    case 'getVersion':
	    case 'ping':
		$DATA = array('func'=>'getVersion','revision'=>_MAYORREV,'pong');
		$RPC->setResponse($DATA);
		break;
	    default:
		$DATA['result'] = 'ismeretlen függvény: '.$func;
		break;
	}
	
    }
?>