From cdf414bf6a999788d4d70e997f8c413e96ef7bb1 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 10 Dec 2020 14:01:18 +0100 Subject: [sysconfig] CustomModule: Add check for file ownership, add "fix" option The fix option will change the owner/group of every file and directory in the archive to root:root Previously, the client changed the ownership of the config.tgz contents to root when extracting, but in some cases it's desired to deliver files with specific owner and group settings. The version of the CustomModule module has been bumped to 2, so we can automatically convert old modules when upgrading or importing a backup, to be compatible to the old "root everything on the client" logic. --- modules-available/sysconfig/page.inc.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'modules-available/sysconfig/page.inc.php') diff --git a/modules-available/sysconfig/page.inc.php b/modules-available/sysconfig/page.inc.php index 1ef478b3..ff3983c1 100644 --- a/modules-available/sysconfig/page.inc.php +++ b/modules-available/sysconfig/page.inc.php @@ -267,27 +267,7 @@ class Page_SysConfig extends Page Taskmanager::addErrorMessage($status); Util::redirect('?do=sysconfig&locationid=' . $this->currentLoc); } - - // Sort files for better display - $dirs = array(); - foreach ($status['data']['entries'] as $file) { - if ($file['isdir']) - continue; - $dirs[dirname($file['name'])][] = $file; - } - ksort($dirs); - $list = array(); - foreach ($dirs as $dir => $files) { - $list[] = array( - 'name' => $dir, - 'isdir' => true - ); - sort($files); - foreach ($files as $file) { - $file['size'] = Util::readableFileSize($file['size']); - $list[] = $file; - } - } + $list = SysConfig::archiveContentsFromTask($status); // render the template Render::addDialog(Dictionary::translate('lang_contentOf') . ' ' . $row['title'], false, 'custom-filelist', array( -- cgit v1.2.3-55-g7522