From 05961422a7b47e79626830b986ffef6f3f8316c8 Mon Sep 17 00:00:00 2001 From: Elena.Budnik Date: Fri, 15 Jun 2018 11:14:33 +0200 Subject: [PATCH] permissions on dirs --- php/RemoteDataCenter/RemoteDataCenterClass.php | 4 +--- php/RemoteDataCenter/RemoteParamManager.php | 14 +++++++------- php/RemoteDataCenter/getRemoteDDBaseProxies.php | 6 +++--- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/php/RemoteDataCenter/RemoteDataCenterClass.php b/php/RemoteDataCenter/RemoteDataCenterClass.php index 086e223..1026e38 100644 --- a/php/RemoteDataCenter/RemoteDataCenterClass.php +++ b/php/RemoteDataCenter/RemoteDataCenterClass.php @@ -53,9 +53,7 @@ abstract class RemoteDataCenterClass public function initProxy() { if (!is_dir(RemoteData.$this->baseID)) - mkdir(RemoteData.$this->baseID); - - chmod(RemoteData.$this->baseID,0775); + mkdir(RemoteData.$this->baseID, 0775, true); $this->getRemoteTree(); } diff --git a/php/RemoteDataCenter/RemoteParamManager.php b/php/RemoteDataCenter/RemoteParamManager.php index 3ee109e..9218cd4 100644 --- a/php/RemoteDataCenter/RemoteParamManager.php +++ b/php/RemoteDataCenter/RemoteParamManager.php @@ -31,10 +31,10 @@ class RemoteParamManager return array("err" => "No RemoteParams.xml"); if (!is_dir(RemoteData."/PARAMS")) - mkdir(RemoteData."/PARAMS", 0755, true); + mkdir(RemoteData."/PARAMS", 0775, true); if (!is_dir(RemoteData."/PARAMS_INFO")) - mkdir(RemoteData."/PARAMS_INFO", 0755, true); + mkdir(RemoteData."/PARAMS_INFO", 0775, true); $this->xmlName = USERWSDIR."RemoteParams.xml"; $this->xmlDom = new DomDocument("1.0"); @@ -148,6 +148,7 @@ class RemoteParamManager $paramNode->appendChild($xml->createElement("output")); $res = $xml->save($xmlNameRemote); + if ($res) return copy($xmlNameRemote, $xmlNameTemp); @@ -177,7 +178,6 @@ class RemoteParamManager // Node to be added $nodeRemote = $this->center->baseDom->getElementById($id); - // No such node in base.xml if (!$nodeRemote) return false; @@ -185,12 +185,12 @@ class RemoteParamManager { $this->center->setViId($nodeRemote->getAttribute('name')); $status = $this->center->addViToDD(); - + if (!$status) return false; $remoteDatasetInfo = DDSERVICE."/BASE/INFO/bases/".$this->center->baseID."/".$this->center->infoFile; $localDatasetInfo = RemoteData.$this->center->baseID."/".$this->center->infoFile; - + if (!copy($remoteDatasetInfo,$localDatasetInfo)) return false; } @@ -201,9 +201,9 @@ class RemoteParamManager $this->center->setParamId($nodeRemote->getAttribute('name')); $this->center->setViId($nodeRemote->parentNode->getAttribute('name')); $this->center->setInfoFile(); - + if (!$this->makeInternalParamXml()) return false; - + if (($size = $this->center->getParamSize()) > 1) { // make components and args diff --git a/php/RemoteDataCenter/getRemoteDDBaseProxies.php b/php/RemoteDataCenter/getRemoteDDBaseProxies.php index adcfb9f..c553f50 100644 --- a/php/RemoteDataCenter/getRemoteDDBaseProxies.php +++ b/php/RemoteDataCenter/getRemoteDDBaseProxies.php @@ -16,7 +16,7 @@ // only "DDBASE" Bases.xml if (!file_exists(DATAPATH."/RemoteData/Bases.xml")) { - if (!is_dir(DATAPATH."/RemoteData")) mkdir(DATAPATH."/RemoteData"); + if (!is_dir(DATAPATH."/RemoteData")) mkdir(DATAPATH."/RemoteData", 0775, true); echo 'No Bases.xml file : Will use Bases.xml from DDBase'.PHP_EOL; $basesDom = new DomDocument("1.0"); @@ -29,7 +29,7 @@ $baseDir = DATAPATH."/RemoteData/$baseId"; $baseDirRemote = DDSERVICE."/BASE/INFO/bases/$baseId"; - if (!is_dir($baseDir)) mkdir($baseDir); + if (!is_dir($baseDir)) mkdir($baseDir, 0775, true); if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) echo "Cannot copy base.xml for $baseId".PHP_EOL; } @@ -51,7 +51,7 @@ if (!$basesDom->getElementById($baseId)) { $baseDir = DATAPATH."/RemoteData/$baseId"; $baseDirRemote = DDSERVICE."/BASE/INFO/bases/$baseId"; - if (!is_dir($baseDir)) mkdir($baseDir); + if (!is_dir($baseDir)) mkdir($baseDir, 0775, true); if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) { echo "Cannot copy base.xml for $baseId".PHP_EOL; } -- libgit2 0.21.2