additional mkdir/chmod parameter fixes and cron-lock file adjustments
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -495,7 +495,6 @@ opcache.load_comments
|
|||||||
opcache.revalidate_path
|
opcache.revalidate_path
|
||||||
opcache.save_comments
|
opcache.save_comments
|
||||||
opcache.use_cwd
|
opcache.use_cwd
|
||||||
opcache.validate_timestamps
|
|
||||||
opcache.fast_shutdown'),
|
opcache.fast_shutdown'),
|
||||||
('phpfpm', 'ini_admin_values', 'cgi.redirect_status_env
|
('phpfpm', 'ini_admin_values', 'cgi.redirect_status_env
|
||||||
date.timezone
|
date.timezone
|
||||||
@@ -519,7 +518,8 @@ opcache.restrict_api
|
|||||||
opcache.revalidate_freq
|
opcache.revalidate_freq
|
||||||
opcache.max_accelerated_files
|
opcache.max_accelerated_files
|
||||||
opcache.memory_consumption
|
opcache.memory_consumption
|
||||||
opcache.interned_strings_buffer'),
|
opcache.interned_strings_buffer
|
||||||
|
opcache.validate_timestamps'),
|
||||||
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
|
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
|
||||||
('system', 'lastaccountnumber', '0'),
|
('system', 'lastaccountnumber', '0'),
|
||||||
('system', 'lastguid', '9999'),
|
('system', 'lastguid', '9999'),
|
||||||
|
|||||||
@@ -843,7 +843,7 @@ if (\Froxlor\Froxlor::isDatabaseVersion('202106270')) {
|
|||||||
throw new \Exception("img directory does not exist and cannot be created");
|
throw new \Exception("img directory does not exist and cannot be created");
|
||||||
}
|
}
|
||||||
if (!is_writable($path)) {
|
if (!is_writable($path)) {
|
||||||
if (!chmod($path, '0775')) {
|
if (!chmod($path, 0775)) {
|
||||||
throw new \Exception("Cannot write to img directory");
|
throw new \Exception("Cannot write to img directory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
private static $debugHandler = null;
|
private static $debugHandler = null;
|
||||||
|
|
||||||
|
private static $noncron_params = [
|
||||||
|
'force',
|
||||||
|
'debug',
|
||||||
|
'no-fork',
|
||||||
|
'run-task'
|
||||||
|
];
|
||||||
|
|
||||||
public static function setArguments($argv = null)
|
public static function setArguments($argv = null)
|
||||||
{
|
{
|
||||||
self::$argv = $argv;
|
self::$argv = $argv;
|
||||||
@@ -47,6 +54,7 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
echo "--run-task\t\trun a specific task [1 = re-generate configs, 4 = re-generate dns zones, 10 = re-set quotas, 99 = re-create cron.d-file]\n";
|
echo "--run-task\t\trun a specific task [1 = re-generate configs, 4 = re-generate dns zones, 10 = re-set quotas, 99 = re-create cron.d-file]\n";
|
||||||
echo "--debug\t\t\toutput debug information about what is going on to STDOUT.\n";
|
echo "--debug\t\t\toutput debug information about what is going on to STDOUT.\n";
|
||||||
echo "--no-fork\t\tdo not fork to backkground (traffic cron only).\n\n";
|
echo "--no-fork\t\tdo not fork to backkground (traffic cron only).\n\n";
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -161,7 +169,7 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
$crontype = "";
|
$crontype = "";
|
||||||
if (isset(self::$argv) && is_array(self::$argv) && count(self::$argv) > 1) {
|
if (isset(self::$argv) && is_array(self::$argv) && count(self::$argv) > 1) {
|
||||||
for ($x = 1; $x < count(self::$argv); $x ++) {
|
for ($x = 1; $x < count(self::$argv); $x ++) {
|
||||||
if (substr(strtolower(self::$argv[$x]), 0, 2) == '--' && strlen(self::$argv[$x]) > 3) {
|
if (substr(self::$argv[$x], 0, 2) == '--' && strlen(self::$argv[$x]) > 3 && !in_array(substr(strtolower(self::$argv[$x]), 2),self::$noncron_params)) {
|
||||||
$crontype = substr(strtolower(self::$argv[$x]), 2);
|
$crontype = substr(strtolower(self::$argv[$x]), 2);
|
||||||
$basename .= "-" . $crontype;
|
$basename .= "-" . $crontype;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -145,13 +145,13 @@ class SImExporter
|
|||||||
// Catch image_data and save it
|
// Catch image_data and save it
|
||||||
if (isset($index_split[2]) && $index_split[2] === 'image_data' && !empty($_data[$index_split[0].'.'.$index_split[1]])) {
|
if (isset($index_split[2]) && $index_split[2] === 'image_data' && !empty($_data[$index_split[0].'.'.$index_split[1]])) {
|
||||||
$path = \Froxlor\Froxlor::getInstallDir().'/img/';
|
$path = \Froxlor\Froxlor::getInstallDir().'/img/';
|
||||||
if (!is_dir($path) && !mkdir($path, '0775')) {
|
if (!is_dir($path) && !mkdir($path, 0775)) {
|
||||||
throw new \Exception("img directory does not exist and cannot be created");
|
throw new \Exception("img directory does not exist and cannot be created");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we can write to the upload directory
|
// Make sure we can write to the upload directory
|
||||||
if (!is_writable($path)) {
|
if (!is_writable($path)) {
|
||||||
if (!chmod($path, '0775')) {
|
if (!chmod($path, 0775)) {
|
||||||
throw new \Exception("Cannot write to img directory");
|
throw new \Exception("Cannot write to img directory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ class Store
|
|||||||
if (!chmod($path, 0775)) {
|
if (!chmod($path, 0775)) {
|
||||||
throw new \Exception("Cannot write to img directory");
|
throw new \Exception("Cannot write to img directory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure mime-type matches an image
|
// Make sure mime-type matches an image
|
||||||
if (!in_array(mime_content_type($_FILES[$fieldname]['tmp_name']), ['image/jpeg','image/jpg','image/png','image/gif'])) {
|
if (!in_array(mime_content_type($_FILES[$fieldname]['tmp_name']), ['image/jpeg','image/jpg','image/png','image/gif'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user