diff options
Diffstat (limited to 'mayor-orig/www/policy/public/naplo')
-rw-r--r-- | mayor-orig/www/policy/public/naplo/rpc/rpc-pre.php | 48 | ||||
-rw-r--r-- | mayor-orig/www/policy/public/naplo/rpc/rpc.php | 7 |
2 files changed, 55 insertions, 0 deletions
diff --git a/mayor-orig/www/policy/public/naplo/rpc/rpc-pre.php b/mayor-orig/www/policy/public/naplo/rpc/rpc-pre.php new file mode 100644 index 00000000..53328c7c --- /dev/null +++ b/mayor-orig/www/policy/public/naplo/rpc/rpc-pre.php @@ -0,0 +1,48 @@ +<?php + + require_once('include/share/ssl/ssl.php'); + /* Class: Interconnect AES */ + + /* remote procedure call remote controller */ + $rpcDetails = $_GET['detail']; + $initOMKod = readVariable($_GET['init'],'strictstring',0); + + try + { + $RPC = new Interconnect(); + $RPC->setRemoteOMKod($initOMKod); + $REQUEST = $RPC->processRequest($rpcDetails); + $func = $REQUEST->func; + } + catch (Exception $e) + { + $func=''; + $DATA = array('error'=>$e->getMessage()); + } + // processing + + // MASTER BOSS -> portal/rpc/rpc, ez itt ELAVULT + $DATA = array(); + if (isset($func) && $func!='') { + switch ($func) { + case 'getVersion': + case 'ping': + $DATA = $RPC->prepareReply( + array('func'=>'getVersion','response_revision'=>_MAYORREV,'pong') + ); + $RPC->setResponse($DATA); + break; + case 'checkRegistration': + $otherPublicKey = getSslPublicKeyByOMKod($REQUEST->OMKOD); + if ($otherPublicKey===false) $valid=0; + elseif ($REQUEST->publicKey == $otherPublicKey) $valid=1; + else $valid=2; + $DATA = $RPC->prepareReply( + array('func'=>$func,'response'=>serialize($REQUEST),'valid'=>$valid) + ); + $RPC->setResponse($DATA); + default: + break; + } + } +?> diff --git a/mayor-orig/www/policy/public/naplo/rpc/rpc.php b/mayor-orig/www/policy/public/naplo/rpc/rpc.php new file mode 100644 index 00000000..be00b0a5 --- /dev/null +++ b/mayor-orig/www/policy/public/naplo/rpc/rpc.php @@ -0,0 +1,7 @@ +<?php + + global $DATA; + + if (count($DATA)>0) putResponse($DATA); // reply + +?> |