#9771 added execution permission in files

This commit is contained in:
Daniel Cebrian 2023-06-14 17:16:53 +02:00
parent d52e31e94c
commit 18719a3ac4
1 changed files with 25 additions and 8 deletions

View File

@ -430,10 +430,7 @@ class ManageExtensions extends HTML
return false;
}
chmod($installationFolder, 0777);
foreach (glob($installationFolder.'/*') as $file) {
chmod($file, 0777);
}
$this->setPermissionfiles($installationFolder);
$result = $this->copyExtensionToServer($installationFolder, $nameFolder);
if ($result === false) {
@ -476,10 +473,7 @@ class ManageExtensions extends HTML
}
$result = $this->copyFolder($path, $serverPath, $filesToExclude);
chmod($serverPath, 0777);
foreach (glob($serverPath.'/*') as $file) {
chmod($file, 0777);
}
$this->setPermissionfiles($serverPath);
return $result;
}
@ -983,4 +977,27 @@ class ManageExtensions extends HTML
}
/**
* Set execution permission in folder items and subfolders.
*
* @param string $path Path folder to apply permissions.
*
* @return void
*/
private function setPermissionfiles($path)
{
chmod($path, 0777);
if (is_dir($path)) {
$items = scandir($path);
foreach ($items as $item) {
if ($item != '.' && $item != '..') {
$itemPath = $path.'/'.$item;
$this->setPermissionfiles($itemPath);
}
}
}
}
}