Commit 05961422a7b47e79626830b986ffef6f3f8316c8

Authored by Elena.Budnik
1 parent 1798cae0

permissions on dirs

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