use correct makeCorrect(Dir/File) everywhere

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-19 17:13:41 +01:00
parent 8e84a4ff44
commit c4024c8107
53 changed files with 328 additions and 345 deletions

View File

@@ -36,7 +36,7 @@
function findDirs($path, $uid, $gid)
{
$_fileList = array();
$path = makeCorrectDir($path);
$path = \Froxlor\FileDir::makeCorrectDir($path);
// valid directory?
if (is_dir($path)) {
@@ -77,7 +77,7 @@ function findDirs($path, $uid, $gid)
// check every file
foreach ($its as $fullFileName => $it) {
if ($it->isDir() && (fileowner($fullFileName) == $uid || filegroup($fullFileName) == $gid)) {
$_fileList[] = makeCorrectDir(dirname($fullFileName));
$_fileList[] = \Froxlor\FileDir::makeCorrectDir(dirname($fullFileName));
}
}
$_fileList[] = $path;

View File

@@ -49,6 +49,6 @@ function makeChownWithNewStats($row) {
// only run chown if directory exists
if (file_exists($dir)) {
// run chown
safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(makeCorrectDir($dir)));
safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
}
}

View File

@@ -69,7 +69,7 @@ function makePathfield($path, $uid, $gid, $value = '', $dom = false) {
if (empty($dir)) {
$dir = '/';
}
$dir = makeCorrectDir($dir);
$dir = \Froxlor\FileDir::makeCorrectDir($dir);
}
$_field.= makeoption($dir, $dir, $value);
}

View File

@@ -52,7 +52,7 @@ function storeDefaultIndex($loginname = null, $destination = null, $logger = nul
);
$htmlcontent = replace_variables($template['value'], $replace_arr);
$indexhtmlpath = makeCorrectFile($destination . '/index.' . Settings::Get('system.index_file_extension'));
$indexhtmlpath = \Froxlor\FileDir::makeCorrectFile($destination . '/index.' . Settings::Get('system.index_file_extension'));
$index_html_handler = fopen($indexhtmlpath, 'w');
fwrite($index_html_handler, $htmlcontent);
fclose($index_html_handler);
@@ -61,7 +61,7 @@ function storeDefaultIndex($loginname = null, $destination = null, $logger = nul
}
} else {
$destination = makeCorrectDir($destination);
$destination = \Froxlor\FileDir::makeCorrectDir($destination);
if ($logger !== null) {
$logger->logAction(CRON_ACTION, LOG_NOTICE, 'Running: cp -a ' . \Froxlor\Froxlor::getInstallDir() . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
}