Project

General

Profile

Bug #16430 » 3977_2.diff

Administrator Admin, 2008-07-25 18:58

View differences:

t3lib/class.t3lib_div.php (Arbeitskopie)
/**
* Setting file system mode & group ownership of file
*
* @param string Filepath of newly created file
* @return void
* @param string Filepath of newly created file
* @param boolean If set, also fixes permissions of files and folders in the folder (if $file is a folder)
* @return void
*/
public static function fixPermissions($file) {
if (@is_file($file) && TYPO3_OS!='WIN') {
@chmod($file, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'])); // "@" is there because file is not necessarily OWNED by the user
if($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']) { // skip this if createGroup is empty
@chgrp($file, $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']); // "@" is there because file is not necessarily OWNED by the user
public static function fixPermissions($path, $recursively = false) {
if (TYPO3_OS != 'WIN') {
if (is_file($path)) {
@chmod($path, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'])); // "@" is there because file is not necessarily OWNED by the user
} elseif (is_dir($path)) {
@chmod($path, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask'])); // "@" is there because file is not necessarily OWNED by the user
}
if($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']) { // skip this if createGroup is empty
@chgrp($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']); // "@" is there because file is not necessarily OWNED by the user
}
if (is_dir($path) && $recursively) {
$handle = opendir($path);
while (($file = readdir($handle)) !== false) {
if ($file != '.' && $file != '..') {
if (@is_file($path . $file)) {
t3lib_div::fixPermissions($path . $file);
} elseif (@is_dir($path . $file.'/')) {
t3lib_div::fixPermissions($path . $file . '/', true);
}
}
}
}
}
}
......
}
}
?>
?>
typo3/mod/tools/em/class.em_index.php (Arbeitskopie)
</script>
';
echo $contentParts[1] . $this->doc->endPage();
t3lib_div::fixPermissions(PATH_typo3conf.'l10n/', true);
exit;
}
(2-2/7)