diff --git a/php/RemoteDataCenter/RemoteParamManager.php b/php/RemoteDataCenter/RemoteParamManager.php index 1424bed..a2ffcf6 100644 --- a/php/RemoteDataCenter/RemoteParamManager.php +++ b/php/RemoteDataCenter/RemoteParamManager.php @@ -12,7 +12,7 @@ class RemoteParamManager protected $center; public $xmlDom, $xmlName; - public $paramId, $remoteViId, $localInfo, $paramDom, $paramXML; + public $baseId, $paramId, $remoteViId, $localInfo, $paramDom, $paramXML; function __construct() { @@ -30,6 +30,12 @@ class RemoteParamManager if (!file_exists(USERWSDIR."RemoteParams.xml")) return array("err" => "No RemoteParams.xml"); + if (!is_dir(RemoteData."/PARAMS")) + mkdir(RemoteData."/PARAMS", 0755, true); + + if (!is_dir(RemoteData."/PARAMS_INFO")) + mkdir(RemoteData."/PARAMS_INFO", 0755, true); + $this->xmlName = USERWSDIR."RemoteParams.xml"; $this->xmlDom = new DomDocument("1.0"); $this->xmlDom->load($this->xmlName); @@ -81,7 +87,7 @@ class RemoteParamManager $paramNode->appendChild($xml->createElement("process")); $paramNode->appendChild($xml->createElement("output")); - return $xml->save(RemoteData.$this->center->baseID."/".$this->paramId.".xml"); + return $xml->save(RemoteData."/PARAMS/".$this->paramId.".xml"); } // TODO not used - too complicated @@ -291,5 +297,13 @@ class RemoteParamManager return array('res'=> $obj->id); } + + public function getInfoName($datasetId) { + +// if ($this->baseId == 'CDAWEB') +// return strtolower($datasetId)."_00000000_v01.cdf"; + return $datasetId.'.xml'; + + } } ?> \ No newline at end of file diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index 692a69e..d28e744 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -575,27 +575,34 @@ class AmdaAction return $childrenToReturn; } + /* + * add Remote Parameter to user RemoteParams.xml + * send request to DDServer to AddVi if Vi doesn't exist + * create Remote Parameter Description + */ public function saveTree($obj) { - $paramMgr = new ParamMgr(); + $paramMgr = new RemoteParamManager(); return $paramMgr->saveTree($obj); } - - public function doNothing($obj) - { - return array("res" => 'ok'); - - } - + + /* + * delete Remote Parameter from user RemoteParams.xml + */ public function deleteFromTree($obj) { - $paramMgr = new ParamMgr(); + $paramMgr = new RemoteParamManager(); return $paramMgr->deleteFromTree($obj); } + + public function doNothing($obj) + { + return array("res" => 'ok'); + } -/* -* temporary object fromUpload -*/ + /* + * get temporary object from Upload + */ public function getUploadedObject($name, $format, $nodeType) { switch ($nodeType) @@ -612,14 +619,12 @@ class AmdaAction default: return array("error" => $nodeType." NOT_IMPLEMENTED_YET"); } - return $objectMgr->getUploadedObject($name, $format, true); - } -/* -* fill ascii file into grid -*/ + /* + * fill ascii file into grid + */ public function getAsciiFile($obj) { $objectMgr = new FilesMgr(); @@ -632,9 +637,9 @@ class AmdaAction return $objectMgr->getParamInfo($object); } -/* -* temporary object from Search -*/ + /* + * get temporary object from Search + */ public function getTmpObject($folderId, $name, $nodeType) { switch ($nodeType) diff --git a/php/classes/UserMgr.php b/php/classes/UserMgr.php index d1d8c7a..9152bbe 100644 --- a/php/classes/UserMgr.php +++ b/php/classes/UserMgr.php @@ -77,7 +77,7 @@ class UserMgr $this->user = $_GET['sessionID']; else if (isset($sessionID)) $this->user = $sessionID; - $this->amdaClient = new AmdaClient(); + // $this->amdaClient = new AmdaClient(); } //TODO if needed?? set session ID @@ -260,7 +260,7 @@ class UserMgr { $remoteBases = new DomDocument("1.0"); $availableMis = $this->userMissions['external']; - +unlink(USERWSDIR.'RemoteParams.xml'); if (file_exists(USERWSDIR.'RemoteParams.xml')) { // replace IMPEX nodes @@ -325,7 +325,7 @@ class UserMgr if ($bases->length == 0) return 'NO REMOTE BASES'; - $paramMgr = new ParamMgr(); + $paramMgr = new RemoteParamManager(); $paramMgr->xmlDom = new DomDocument("1.0"); $paramMgr->xmlDom->formatOutput = true; $paramMgr->xmlDom->preserveWhiteSpace = false; @@ -537,22 +537,22 @@ class UserMgr // if new info exists it will be shown to : // public => to all // special => to group members - if (file_exists($this->userdir.'newInfo')) - { - $amdaInfo = new AmdaNews($this->user); - // if status = 0 - it is special info to group members only - // else to all - $info = $this->getUserInfo($this->user); - $status = $amdaInfo->makeInfo($info['group']); - - if ($status) $this->isNewInfo = true; - - unlink($this->userdir.'newInfo'); - } +// if (file_exists($this->userdir.'newInfo')) +// { +// $amdaInfo = new AmdaNews($this->user); +// // if status = 0 - it is special info to group members only +// // else to all +// $info = $this->getUserInfo($this->user); +// $status = $amdaInfo->makeInfo($info['group']); +// +// if ($status) $this->isNewInfo = true; +// +// unlink($this->userdir.'newInfo'); +// } touch($this->userdir.'newLogin'); $this->setPath(); - $this->userMissions = $this->getAvailableMissionsByUser(); + // $this->userMissions = $this->getAvailableMissionsByUser(); if (file_exists(USERWSDIR.'LocalParams.xml')) unlink(USERWSDIR.'LocalParams.xml'); @@ -571,8 +571,8 @@ class UserMgr /* * Special groups are defined in the generic_data/SpecialSettings/Groups.xml */ - $specialGroup = $this->isSpecialGroup(); - + // $specialGroup = $this->isSpecialGroup(); + $specialGroup = false; // Special Info for special groups if ($specialGroup) { -- libgit2 0.21.2