From 43de9af71f7f4ca5731b94a06d688ae8412ba427 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 6 Jul 2018 11:14:41 +0200 Subject: 2018/Feb/28 -i állapot hozzáadva, mint a módosítások kiindulási állapota --- mayor-orig/www/policy/public/rpc/naplo/rpc-pre.php | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 mayor-orig/www/policy/public/rpc/naplo/rpc-pre.php (limited to 'mayor-orig/www/policy/public/rpc/naplo') diff --git a/mayor-orig/www/policy/public/rpc/naplo/rpc-pre.php b/mayor-orig/www/policy/public/rpc/naplo/rpc-pre.php new file mode 100644 index 00000000..aba7552f --- /dev/null +++ b/mayor-orig/www/policy/public/rpc/naplo/rpc-pre.php @@ -0,0 +1,70 @@ +setRemoteHostByNodeId($senderNodeId); + $RPC->processRequest(); + $_RPC['request'] = $RPC->getIncomingRequest(); + */ + $func = $_RPC['request']['func']; + // 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; + case 'getPrivilegeInfo': + $nodeId = $_RPC['senderNodeId']; + $userAccount = readVariable($_RPC['request']['userAccount'], 'string'); + $OMKod = readVariable($_RPC['request']['OMKod'],'numeric unsigned'); + $priv = explode(',',getRPCPrivilegeByNUO($nodeId, $userAccount, $OMKod)); + if (is_array($priv) && in_array('Jogosultság',$priv)) { + $DATA = array('func'=>'getPrivilegeInfo','result'=>'success','priv'=>$priv); + } else { + $DATA = array('func'=>'getPrivilegeInfo','result'=>'failure','alert'=>'message:insufficient_access'); + } + $RPC->setResponse($DATA); + break; + case 'getTantargyfelosztasStat': + $nodeId = $_RPC['senderNodeId']; + $userAccount = readVariable($_RPC['request']['userAccount'], 'string'); + $OMKod = readVariable($_RPC['request']['OMKod'],'numeric unsigned'); // a naplo/base/rights már felhasználta az __INTEZMENY beállításnál + $priv = explode(',',getRPCPrivilegeByNUO($nodeId, $userAccount, $OMKod)); + if (is_array($priv) && in_array('Tantárgyfelosztás',$priv)) { + // Az __INTEZMENY és __TANEV beállítását a naplo/rights.php már elvégezte... + + require_once('include/modules/naplo/share/intezmenyek.php'); + require_once('include/modules/naplo/share/osztaly.php'); + require_once('include/modules/naplo/share/targy.php'); + require_once('include/modules/naplo/share/tankor.php'); + require_once('include/modules/naplo/stat/tantargyFelosztas.php'); + global $ADAT; $ADAT = array(); + $IA = getTantargyfelosztasStat(); + + $DATA = array('func'=>'getTantargyfelosztasStat','result'=>'success','tanev'=>__TANEV,'intezmeny'=>__INTEZMENY, 'IA'=>$IA); + } else { + $DATA = array('func'=>'getTantargyfelosztasStat','result'=>'failure','alert'=>'message:insufficient_access'); + } + $RPC->setResponse($DATA); + break; + default: + $DATA['result'] = 'ismeretlen függvény: '.$func; + break; + } + + } +?> -- cgit v1.2.3