Commit 05961422a7b47e79626830b986ffef6f3f8316c8

Authored by Elena.Budnik
1 parent 1798cae0

permissions on dirs

php/RemoteDataCenter/RemoteDataCenterClass.php
@@ -53,9 +53,7 @@ abstract class RemoteDataCenterClass @@ -53,9 +53,7 @@ abstract class RemoteDataCenterClass
53 public function initProxy() 53 public function initProxy()
54 { 54 {
55 if (!is_dir(RemoteData.$this->baseID)) 55 if (!is_dir(RemoteData.$this->baseID))
56 - mkdir(RemoteData.$this->baseID);  
57 -  
58 - chmod(RemoteData.$this->baseID,0775); 56 + mkdir(RemoteData.$this->baseID, 0775, true);
59 57
60 $this->getRemoteTree(); 58 $this->getRemoteTree();
61 } 59 }
php/RemoteDataCenter/RemoteParamManager.php
@@ -31,10 +31,10 @@ class RemoteParamManager @@ -31,10 +31,10 @@ class RemoteParamManager
31 return array("err" => "No RemoteParams.xml"); 31 return array("err" => "No RemoteParams.xml");
32 32
33 if (!is_dir(RemoteData."/PARAMS")) 33 if (!is_dir(RemoteData."/PARAMS"))
34 - mkdir(RemoteData."/PARAMS", 0755, true); 34 + mkdir(RemoteData."/PARAMS", 0775, true);
35 35
36 if (!is_dir(RemoteData."/PARAMS_INFO")) 36 if (!is_dir(RemoteData."/PARAMS_INFO"))
37 - mkdir(RemoteData."/PARAMS_INFO", 0755, true); 37 + mkdir(RemoteData."/PARAMS_INFO", 0775, true);
38 38
39 $this->xmlName = USERWSDIR."RemoteParams.xml"; 39 $this->xmlName = USERWSDIR."RemoteParams.xml";
40 $this->xmlDom = new DomDocument("1.0"); 40 $this->xmlDom = new DomDocument("1.0");
@@ -148,6 +148,7 @@ class RemoteParamManager @@ -148,6 +148,7 @@ class RemoteParamManager
148 $paramNode->appendChild($xml->createElement("output")); 148 $paramNode->appendChild($xml->createElement("output"));
149 149
150 $res = $xml->save($xmlNameRemote); 150 $res = $xml->save($xmlNameRemote);
  151 +
151 if ($res) 152 if ($res)
152 return copy($xmlNameRemote, $xmlNameTemp); 153 return copy($xmlNameRemote, $xmlNameTemp);
153 154
@@ -177,7 +178,6 @@ class RemoteParamManager @@ -177,7 +178,6 @@ class RemoteParamManager
177 178
178 // Node to be added 179 // Node to be added
179 $nodeRemote = $this->center->baseDom->getElementById($id); 180 $nodeRemote = $this->center->baseDom->getElementById($id);
180 -  
181 // No such node in base.xml 181 // No such node in base.xml
182 if (!$nodeRemote) return false; 182 if (!$nodeRemote) return false;
183 183
@@ -185,12 +185,12 @@ class RemoteParamManager @@ -185,12 +185,12 @@ class RemoteParamManager
185 { 185 {
186 $this->center->setViId($nodeRemote->getAttribute('name')); 186 $this->center->setViId($nodeRemote->getAttribute('name'));
187 $status = $this->center->addViToDD(); 187 $status = $this->center->addViToDD();
188 - 188 +
189 if (!$status) return false; 189 if (!$status) return false;
190 190
191 $remoteDatasetInfo = DDSERVICE."/BASE/INFO/bases/".$this->center->baseID."/".$this->center->infoFile; 191 $remoteDatasetInfo = DDSERVICE."/BASE/INFO/bases/".$this->center->baseID."/".$this->center->infoFile;
192 $localDatasetInfo = RemoteData.$this->center->baseID."/".$this->center->infoFile; 192 $localDatasetInfo = RemoteData.$this->center->baseID."/".$this->center->infoFile;
193 - 193 +
194 if (!copy($remoteDatasetInfo,$localDatasetInfo)) return false; 194 if (!copy($remoteDatasetInfo,$localDatasetInfo)) return false;
195 } 195 }
196 196
@@ -201,9 +201,9 @@ class RemoteParamManager @@ -201,9 +201,9 @@ class RemoteParamManager
201 $this->center->setParamId($nodeRemote->getAttribute('name')); 201 $this->center->setParamId($nodeRemote->getAttribute('name'));
202 $this->center->setViId($nodeRemote->parentNode->getAttribute('name')); 202 $this->center->setViId($nodeRemote->parentNode->getAttribute('name'));
203 $this->center->setInfoFile(); 203 $this->center->setInfoFile();
204 - 204 +
205 if (!$this->makeInternalParamXml()) return false; 205 if (!$this->makeInternalParamXml()) return false;
206 - 206 +
207 if (($size = $this->center->getParamSize()) > 1) 207 if (($size = $this->center->getParamSize()) > 1)
208 { 208 {
209 // make components and args 209 // make components and args
php/RemoteDataCenter/getRemoteDDBaseProxies.php
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 16
17 // only "DDBASE" Bases.xml 17 // only "DDBASE" Bases.xml
18 if (!file_exists(DATAPATH."/RemoteData/Bases.xml")) { 18 if (!file_exists(DATAPATH."/RemoteData/Bases.xml")) {
19 - if (!is_dir(DATAPATH."/RemoteData")) mkdir(DATAPATH."/RemoteData"); 19 + if (!is_dir(DATAPATH."/RemoteData")) mkdir(DATAPATH."/RemoteData", 0775, true);
20 echo 'No Bases.xml file : Will use Bases.xml from DDBase'.PHP_EOL; 20 echo 'No Bases.xml file : Will use Bases.xml from DDBase'.PHP_EOL;
21 $basesDom = new DomDocument("1.0"); 21 $basesDom = new DomDocument("1.0");
22 22
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 29
30 $baseDir = DATAPATH."/RemoteData/$baseId"; 30 $baseDir = DATAPATH."/RemoteData/$baseId";
31 $baseDirRemote = DDSERVICE."/BASE/INFO/bases/$baseId"; 31 $baseDirRemote = DDSERVICE."/BASE/INFO/bases/$baseId";
32 - if (!is_dir($baseDir)) mkdir($baseDir); 32 + if (!is_dir($baseDir)) mkdir($baseDir, 0775, true);
33 if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) 33 if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml"))
34 echo "Cannot copy base.xml for $baseId".PHP_EOL; 34 echo "Cannot copy base.xml for $baseId".PHP_EOL;
35 } 35 }
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 if (!$basesDom->getElementById($baseId)) { 51 if (!$basesDom->getElementById($baseId)) {
52 $baseDir = DATAPATH."/RemoteData/$baseId"; 52 $baseDir = DATAPATH."/RemoteData/$baseId";
53 $baseDirRemote = DDSERVICE."/BASE/INFO/bases/$baseId"; 53 $baseDirRemote = DDSERVICE."/BASE/INFO/bases/$baseId";
54 - if (!is_dir($baseDir)) mkdir($baseDir); 54 + if (!is_dir($baseDir)) mkdir($baseDir, 0775, true);
55 if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) { 55 if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) {
56 echo "Cannot copy base.xml for $baseId".PHP_EOL; 56 echo "Cannot copy base.xml for $baseId".PHP_EOL;
57 } 57 }