Use dolChmod
This commit is contained in:
parent
d976372d87
commit
0b4cacd291
@ -80,8 +80,18 @@ if ($action == 'updateform') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
$tmpumask = GETPOST('MAIN_UMASK', 'alpha');
|
||||||
|
$tmpumask = (octdec($tmpumask) & 0666);
|
||||||
|
$tmpumask = decoct($tmpumask);
|
||||||
|
if (!preg_match('/^0/', $tmpumask)) {
|
||||||
|
$tmpumask = '0'.$tmpumask;
|
||||||
|
}
|
||||||
|
if (empty($tmpumask) || $tmpumask === '0') {
|
||||||
|
$tmpumask = '0664';
|
||||||
|
}
|
||||||
|
|
||||||
$res3 = dolibarr_set_const($db, 'MAIN_UPLOAD_DOC', GETPOST('MAIN_UPLOAD_DOC', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res3 = dolibarr_set_const($db, 'MAIN_UPLOAD_DOC', GETPOST('MAIN_UPLOAD_DOC', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res4 = dolibarr_set_const($db, "MAIN_UMASK", GETPOST('MAIN_UMASK', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res4 = dolibarr_set_const($db, "MAIN_UMASK", $tmpumask, 'chaine', 0, '', $conf->entity);
|
||||||
$res5 = dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim($antivircommand), 'chaine', 0, '', $conf->entity);
|
$res5 = dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim($antivircommand), 'chaine', 0, '', $conf->entity);
|
||||||
$res6 = dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim($antivirparam), 'chaine', 0, '', $conf->entity);
|
$res6 = dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim($antivirparam), 'chaine', 0, '', $conf->entity);
|
||||||
if ($res3 && $res4 && $res5 && $res6) {
|
if ($res3 && $res4 && $res5 && $res6) {
|
||||||
|
|||||||
@ -746,7 +746,7 @@ class Documents extends DolibarrApi
|
|||||||
if ($fhandle) {
|
if ($fhandle) {
|
||||||
$nbofbyteswrote = fwrite($fhandle, $newfilecontent);
|
$nbofbyteswrote = fwrite($fhandle, $newfilecontent);
|
||||||
fclose($fhandle);
|
fclose($fhandle);
|
||||||
@chmod($destfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($destfiletmp);
|
||||||
} else {
|
} else {
|
||||||
throw new RestException(500, "Failed to open file '".$destfiletmp."' for write");
|
throw new RestException(500, "Failed to open file '".$destfiletmp."' for write");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2278,7 +2278,7 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
$outputfiletmp = tempnam($conf->agenda->dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
$outputfiletmp = tempnam($conf->agenda->dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
||||||
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($outputfiletmp);
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
if ($format == 'vcal') {
|
if ($format == 'vcal') {
|
||||||
|
|||||||
@ -1700,9 +1700,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
fclose($this->file);
|
fclose($this->file);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($this->filename);
|
||||||
@chmod($this->filename, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -820,9 +820,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
|
|||||||
|
|
||||||
// check if pdftk is installed
|
// check if pdftk is installed
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$langs->load("exports");
|
$langs->load("exports");
|
||||||
setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs');
|
setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs');
|
||||||
@ -888,9 +886,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$file = $diroutputmassaction.'/'.$filename.'_'.dol_print_date($now, 'dayhourlog').'.pdf';
|
$file = $diroutputmassaction.'/'.$filename.'_'.dol_print_date($now, 'dayhourlog').'.pdf';
|
||||||
$pdf->Output($file, 'F');
|
$pdf->Output($file, 'F');
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$langs->load("exports");
|
$langs->load("exports");
|
||||||
setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs');
|
setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs');
|
||||||
|
|||||||
@ -1213,9 +1213,7 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($outputfile);
|
||||||
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1797,7 +1795,7 @@ class CMailFile
|
|||||||
if ($fhandle) {
|
if ($fhandle) {
|
||||||
$nbofbyteswrote = fwrite($fhandle, base64_decode($filecontent));
|
$nbofbyteswrote = fwrite($fhandle, base64_decode($filecontent));
|
||||||
fclose($fhandle);
|
fclose($fhandle);
|
||||||
@chmod($destfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($destfiletmp);
|
||||||
} else {
|
} else {
|
||||||
$this->errors[] = "Failed to open file '".$destfiletmp."' for write";
|
$this->errors[] = "Failed to open file '".$destfiletmp."' for write";
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -231,9 +231,7 @@ class CSMSFile
|
|||||||
fputs($fp, "Message:\n".$this->message);
|
fputs($fp, "Message:\n".$this->message);
|
||||||
|
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($outputfile);
|
||||||
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,9 +255,7 @@ class CSMSFile
|
|||||||
fputs($fp, "\nResult id=".$result);
|
fputs($fp, "\nResult id=".$result);
|
||||||
|
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($outputfile);
|
||||||
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -743,9 +743,7 @@ class Ldap
|
|||||||
if ($fp) {
|
if ($fp) {
|
||||||
fputs($fp, $content);
|
fputs($fp, $content);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($outputfile);
|
||||||
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -295,10 +295,7 @@ class RssParser
|
|||||||
if ($fp) {
|
if ($fp) {
|
||||||
fwrite($fp, $str);
|
fwrite($fp, $str);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($newpathofdestfile);
|
||||||
$newmask = $conf->global->MAIN_UMASK;
|
|
||||||
}
|
|
||||||
@chmod($newpathofdestfile, octdec($newmask));
|
|
||||||
|
|
||||||
$this->_lastfetchdate = $nowgmt;
|
$this->_lastfetchdate = $nowgmt;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -119,10 +119,7 @@ abstract class Stats
|
|||||||
$fp = fopen($newpathofdestfile, 'w');
|
$fp = fopen($newpathofdestfile, 'w');
|
||||||
fwrite($fp, json_encode($data));
|
fwrite($fp, json_encode($data));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($newpathofdestfile);
|
||||||
$newmask = $conf->global->MAIN_UMASK;
|
|
||||||
}
|
|
||||||
@chmod($newpathofdestfile, octdec($newmask));
|
|
||||||
|
|
||||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $nowgmt;
|
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $nowgmt;
|
||||||
}
|
}
|
||||||
@ -222,10 +219,7 @@ abstract class Stats
|
|||||||
if ($fp) {
|
if ($fp) {
|
||||||
fwrite($fp, json_encode($data));
|
fwrite($fp, json_encode($data));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($newpathofdestfile);
|
||||||
$newmask = $conf->global->MAIN_UMASK;
|
|
||||||
}
|
|
||||||
@chmod($newpathofdestfile, octdec($newmask));
|
|
||||||
} else {
|
} else {
|
||||||
dol_syslog("Failed to write cache file", LOG_ERR);
|
dol_syslog("Failed to write cache file", LOG_ERR);
|
||||||
}
|
}
|
||||||
@ -332,10 +326,7 @@ abstract class Stats
|
|||||||
if ($fp) {
|
if ($fp) {
|
||||||
fwrite($fp, json_encode($data));
|
fwrite($fp, json_encode($data));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($newpathofdestfile);
|
||||||
$newmask = $conf->global->MAIN_UMASK;
|
|
||||||
}
|
|
||||||
@chmod($newpathofdestfile, octdec($newmask));
|
|
||||||
}
|
}
|
||||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $nowgmt;
|
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $nowgmt;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -494,9 +494,7 @@ class Utils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($outputfile);
|
||||||
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
dol_syslog("Failed to open file ".$outputfile, LOG_ERR);
|
dol_syslog("Failed to open file ".$outputfile, LOG_ERR);
|
||||||
@ -739,9 +737,7 @@ class Utils
|
|||||||
pclose($handlein);
|
pclose($handlein);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($outputfile);
|
||||||
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update with result
|
// Update with result
|
||||||
@ -1051,7 +1047,7 @@ class Utils
|
|||||||
fclose($sourcehandle);
|
fclose($sourcehandle);
|
||||||
gzclose($gzfilehandle);
|
gzclose($gzfilehandle);
|
||||||
|
|
||||||
@chmod($logpath.'/'.$logname.'.1.gz', octdec(empty($conf->global->MAIN_UMASK) ? '0664' : $conf->global->MAIN_UMASK));
|
dolChmod($logpath.'/'.$logname.'.1.gz');
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_delete_file($logpath.'/'.$logname, 0, 0, 0, null, false, 0);
|
dol_delete_file($logpath.'/'.$logname, 0, 0, 0, null, false, 0);
|
||||||
@ -1061,7 +1057,7 @@ class Utils
|
|||||||
fclose($newlog);
|
fclose($newlog);
|
||||||
|
|
||||||
//var_dump($logpath.'/'.$logname." - ".octdec(empty($conf->global->MAIN_UMASK)?'0664':$conf->global->MAIN_UMASK));
|
//var_dump($logpath.'/'.$logname." - ".octdec(empty($conf->global->MAIN_UMASK)?'0664':$conf->global->MAIN_UMASK));
|
||||||
@chmod($logpath.'/'.$logname, octdec(empty($conf->global->MAIN_UMASK) ? '0664' : $conf->global->MAIN_UMASK));
|
dolChmod($logpath.'/'.$logname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -678,7 +678,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
|
|||||||
}
|
}
|
||||||
|
|
||||||
file_put_contents($newpathoftmpdestfile, $content);
|
file_put_contents($newpathoftmpdestfile, $content);
|
||||||
@chmod($newpathoftmpdestfile, octdec($newmask));
|
dolChmod($newpathoftmpdestfile, $newmask);
|
||||||
|
|
||||||
// Rename
|
// Rename
|
||||||
$result = dol_move($newpathoftmpdestfile, $newpathofdestfile, $newmask, (($destfile == $srcfile) ? 1 : 0), 0, $indexdatabase);
|
$result = dol_move($newpathoftmpdestfile, $newpathofdestfile, $newmask, (($destfile == $srcfile) ? 1 : 0), 0, $indexdatabase);
|
||||||
@ -694,7 +694,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
|
|||||||
$newmask = '0664';
|
$newmask = '0664';
|
||||||
}
|
}
|
||||||
|
|
||||||
@chmod($newpathofdestfile, octdec($newmask));
|
dolChmod($newpathofdestfile, $newmask);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -752,7 +752,7 @@ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1)
|
|||||||
$newmask = '0664';
|
$newmask = '0664';
|
||||||
}
|
}
|
||||||
|
|
||||||
@chmod($newpathofdestfile, octdec($newmask));
|
dolChmod($newpathofdestfile, $newmask);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -900,6 +900,18 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global $dolibarr_main_restrict_os_commands;
|
||||||
|
if (!empty($dolibarr_main_restrict_os_commands)) {
|
||||||
|
$arrayofallowedcommand = explode(',', $dolibarr_main_restrict_os_commands);
|
||||||
|
$arrayofallowedcommand = array_map('trim', $arrayofallowedcommand);
|
||||||
|
if (in_array(basename($destfile), $arrayofallowedcommand)) {
|
||||||
|
//$langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now.
|
||||||
|
//setEventMessages($langs->trans("ErrorFilenameReserved", basename($destfile)), null, 'errors');
|
||||||
|
dol_syslog("files.lib.php::dol_move canceled because target filename ".basename($destfile)." is using a reserved command name. we ignore the move request.", LOG_WARNING);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$result = @rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @
|
$result = @rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
if ($destexists) {
|
if ($destexists) {
|
||||||
@ -975,11 +987,11 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
|
|||||||
if (empty($newmask)) {
|
if (empty($newmask)) {
|
||||||
$newmask = empty($conf->global->MAIN_UMASK) ? '0755' : $conf->global->MAIN_UMASK;
|
$newmask = empty($conf->global->MAIN_UMASK) ? '0755' : $conf->global->MAIN_UMASK;
|
||||||
}
|
}
|
||||||
$newmaskdec = octdec($newmask);
|
|
||||||
// Currently method is restricted to files (dol_delete_files previously used is for files, and mask usage if for files too)
|
// Currently method is restricted to files (dol_delete_files previously used is for files, and mask usage if for files too)
|
||||||
// to allow mask usage for dir, we shoul introduce a new param "isdir" to 1 to complete newmask like this
|
// to allow mask usage for dir, we shoul introduce a new param "isdir" to 1 to complete newmask like this
|
||||||
// if ($isdir) $newmaskdec |= octdec('0111'); // Set x bit required for directories
|
// if ($isdir) $newmaskdec |= octdec('0111'); // Set x bit required for directories
|
||||||
@chmod($newpathofdestfile, $newmaskdec);
|
dolChmod($newpathofdestfile, $newmask);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
@ -1219,9 +1231,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
|||||||
// Move file
|
// Move file
|
||||||
$return = move_uploaded_file($src_file_osencoded, $file_name_osencoded);
|
$return = move_uploaded_file($src_file_osencoded, $file_name_osencoded);
|
||||||
if ($return) {
|
if ($return) {
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file_name_osencoded);
|
||||||
@chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG);
|
dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG);
|
||||||
return $successcode; // Success
|
return $successcode; // Success
|
||||||
} else {
|
} else {
|
||||||
@ -1303,7 +1313,7 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
|
|||||||
// If it fails and it is because of the missing write permission on parent dir
|
// If it fails and it is because of the missing write permission on parent dir
|
||||||
if (!$ok && file_exists(dirname($filename)) && !(fileperms(dirname($filename)) & 0200)) {
|
if (!$ok && file_exists(dirname($filename)) && !(fileperms(dirname($filename)) & 0200)) {
|
||||||
dol_syslog("Error in deletion, but parent directory exists with no permission to write, we try to change permission on parent directory and retry...", LOG_DEBUG);
|
dol_syslog("Error in deletion, but parent directory exists with no permission to write, we try to change permission on parent directory and retry...", LOG_DEBUG);
|
||||||
@chmod(dirname($filename), fileperms(dirname($filename)) | 0200);
|
dolChmod(dirname($filename), decoct(fileperms(dirname($filename)) | 0200));
|
||||||
// Now we retry deletion
|
// Now we retry deletion
|
||||||
if ($nophperrors) {
|
if ($nophperrors) {
|
||||||
$ok = @unlink($filename);
|
$ok = @unlink($filename);
|
||||||
@ -1592,9 +1602,8 @@ function dol_meta_create($object)
|
|||||||
$fp = fopen($file, "w");
|
$fp = fopen($file, "w");
|
||||||
fputs($fp, $meta);
|
fputs($fp, $meta);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
dolChmod($file);
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
@ -1713,6 +1722,17 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
|
|||||||
$destfile = dol_string_nohtmltag($destfile);
|
$destfile = dol_string_nohtmltag($destfile);
|
||||||
$destfull = dol_string_nohtmltag($destfull);
|
$destfull = dol_string_nohtmltag($destfull);
|
||||||
|
|
||||||
|
global $dolibarr_main_restrict_os_commands;
|
||||||
|
if (!empty($dolibarr_main_restrict_os_commands)) {
|
||||||
|
$arrayofallowedcommand = explode(',', $dolibarr_main_restrict_os_commands);
|
||||||
|
$arrayofallowedcommand = array_map('trim', $arrayofallowedcommand);
|
||||||
|
if (in_array(basename($destfull), $arrayofallowedcommand)) {
|
||||||
|
$langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now.
|
||||||
|
setEventMessages($langs->trans("ErrorFilenameReserved", basename($destfull)), null, 'errors');
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Move file from temp directory to final directory. A .noexe may also be appended on file name.
|
// Move file from temp directory to final directory. A .noexe may also be appended on file name.
|
||||||
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles, $upload_dir);
|
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles, $upload_dir);
|
||||||
|
|
||||||
@ -2388,7 +2408,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles =
|
|||||||
$newmask = '0664';
|
$newmask = '0664';
|
||||||
}
|
}
|
||||||
|
|
||||||
@chmod($outputfile, octdec($newmask));
|
dolChmod($outputfile, $newmask);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -3215,7 +3235,7 @@ function dol_filecache($directory, $filename, $object)
|
|||||||
}
|
}
|
||||||
$cachefile = $directory.$filename;
|
$cachefile = $directory.$filename;
|
||||||
file_put_contents($cachefile, serialize($object), LOCK_EX);
|
file_put_contents($cachefile, serialize($object), LOCK_EX);
|
||||||
@chmod($cachefile, 0644);
|
dolChmod($cachefile, '0644');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -6864,13 +6864,16 @@ function dol_mkdir($dir, $dataroot = '', $newmask = '')
|
|||||||
* Change mod of a file
|
* Change mod of a file
|
||||||
*
|
*
|
||||||
* @param string $filepath Full file path
|
* @param string $filepath Full file path
|
||||||
|
* @param string $newmask Force new mask. For example '0644'
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function dolChmod($filepath)
|
function dolChmod($filepath, $newmask = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
if (!empty($newmask)) {
|
||||||
|
@chmod($filepath, octdec($newmask));
|
||||||
|
} elseif (!empty($conf->global->MAIN_UMASK)) {
|
||||||
@chmod($filepath, octdec($conf->global->MAIN_UMASK));
|
@chmod($filepath, octdec($conf->global->MAIN_UMASK));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -362,9 +362,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set permissions on file
|
// Set permissions on file
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($imgTargetName);
|
||||||
@chmod($imgTargetName, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Free memory. This does not delete image.
|
// Free memory. This does not delete image.
|
||||||
imagedestroy($img);
|
imagedestroy($img);
|
||||||
@ -761,9 +759,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set permissions on file
|
// Set permissions on file
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($imgThumbName);
|
||||||
@chmod($imgThumbName, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Free memory. This does not delete image.
|
// Free memory. This does not delete image.
|
||||||
imagedestroy($img);
|
imagedestroy($img);
|
||||||
|
|||||||
@ -277,9 +277,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
|||||||
|
|
||||||
if (!$error && $pagecount) {
|
if (!$error && $pagecount) {
|
||||||
$pdf->Output($file, 'F');
|
$pdf->Output($file, 'F');
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($usestdout) {
|
if ($usestdout) {
|
||||||
|
|||||||
@ -227,7 +227,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||||||
$result = file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass);
|
$result = file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
dolChmod($pathoffiletoedittarget, $newmask);
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -369,7 +369,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
|||||||
|
|
||||||
$result = file_put_contents($pathoffiletoedittarget, $contentsql);
|
$result = file_put_contents($pathoffiletoedittarget, $contentsql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
dolChmod($pathoffiletoedittarget, $newmask);
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFailToCreateFile", $pathoffiletoedittarget), null, 'errors');
|
setEventMessages($langs->trans("ErrorFailToCreateFile", $pathoffiletoedittarget), null, 'errors');
|
||||||
@ -408,7 +408,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
|||||||
|
|
||||||
$result2 = file_put_contents($pathoffiletoedittarget, $contentsql);
|
$result2 = file_put_contents($pathoffiletoedittarget, $contentsql);
|
||||||
if ($result2) {
|
if ($result2) {
|
||||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
dolChmod($pathoffiletoedittarget, $newmask);
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFailToCreateFile", $pathoffiletoedittarget), null, 'errors');
|
setEventMessages($langs->trans("ErrorFailToCreateFile", $pathoffiletoedittarget), null, 'errors');
|
||||||
|
|||||||
@ -457,7 +457,7 @@ function encodedecode_dbpassconf($level = 0)
|
|||||||
|
|
||||||
// It's config file, so we set read permission for creator only.
|
// It's config file, so we set read permission for creator only.
|
||||||
// Should set permission to web user and groups for users used by batch
|
// Should set permission to web user and groups for users used by batch
|
||||||
//@chmod($file, octdec('0600'));
|
//dolChmod($file, '0600');
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1210,9 +1210,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
|
|||||||
$fp = fopen($filetosave, "w");
|
$fp = fopen($filetosave, "w");
|
||||||
fputs($fp, $tmpgeturl['content']);
|
fputs($fp, $tmpgeturl['content']);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filetosave);
|
||||||
@chmod($filetosave, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1281,9 +1279,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
|
|||||||
$fp = fopen($filetosave, "w");
|
$fp = fopen($filetosave, "w");
|
||||||
fputs($fp, $tmpgeturl['content']);
|
fputs($fp, $tmpgeturl['content']);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filetosave);
|
||||||
@chmod($filetosave, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,9 +45,7 @@ function dolSaveMasterFile($filemaster)
|
|||||||
$mastercontent .= "}\n";
|
$mastercontent .= "}\n";
|
||||||
$mastercontent .= '?>'."\n";
|
$mastercontent .= '?>'."\n";
|
||||||
$result = file_put_contents($filemaster, $mastercontent);
|
$result = file_put_contents($filemaster, $mastercontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filemaster);
|
||||||
@chmod($filemaster, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -79,9 +77,7 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
|||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
dol_syslog("Failed to write file ".$filealias, LOG_WARNING);
|
dol_syslog("Failed to write file ".$filealias, LOG_WARNING);
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filealias);
|
||||||
@chmod($filealias, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save also alias into language subdirectory if it is not a main language
|
// Save also alias into language subdirectory if it is not a main language
|
||||||
if ($objectpage->lang && in_array($objectpage->lang, explode(',', $object->otherlang))) {
|
if ($objectpage->lang && in_array($objectpage->lang, explode(',', $object->otherlang))) {
|
||||||
@ -99,9 +95,7 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
|||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
dol_syslog("Failed to write file ".$filealiassub, LOG_WARNING);
|
dol_syslog("Failed to write file ".$filealiassub, LOG_WARNING);
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filealiassub);
|
||||||
@chmod($filealiassub, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
} elseif (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) {
|
} elseif (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) {
|
||||||
// Save also alias into all language subdirectories if it is a main language
|
// Save also alias into all language subdirectories if it is a main language
|
||||||
if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR) && !empty($object->otherlang)) {
|
if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR) && !empty($object->otherlang)) {
|
||||||
@ -122,9 +116,7 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
|||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
dol_syslog("Failed to write file ".$filealiassub, LOG_WARNING);
|
dol_syslog("Failed to write file ".$filealiassub, LOG_WARNING);
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filealiassub);
|
||||||
@chmod($filealiassub, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,9 +268,8 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
|
|||||||
|
|
||||||
//var_dump($filetpl);exit;
|
//var_dump($filetpl);exit;
|
||||||
$result = file_put_contents($filetpl, $tplcontent);
|
$result = file_put_contents($filetpl, $tplcontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
|
||||||
@chmod($filetpl, octdec($conf->global->MAIN_UMASK));
|
dolChmod($filetpl);
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -318,9 +309,8 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $o
|
|||||||
$indexcontent .= '// END PHP ?>'."\n";
|
$indexcontent .= '// END PHP ?>'."\n";
|
||||||
|
|
||||||
$result1 = file_put_contents($fileindex, $indexcontent);
|
$result1 = file_put_contents($fileindex, $indexcontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
|
||||||
@chmod($fileindex, octdec($conf->global->MAIN_UMASK));
|
dolChmod($fileindex);
|
||||||
}
|
|
||||||
|
|
||||||
if (is_object($object) && $object->fk_default_home > 0) {
|
if (is_object($object) && $object->fk_default_home > 0) {
|
||||||
$objectpage = new WebsitePage($db);
|
$objectpage = new WebsitePage($db);
|
||||||
@ -352,9 +342,7 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $o
|
|||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
dol_syslog("Failed to write file ".$fileindexsub, LOG_WARNING);
|
dol_syslog("Failed to write file ".$fileindexsub, LOG_WARNING);
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($fileindexsub);
|
||||||
@chmod($fileindexsub, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -368,9 +356,7 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $o
|
|||||||
$wrappercontent = file_get_contents(DOL_DOCUMENT_ROOT.'/website/samples/wrapper.php');
|
$wrappercontent = file_get_contents(DOL_DOCUMENT_ROOT.'/website/samples/wrapper.php');
|
||||||
|
|
||||||
$result2 = file_put_contents($filewrapper, $wrappercontent);
|
$result2 = file_put_contents($filewrapper, $wrappercontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filewrapper);
|
||||||
@chmod($filewrapper, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$result2 = true;
|
$result2 = true;
|
||||||
}
|
}
|
||||||
@ -394,9 +380,7 @@ function dolSaveHtmlHeader($filehtmlheader, $htmlheadercontent)
|
|||||||
|
|
||||||
dol_mkdir($pathofwebsite);
|
dol_mkdir($pathofwebsite);
|
||||||
$result = file_put_contents($filehtmlheader, $htmlheadercontent);
|
$result = file_put_contents($filehtmlheader, $htmlheadercontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filehtmlheader);
|
||||||
@chmod($filehtmlheader, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -416,9 +400,7 @@ function dolSaveCssFile($filecss, $csscontent)
|
|||||||
|
|
||||||
dol_mkdir($pathofwebsite);
|
dol_mkdir($pathofwebsite);
|
||||||
$result = file_put_contents($filecss, $csscontent);
|
$result = file_put_contents($filecss, $csscontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filecss);
|
||||||
@chmod($filecss, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -438,9 +420,7 @@ function dolSaveJsFile($filejs, $jscontent)
|
|||||||
|
|
||||||
dol_mkdir($pathofwebsite);
|
dol_mkdir($pathofwebsite);
|
||||||
$result = file_put_contents($filejs, $jscontent);
|
$result = file_put_contents($filejs, $jscontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filejs);
|
||||||
@chmod($filejs, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -460,9 +440,7 @@ function dolSaveRobotFile($filerobot, $robotcontent)
|
|||||||
|
|
||||||
dol_mkdir($pathofwebsite);
|
dol_mkdir($pathofwebsite);
|
||||||
$result = file_put_contents($filerobot, $robotcontent);
|
$result = file_put_contents($filerobot, $robotcontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filerobot);
|
||||||
@chmod($filerobot, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -482,9 +460,7 @@ function dolSaveHtaccessFile($filehtaccess, $htaccess)
|
|||||||
|
|
||||||
dol_mkdir($pathofwebsite);
|
dol_mkdir($pathofwebsite);
|
||||||
$result = file_put_contents($filehtaccess, $htaccess);
|
$result = file_put_contents($filehtaccess, $htaccess);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filehtaccess);
|
||||||
@chmod($filehtaccess, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -504,9 +480,7 @@ function dolSaveManifestJson($file, $content)
|
|||||||
|
|
||||||
dol_mkdir($pathofwebsite);
|
dol_mkdir($pathofwebsite);
|
||||||
$result = file_put_contents($file, $content);
|
$result = file_put_contents($file, $content);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -526,9 +500,7 @@ function dolSaveReadme($file, $content)
|
|||||||
|
|
||||||
dol_mkdir($pathofwebsite);
|
dol_mkdir($pathofwebsite);
|
||||||
$result = file_put_contents($file, $content);
|
$result = file_put_contents($file, $content);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -548,9 +520,7 @@ function dolSaveLicense($file, $content)
|
|||||||
|
|
||||||
dol_mkdir($pathofwebsite);
|
dol_mkdir($pathofwebsite);
|
||||||
$result = file_put_contents($file, $content);
|
$result = file_put_contents($file, $content);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -284,10 +284,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
|
|||||||
fwrite($calfileh, "END:VCALENDAR");
|
fwrite($calfileh, "END:VCALENDAR");
|
||||||
|
|
||||||
fclose($calfileh);
|
fclose($calfileh);
|
||||||
|
dolChmod($outputfile);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
|
||||||
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
dol_syslog("xcal.lib.php::build_calfile Failed to open file ".$outputfile." for writing");
|
dol_syslog("xcal.lib.php::build_calfile Failed to open file ".$outputfile." for writing");
|
||||||
return -2;
|
return -2;
|
||||||
@ -429,10 +426,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
|
|||||||
fwrite($fichier, "</rss>");
|
fwrite($fichier, "</rss>");
|
||||||
|
|
||||||
fclose($fichier);
|
fclose($fichier);
|
||||||
|
dolChmod($outputfile);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
|
||||||
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -209,9 +209,7 @@ class CommActionRapport
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -480,9 +480,7 @@ class doc_generic_asset_odt extends ModelePDFAsset
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -815,9 +815,7 @@ class pdf_standard_asset extends ModelePDFAsset
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -250,9 +250,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -429,9 +429,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -498,9 +498,7 @@ class doc_generic_bom_odt extends ModelePDFBom
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -203,9 +203,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -496,9 +496,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -676,9 +676,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -900,9 +900,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -492,9 +492,7 @@ class doc_generic_contract_odt extends ModelePDFContract
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -496,9 +496,7 @@ class pdf_strato extends ModelePDFContract
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -634,9 +634,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -619,9 +619,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -240,9 +240,7 @@ class html_cerfafr extends ModeleDon
|
|||||||
$handle = fopen($file, "w");
|
$handle = fopen($file, "w");
|
||||||
fwrite($handle, $form);
|
fwrite($handle, $form);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -559,9 +559,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -763,9 +763,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -425,9 +425,7 @@ class pdf_merou extends ModelePdfExpedition
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -669,9 +669,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -539,9 +539,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -520,9 +520,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -908,9 +908,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -1058,9 +1058,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -469,9 +469,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -412,9 +412,7 @@ class doc_generic_member_odt extends ModelePDFMember
|
|||||||
|
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -455,10 +455,7 @@ class pdf_standard extends CommonStickerGenerator
|
|||||||
// Output to file
|
// Output to file
|
||||||
$pdf->Output($file, 'F');
|
$pdf->Output($file, 'F');
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -791,9 +791,7 @@ class pdf_standard extends ModelePDFMovement
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -484,9 +484,7 @@ class doc_generic_mo_odt extends ModelePDFMo
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -684,9 +684,7 @@ class pdf_vinci extends ModelePDFMo
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -337,9 +337,7 @@ class pdf_standardlabel extends CommonStickerGenerator
|
|||||||
// Output to file
|
// Output to file
|
||||||
$pdf->Output($file, 'F');
|
$pdf->Output($file, 'F');
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -360,10 +360,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
|||||||
// Output to file
|
// Output to file
|
||||||
$pdf->Output($file, 'F');
|
$pdf->Output($file, 'F');
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -481,9 +481,7 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -581,9 +581,7 @@ class pdf_standard extends ModelePDFProduct
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -1167,9 +1167,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -521,9 +521,7 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -769,9 +769,7 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -524,9 +524,7 @@ class pdf_timespent extends ModelePDFProjects
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -845,9 +845,7 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -523,9 +523,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -873,9 +873,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -990,9 +990,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -343,9 +343,7 @@ class pdf_paiement
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -485,9 +485,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -599,9 +599,7 @@ class pdf_squille extends ModelePdfReception
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1; // No error
|
return 1; // No error
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -433,9 +433,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -484,9 +484,7 @@ class doc_generic_stock_odt extends ModelePDFStock
|
|||||||
|
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -595,9 +595,7 @@ class pdf_standard extends ModelePDFStock
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -659,8 +659,7 @@ class pdf_eagle extends ModelePdfStockTransfer
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK))
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -796,8 +796,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK))
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -483,9 +483,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -622,9 +622,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -478,9 +478,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -840,9 +840,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -722,9 +722,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -478,9 +478,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -510,9 +510,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -702,9 +702,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -180,7 +180,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
|
|||||||
$message = dol_print_date(dol_now('gmt'), 'standard', 'gmt').$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
|
$message = dol_print_date(dol_now('gmt'), 'standard', 'gmt').$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
|
||||||
fwrite($filefd, $message."\n");
|
fwrite($filefd, $message."\n");
|
||||||
fclose($filefd);
|
fclose($filefd);
|
||||||
@chmod($logfile, octdec(empty($conf->global->MAIN_UMASK) ? '0664' : $conf->global->MAIN_UMASK));
|
dolChmod($logfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -405,9 +405,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket
|
|||||||
|
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -433,9 +433,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
|
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -491,9 +491,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
|
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -287,9 +287,7 @@ if ($action == 'download') {
|
|||||||
|
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($localfile);
|
||||||
@chmod($localfile, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define mime type
|
// Define mime type
|
||||||
$type = 'application/octet-stream';
|
$type = 'application/octet-stream';
|
||||||
|
|||||||
@ -880,7 +880,7 @@ IMG;
|
|||||||
pclose($handlein);
|
pclose($handlein);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
}
|
}
|
||||||
if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
dolChmod($outputfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($retval == 0) {
|
if ($retval == 0) {
|
||||||
|
|||||||
@ -156,7 +156,7 @@ if ($rss) {
|
|||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
||||||
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($outputfiletmp);
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
||||||
|
|||||||
@ -156,7 +156,7 @@ if ($rss) {
|
|||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
||||||
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($outputfiletmp);
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
||||||
|
|||||||
@ -156,7 +156,7 @@ if ($rss) {
|
|||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
||||||
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($outputfiletmp);
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
||||||
|
|||||||
@ -156,7 +156,7 @@ if ($rss) {
|
|||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
||||||
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($outputfiletmp);
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
||||||
|
|||||||
@ -156,7 +156,7 @@ if ($rss) {
|
|||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
||||||
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($outputfiletmp);
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
||||||
|
|||||||
@ -137,7 +137,7 @@ if ($rss) {
|
|||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
||||||
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
dolChmod($outputfiletmp);
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
|
||||||
|
|||||||
@ -443,11 +443,12 @@ if ($action == "set") {
|
|||||||
$fp = @fopen($lockfile, "w");
|
$fp = @fopen($lockfile, "w");
|
||||||
if ($fp) {
|
if ($fp) {
|
||||||
if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) {
|
if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) {
|
||||||
$force_install_lockinstall = 444; // For backward compatibility
|
$force_install_lockinstall = '444'; // For backward compatibility
|
||||||
}
|
}
|
||||||
fwrite($fp, "This is a lock file to prevent use of install or upgrade pages (set with permission ".$force_install_lockinstall.")");
|
fwrite($fp, "This is a lock file to prevent use of install or upgrade pages (set with permission ".$force_install_lockinstall.")");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@chmod($lockfile, octdec($force_install_lockinstall));
|
dolChmod($lockfile, $force_install_lockinstall);
|
||||||
|
|
||||||
$createlock = 1;
|
$createlock = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -490,11 +491,12 @@ if ($action == "set") {
|
|||||||
$fp = @fopen($lockfile, "w");
|
$fp = @fopen($lockfile, "w");
|
||||||
if ($fp) {
|
if ($fp) {
|
||||||
if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) {
|
if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) {
|
||||||
$force_install_lockinstall = 444; // For backward compatibility
|
$force_install_lockinstall = '444'; // For backward compatibility
|
||||||
}
|
}
|
||||||
fwrite($fp, "This is a lock file to prevent use of install or upgrade pages (set with permission ".$force_install_lockinstall.")");
|
fwrite($fp, "This is a lock file to prevent use of install or upgrade pages (set with permission ".$force_install_lockinstall.")");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@chmod($lockfile, octdec($force_install_lockinstall));
|
dolChmod($lockfile, $force_install_lockinstall);
|
||||||
|
|
||||||
$createlock = 1;
|
$createlock = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -374,7 +374,7 @@ DoTestSendHTML=Test sending HTML
|
|||||||
ErrorCantUseRazIfNoYearInMask=Error, can't use option @ to reset counter each year if sequence {yy} or {yyyy} is not in mask.
|
ErrorCantUseRazIfNoYearInMask=Error, can't use option @ to reset counter each year if sequence {yy} or {yyyy} is not in mask.
|
||||||
ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Error, can't use option @ if sequence {yy}{mm} or {yyyy}{mm} is not in mask.
|
ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Error, can't use option @ if sequence {yy}{mm} or {yyyy}{mm} is not in mask.
|
||||||
UMask=UMask parameter for new files on Unix/Linux/BSD/Mac file system.
|
UMask=UMask parameter for new files on Unix/Linux/BSD/Mac file system.
|
||||||
UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).<br>It must be the octal value (for example, 0666 means read and write for everyone).<br>This parameter is useless on a Windows server.
|
UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).<br>It must be the octal value (for example, 0666 means read and write for everyone.). Recommended value is 0660<br>This parameter is useless on a Windows server.
|
||||||
SeeWikiForAllTeam=Take a look at the Wiki page for a list of contributors and their organization
|
SeeWikiForAllTeam=Take a look at the Wiki page for a list of contributors and their organization
|
||||||
UseACacheDelay= Delay for caching export response in seconds (0 or empty for no cache)
|
UseACacheDelay= Delay for caching export response in seconds (0 or empty for no cache)
|
||||||
DisableLinkToHelpCenter=Hide the link "<b>Need help or support</b>" on the login page
|
DisableLinkToHelpCenter=Hide the link "<b>Need help or support</b>" on the login page
|
||||||
|
|||||||
@ -262,6 +262,7 @@ ErrorParameterMustBeEnabledToAllwoThisFeature=Error, parameter <b>%s</b> must be
|
|||||||
ErrorLoginDateValidity=Error, this login is outside the validity date range
|
ErrorLoginDateValidity=Error, this login is outside the validity date range
|
||||||
ErrorValueLength=Length of field '<b>%s</b>' must be higher than '<b>%s</b>'
|
ErrorValueLength=Length of field '<b>%s</b>' must be higher than '<b>%s</b>'
|
||||||
ErrorReservedKeyword=The word '<b>%s</b>' is a reserved keyword
|
ErrorReservedKeyword=The word '<b>%s</b>' is a reserved keyword
|
||||||
|
ErrorFilenameReserved=The filename <b>%s</b> can't be used as it is a reserved and protected command.
|
||||||
ErrorNotAvailableWithThisDistribution=Not available with this distribution
|
ErrorNotAvailableWithThisDistribution=Not available with this distribution
|
||||||
ErrorPublicInterfaceNotEnabled=Public interface was not enabled
|
ErrorPublicInterfaceNotEnabled=Public interface was not enabled
|
||||||
ErrorLanguageRequiredIfPageIsTranslationOfAnother=The language of new page must be defined if it is set as a translation of another page
|
ErrorLanguageRequiredIfPageIsTranslationOfAnother=The language of new page must be defined if it is set as a translation of another page
|
||||||
|
|||||||
@ -2286,7 +2286,7 @@ if ($action == 'savefile' && empty($cancel)) {
|
|||||||
dol_delete_file($pathoffile);
|
dol_delete_file($pathoffile);
|
||||||
$result = file_put_contents($pathoffile, $content);
|
$result = file_put_contents($pathoffile, $content);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@chmod($pathoffile, octdec($newmask));
|
dolChmod($pathoffile, $newmask);
|
||||||
|
|
||||||
setEventMessages($langs->trans("FileSaved"), null);
|
setEventMessages($langs->trans("FileSaved"), null);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -498,9 +498,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -783,9 +783,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -366,10 +366,7 @@ class ProjectStats extends Stats
|
|||||||
if ($fp) {
|
if ($fp) {
|
||||||
fwrite($fp, json_encode($data));
|
fwrite($fp, json_encode($data));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($newpathofdestfile);
|
||||||
$newmask = $conf->global->MAIN_UMASK;
|
|
||||||
}
|
|
||||||
@chmod($newpathofdestfile, octdec($newmask));
|
|
||||||
} else {
|
} else {
|
||||||
dol_syslog("Failed to write cache file", LOG_ERR);
|
dol_syslog("Failed to write cache file", LOG_ERR);
|
||||||
}
|
}
|
||||||
@ -479,12 +476,11 @@ class ProjectStats extends Stats
|
|||||||
dol_mkdir($conf->user->dir_temp);
|
dol_mkdir($conf->user->dir_temp);
|
||||||
}
|
}
|
||||||
$fp = fopen($newpathofdestfile, 'w');
|
$fp = fopen($newpathofdestfile, 'w');
|
||||||
|
if ($fp) {
|
||||||
fwrite($fp, json_encode($data));
|
fwrite($fp, json_encode($data));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($newpathofdestfile);
|
||||||
$newmask = $conf->global->MAIN_UMASK;
|
|
||||||
}
|
}
|
||||||
@chmod($newpathofdestfile, octdec($newmask));
|
|
||||||
|
|
||||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $nowgmt;
|
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $nowgmt;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -482,9 +482,7 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
|
|||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
|
|||||||
@ -710,9 +710,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
|
|||||||
$this->errors = $hookmanager->errors;
|
$this->errors = $hookmanager->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
|||||||
@ -1132,9 +1132,7 @@ class Website extends CommonObject
|
|||||||
fputs($fp, $line);
|
fputs($fp, $line);
|
||||||
|
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($filesql);
|
||||||
@chmod($filesql, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build zip file
|
// Build zip file
|
||||||
$filedir = $conf->website->dir_temp.'/'.$website->ref.'/.';
|
$filedir = $conf->website->dir_temp.'/'.$website->ref.'/.';
|
||||||
|
|||||||
@ -939,8 +939,7 @@ if ($action == 'addcontainer' && $usercanedit) {
|
|||||||
$fp = fopen($filetosave, "w");
|
$fp = fopen($filetosave, "w");
|
||||||
fputs($fp, $tmpgeturl['content']);
|
fputs($fp, $tmpgeturl['content']);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!empty($conf->global->MAIN_UMASK))
|
dolChmod($file);
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1008,8 +1007,7 @@ if ($action == 'addcontainer' && $usercanedit) {
|
|||||||
//$fp = fopen($filetosave, "w");
|
//$fp = fopen($filetosave, "w");
|
||||||
//fputs($fp, $tmpgeturl['content']);
|
//fputs($fp, $tmpgeturl['content']);
|
||||||
//fclose($fp);
|
//fclose($fp);
|
||||||
//if (!empty($conf->global->MAIN_UMASK))
|
//dolChmod($file);
|
||||||
// @chmod($file, octdec($conf->global->MAIN_UMASK));
|
|
||||||
|
|
||||||
// $filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain;
|
// $filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain;
|
||||||
$pagecsscontent .= '/* Content of file '.$urltograbbis.' */'."\n";
|
$pagecsscontent .= '/* Content of file '.$urltograbbis.' */'."\n";
|
||||||
@ -2659,9 +2657,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
|||||||
}
|
}
|
||||||
$domtree->appendChild($root);
|
$domtree->appendChild($root);
|
||||||
if ($domtree->save($tempdir.$xmlname)) {
|
if ($domtree->save($tempdir.$xmlname)) {
|
||||||
if (!empty($conf->global->MAIN_UMASK)) {
|
dolChmod($tempdir.$xmlname);
|
||||||
@chmod($tempdir.$xmlname, octdec($conf->global->MAIN_UMASK));
|
|
||||||
}
|
|
||||||
setEventMessages($langs->trans("SitemapGenerated", $xmlname), null, 'mesgs');
|
setEventMessages($langs->trans("SitemapGenerated", $xmlname), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@ -5022,8 +5018,7 @@ if ((empty($action) || $action == 'preview' || $action == 'createfromclone' || $
|
|||||||
print $out;
|
print $out;
|
||||||
|
|
||||||
/*file_put_contents($filetpl, $out);
|
/*file_put_contents($filetpl, $out);
|
||||||
if (!empty($conf->global->MAIN_UMASK))
|
dolChmod($filetpl);
|
||||||
@chmod($filetpl, octdec($conf->global->MAIN_UMASK));
|
|
||||||
|
|
||||||
// Output file on browser
|
// Output file on browser
|
||||||
dol_syslog("index.php include $filetpl $filename content-type=$type");
|
dol_syslog("index.php include $filetpl $filename content-type=$type");
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user