use safe_exec from class now
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -356,12 +356,12 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$perlsymlink = \Froxlor\FileDir::makeCorrectFile($result['path'] . '/cgi-bin');
|
$perlsymlink = \Froxlor\FileDir::makeCorrectFile($result['path'] . '/cgi-bin');
|
||||||
// remove symlink
|
// remove symlink
|
||||||
if (file_exists($perlsymlink)) {
|
if (file_exists($perlsymlink)) {
|
||||||
safe_exec('rm -f ' . escapeshellarg($perlsymlink));
|
\Froxlor\FileDir::safe_exec('rm -f ' . escapeshellarg($perlsymlink));
|
||||||
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_DEBUG, "[API] deleted suexecworkaround symlink '" . $perlsymlink . "'");
|
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_DEBUG, "[API] deleted suexecworkaround symlink '" . $perlsymlink . "'");
|
||||||
}
|
}
|
||||||
// remove folder in suexec-path
|
// remove folder in suexec-path
|
||||||
if (file_exists($suexecpath)) {
|
if (file_exists($suexecpath)) {
|
||||||
safe_exec('rm -rf ' . escapeshellarg($suexecpath));
|
\Froxlor\FileDir::safe_exec('rm -rf ' . escapeshellarg($suexecpath));
|
||||||
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_DEBUG, "[API] deleted suexecworkaround path '" . $suexecpath . "'");
|
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_DEBUG, "[API] deleted suexecworkaround path '" . $suexecpath . "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Bind extends DnsBase
|
|||||||
// check for subfolder in bind-config-directory
|
// check for subfolder in bind-config-directory
|
||||||
if (! file_exists(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/'))) {
|
if (! file_exists(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/'))) {
|
||||||
$this->_logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/')));
|
$this->_logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/')));
|
||||||
safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/')));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/')));
|
||||||
}
|
}
|
||||||
|
|
||||||
$domains = $this->getDomainList();
|
$domains = $this->getDomainList();
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ abstract class DnsBase
|
|||||||
// reload DNS daemon
|
// reload DNS daemon
|
||||||
$cmd = Settings::Get('system.bindreload_command');
|
$cmd = Settings::Get('system.bindreload_command');
|
||||||
$cmdStatus = 1;
|
$cmdStatus = 1;
|
||||||
safe_exec(escapeshellcmd($cmd), $cmdStatus);
|
\Froxlor\FileDir::safe_exec(escapeshellcmd($cmd), $cmdStatus);
|
||||||
if ($cmdStatus === 0) {
|
if ($cmdStatus === 0) {
|
||||||
$this->_logger->logAction(CRON_ACTION, LOG_INFO, Settings::Get('system.dns_server') . ' daemon reloaded');
|
$this->_logger->logAction(CRON_ACTION, LOG_INFO, Settings::Get('system.dns_server') . ' daemon reloaded');
|
||||||
} else {
|
} else {
|
||||||
@@ -183,7 +183,7 @@ abstract class DnsBase
|
|||||||
if (Settings::Get('dkim.use_dkim') == '1') {
|
if (Settings::Get('dkim.use_dkim') == '1') {
|
||||||
if (! file_exists(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix')))) {
|
if (! file_exists(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix')))) {
|
||||||
$this->_logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix'))));
|
$this->_logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix'))));
|
||||||
safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix'))));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
$dkimdomains = '';
|
$dkimdomains = '';
|
||||||
@@ -203,13 +203,13 @@ abstract class DnsBase
|
|||||||
$max_dkim_id = $max_dkim_id_stmt->fetch(\PDO::FETCH_ASSOC);
|
$max_dkim_id = $max_dkim_id_stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
$domain['dkim_id'] = (int) $max_dkim_id['max_dkim_id'] + 1;
|
$domain['dkim_id'] = (int) $max_dkim_id['max_dkim_id'] + 1;
|
||||||
$privkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id']);
|
$privkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id']);
|
||||||
safe_exec('openssl genrsa -out ' . escapeshellarg($privkey_filename) . ' ' . Settings::Get('dkim.dkim_keylength'));
|
\Froxlor\FileDir::safe_exec('openssl genrsa -out ' . escapeshellarg($privkey_filename) . ' ' . Settings::Get('dkim.dkim_keylength'));
|
||||||
$domain['dkim_privkey'] = file_get_contents($privkey_filename);
|
$domain['dkim_privkey'] = file_get_contents($privkey_filename);
|
||||||
safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
\Froxlor\FileDir::safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
||||||
$pubkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id'] . '.public');
|
$pubkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id'] . '.public');
|
||||||
safe_exec('openssl rsa -in ' . escapeshellarg($privkey_filename) . ' -pubout -outform pem -out ' . escapeshellarg($pubkey_filename));
|
\Froxlor\FileDir::safe_exec('openssl rsa -in ' . escapeshellarg($privkey_filename) . ' -pubout -outform pem -out ' . escapeshellarg($pubkey_filename));
|
||||||
$domain['dkim_pubkey'] = file_get_contents($pubkey_filename);
|
$domain['dkim_pubkey'] = file_get_contents($pubkey_filename);
|
||||||
safe_exec("chmod 0664 " . escapeshellarg($pubkey_filename));
|
\Froxlor\FileDir::safe_exec("chmod 0664 " . escapeshellarg($pubkey_filename));
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
`dkim_id` = :dkimid,
|
`dkim_id` = :dkimid,
|
||||||
@@ -230,14 +230,14 @@ abstract class DnsBase
|
|||||||
$privkey_file_handler = fopen($privkey_filename, "w");
|
$privkey_file_handler = fopen($privkey_filename, "w");
|
||||||
fwrite($privkey_file_handler, $domain['dkim_privkey']);
|
fwrite($privkey_file_handler, $domain['dkim_privkey']);
|
||||||
fclose($privkey_file_handler);
|
fclose($privkey_file_handler);
|
||||||
safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
\Froxlor\FileDir::safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! file_exists($pubkey_filename) && $domain['dkim_pubkey'] != '') {
|
if (! file_exists($pubkey_filename) && $domain['dkim_pubkey'] != '') {
|
||||||
$pubkey_file_handler = fopen($pubkey_filename, "w");
|
$pubkey_file_handler = fopen($pubkey_filename, "w");
|
||||||
fwrite($pubkey_file_handler, $domain['dkim_pubkey']);
|
fwrite($pubkey_file_handler, $domain['dkim_pubkey']);
|
||||||
fclose($pubkey_file_handler);
|
fclose($pubkey_file_handler);
|
||||||
safe_exec("chmod 0644 " . escapeshellarg($pubkey_filename));
|
\Froxlor\FileDir::safe_exec("chmod 0644 " . escapeshellarg($pubkey_filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
$dkimdomains .= $domain['domain'] . "\n";
|
$dkimdomains .= $domain['domain'] . "\n";
|
||||||
@@ -253,7 +253,7 @@ abstract class DnsBase
|
|||||||
fwrite($dkimkeys_file_handler, $dkimkeys);
|
fwrite($dkimkeys_file_handler, $dkimkeys);
|
||||||
fclose($dkimkeys_file_handler);
|
fclose($dkimkeys_file_handler);
|
||||||
|
|
||||||
safe_exec(escapeshellcmd(Settings::Get('dkim.dkimrestart_command')));
|
\Froxlor\FileDir::safe_exec(escapeshellcmd(Settings::Get('dkim.dkimrestart_command')));
|
||||||
$this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Dkim-milter reloaded');
|
$this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Dkim-milter reloaded');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class DomainSSL
|
|||||||
$sslcertpath = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.customer_ssl_path'));
|
$sslcertpath = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.customer_ssl_path'));
|
||||||
// create path if it does not exist
|
// create path if it does not exist
|
||||||
if (! file_exists($sslcertpath)) {
|
if (! file_exists($sslcertpath)) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($sslcertpath));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($sslcertpath));
|
||||||
}
|
}
|
||||||
// make correct files for the certificates
|
// make correct files for the certificates
|
||||||
$ssl_files = array(
|
$ssl_files = array(
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ use Froxlor\Cron\Http\Php\PhpInterface;
|
|||||||
*
|
*
|
||||||
* @todo ssl-redirect to non-standard port
|
* @todo ssl-redirect to non-standard port
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Lighttpd extends HttpConfigBase
|
class Lighttpd extends HttpConfigBase
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -63,11 +62,11 @@ class Lighttpd extends HttpConfigBase
|
|||||||
Fpm::createDummyPool($restart_cmd['config_dir']);
|
Fpm::createDummyPool($restart_cmd['config_dir']);
|
||||||
}
|
}
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: running ' . $restart_cmd['reload_cmd']);
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: running ' . $restart_cmd['reload_cmd']);
|
||||||
safe_exec(escapeshellcmd($restart_cmd['reload_cmd']));
|
\Froxlor\FileDir::safe_exec(escapeshellcmd($restart_cmd['reload_cmd']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: reloading lighttpd');
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: reloading lighttpd');
|
||||||
safe_exec(escapeshellcmd(Settings::Get('system.apachereload_command')));
|
\Froxlor\FileDir::safe_exec(escapeshellcmd(Settings::Get('system.apachereload_command')));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createIpPort()
|
public function createIpPort()
|
||||||
@@ -229,7 +228,7 @@ class Lighttpd extends HttpConfigBase
|
|||||||
'loginname' => 'froxlor.panel',
|
'loginname' => 'froxlor.panel',
|
||||||
'documentroot' => $mypath,
|
'documentroot' => $mypath,
|
||||||
'customerroot' => $mypath,
|
'customerroot' => $mypath,
|
||||||
'parentdomainid' => 0,
|
'parentdomainid' => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
// override corresponding array values
|
// override corresponding array values
|
||||||
@@ -256,7 +255,7 @@ class Lighttpd extends HttpConfigBase
|
|||||||
if (! empty(Settings::Get('system.dhparams_file'))) {
|
if (! empty(Settings::Get('system.dhparams_file'))) {
|
||||||
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||||
if (! file_exists($dhparams)) {
|
if (! file_exists($dhparams)) {
|
||||||
safe_exec('openssl dhparam -out '.escapeshellarg($dhparams).' 4096');
|
\Froxlor\FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096');
|
||||||
}
|
}
|
||||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.dh-file = "' . $dhparams . '"' . "\n";
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.dh-file = "' . $dhparams . '"' . "\n";
|
||||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.ec-curve = "secp384r1"' . "\n";
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.ec-curve = "secp384r1"' . "\n";
|
||||||
@@ -392,7 +391,7 @@ class Lighttpd extends HttpConfigBase
|
|||||||
foreach ($domains as $domain) {
|
foreach ($domains as $domain) {
|
||||||
|
|
||||||
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
|
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost') . '/vhosts/')));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost') . '/vhosts/')));
|
||||||
|
|
||||||
// determine correct include-path:
|
// determine correct include-path:
|
||||||
// e.g. '/etc/lighttpd/conf-enabled/vhosts/ has to become'
|
// e.g. '/etc/lighttpd/conf-enabled/vhosts/ has to become'
|
||||||
@@ -578,7 +577,7 @@ class Lighttpd extends HttpConfigBase
|
|||||||
if (! empty(Settings::Get('system.dhparams_file'))) {
|
if (! empty(Settings::Get('system.dhparams_file'))) {
|
||||||
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||||
if (! file_exists($dhparams)) {
|
if (! file_exists($dhparams)) {
|
||||||
safe_exec('openssl dhparam -out '.escapeshellarg($dhparams).' 4096');
|
\Froxlor\FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096');
|
||||||
}
|
}
|
||||||
$ssl_settings .= 'ssl.dh-file = "' . $dhparams . '"' . "\n";
|
$ssl_settings .= 'ssl.dh-file = "' . $dhparams . '"' . "\n";
|
||||||
$ssl_settings .= 'ssl.ec-curve = "secp384r1"' . "\n";
|
$ssl_settings .= 'ssl.ec-curve = "secp384r1"' . "\n";
|
||||||
@@ -970,7 +969,7 @@ class Lighttpd extends HttpConfigBase
|
|||||||
} else {
|
} else {
|
||||||
if (! file_exists(Settings::Get('system.apacheconf_vhost'))) {
|
if (! file_exists(Settings::Get('system.apacheconf_vhost'))) {
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'lighttpd::writeConfigs: mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'lighttpd::writeConfigs: mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||||
safe_exec('mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
\Froxlor\FileDir::safe_exec('mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write a single file for every vhost
|
// Write a single file for every vhost
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class LighttpdFcgi extends Lighttpd
|
|||||||
|
|
||||||
// all the files and folders have to belong to the local user
|
// all the files and folders have to belong to the local user
|
||||||
// now because we also use fcgid for our own vhost
|
// now because we also use fcgid for our own vhost
|
||||||
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
|
\Froxlor\FileDir::safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
|
||||||
|
|
||||||
// get php.ini for our own vhost
|
// get php.ini for our own vhost
|
||||||
$php = new PhpInterface($domain);
|
$php = new PhpInterface($domain);
|
||||||
|
|||||||
@@ -72,19 +72,19 @@ class Nginx extends HttpConfigBase
|
|||||||
Fpm::createDummyPool($restart_cmd['config_dir']);
|
Fpm::createDummyPool($restart_cmd['config_dir']);
|
||||||
}
|
}
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: running ' . $restart_cmd['reload_cmd']);
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: running ' . $restart_cmd['reload_cmd']);
|
||||||
safe_exec(escapeshellcmd($restart_cmd['reload_cmd']));
|
\Froxlor\FileDir::safe_exec(escapeshellcmd($restart_cmd['reload_cmd']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: reloading nginx');
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: reloading nginx');
|
||||||
safe_exec(Settings::Get('system.apachereload_command'));
|
\Froxlor\FileDir::safe_exec(Settings::Get('system.apachereload_command'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nginx does not auto-spawn fcgi-processes
|
* nginx does not auto-spawn fcgi-processes
|
||||||
*/
|
*/
|
||||||
if (Settings::Get('system.phpreload_command') != '' && (int) Settings::Get('phpfpm.enabled') == 0) {
|
if (Settings::Get('system.phpreload_command') != '' && (int) Settings::Get('phpfpm.enabled') == 0) {
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: restarting php processes');
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: restarting php processes');
|
||||||
safe_exec(Settings::Get('system.phpreload_command'));
|
\Froxlor\FileDir::safe_exec(Settings::Get('system.phpreload_command'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ class Nginx extends HttpConfigBase
|
|||||||
foreach ($domains as $domain) {
|
foreach ($domains as $domain) {
|
||||||
|
|
||||||
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
|
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
$vhost_filename = $this->getVhostFilename($domain);
|
$vhost_filename = $this->getVhostFilename($domain);
|
||||||
@@ -647,7 +647,7 @@ class Nginx extends HttpConfigBase
|
|||||||
if (! empty(Settings::Get('system.dhparams_file'))) {
|
if (! empty(Settings::Get('system.dhparams_file'))) {
|
||||||
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||||
if (! file_exists($dhparams)) {
|
if (! file_exists($dhparams)) {
|
||||||
safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096');
|
\Froxlor\FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096');
|
||||||
}
|
}
|
||||||
$sslsettings .= 'ssl_dhparam ' . $dhparams . ';' . "\n";
|
$sslsettings .= 'ssl_dhparam ' . $dhparams . ';' . "\n";
|
||||||
}
|
}
|
||||||
@@ -1159,7 +1159,7 @@ class Nginx extends HttpConfigBase
|
|||||||
} else {
|
} else {
|
||||||
if (! file_exists(Settings::Get('system.apacheconf_vhost'))) {
|
if (! file_exists(Settings::Get('system.apacheconf_vhost'))) {
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'nginx::writeConfigs: mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'nginx::writeConfigs: mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||||
safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write a single file for every vhost
|
// Write a single file for every vhost
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class NginxFcgi extends Nginx
|
|||||||
|
|
||||||
// all the files and folders have to belong to the local user
|
// all the files and folders have to belong to the local user
|
||||||
// now because we also use fcgid for our own vhost
|
// now because we also use fcgid for our own vhost
|
||||||
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
|
\Froxlor\FileDir::safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
|
||||||
|
|
||||||
// get php.ini for our own vhost
|
// get php.ini for our own vhost
|
||||||
$php = new PhpInterface($domain);
|
$php = new PhpInterface($domain);
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ class Fcgid
|
|||||||
$starter_file_handler = fopen($this->getStarterFile(), 'w');
|
$starter_file_handler = fopen($this->getStarterFile(), 'w');
|
||||||
fwrite($starter_file_handler, $starter_file);
|
fwrite($starter_file_handler, $starter_file);
|
||||||
fclose($starter_file_handler);
|
fclose($starter_file_handler);
|
||||||
safe_exec('chmod 750 ' . escapeshellarg($this->getStarterFile()));
|
\Froxlor\FileDir::safe_exec('chmod 750 ' . escapeshellarg($this->getStarterFile()));
|
||||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($this->getStarterFile()));
|
\Froxlor\FileDir::safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($this->getStarterFile()));
|
||||||
setImmutable($this->getStarterFile());
|
setImmutable($this->getStarterFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,8 +173,8 @@ class Fcgid
|
|||||||
$phpini_file_handler = fopen($this->getIniFile(), 'w');
|
$phpini_file_handler = fopen($this->getIniFile(), 'w');
|
||||||
fwrite($phpini_file_handler, $phpini_file);
|
fwrite($phpini_file_handler, $phpini_file);
|
||||||
fclose($phpini_file_handler);
|
fclose($phpini_file_handler);
|
||||||
safe_exec('chown root:0 ' . escapeshellarg($this->getIniFile()));
|
\Froxlor\FileDir::safe_exec('chown root:0 ' . escapeshellarg($this->getIniFile()));
|
||||||
safe_exec('chmod 0644 ' . escapeshellarg($this->getIniFile()));
|
\Froxlor\FileDir::safe_exec('chmod 0644 ' . escapeshellarg($this->getIniFile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -190,8 +190,8 @@ class Fcgid
|
|||||||
$configdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.mod_fcgid_configdir') . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
$configdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.mod_fcgid_configdir') . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
||||||
|
|
||||||
if (! is_dir($configdir) && $createifnotexists) {
|
if (! is_dir($configdir) && $createifnotexists) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
\Froxlor\FileDir::safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $configdir;
|
return $configdir;
|
||||||
@@ -210,9 +210,9 @@ class Fcgid
|
|||||||
$tmpdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.mod_fcgid_tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
$tmpdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.mod_fcgid_tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||||
|
|
||||||
if (! is_dir($tmpdir) && $createifnotexists) {
|
if (! is_dir($tmpdir) && $createifnotexists) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||||
safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
\Froxlor\FileDir::safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
||||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
\Froxlor\FileDir::safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tmpdir;
|
return $tmpdir;
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ class Fpm
|
|||||||
$config = \Froxlor\FileDir::makeCorrectFile($configdir . '/' . $this->_domain['domain'] . '.conf');
|
$config = \Froxlor\FileDir::makeCorrectFile($configdir . '/' . $this->_domain['domain'] . '.conf');
|
||||||
|
|
||||||
if (! is_dir($configdir) && $createifnotexists) {
|
if (! is_dir($configdir) && $createifnotexists) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
@@ -311,8 +311,8 @@ class Fpm
|
|||||||
$socket = strtolower(\Froxlor\FileDir::makeCorrectFile($socketdir . '/' . $this->_domain['fpm_config_id'] . '-' . $this->_domain['loginname'] . '-' . $this->_domain['domain'] . '-php-fpm.socket'));
|
$socket = strtolower(\Froxlor\FileDir::makeCorrectFile($socketdir . '/' . $this->_domain['fpm_config_id'] . '-' . $this->_domain['loginname'] . '-' . $this->_domain['domain'] . '-php-fpm.socket'));
|
||||||
|
|
||||||
if (! is_dir($socketdir) && $createifnotexists) {
|
if (! is_dir($socketdir) && $createifnotexists) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($socketdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($socketdir));
|
||||||
safe_exec('chown -R ' . Settings::Get('system.httpuser') . ':' . Settings::Get('system.httpgroup') . ' ' . escapeshellarg($socketdir));
|
\Froxlor\FileDir::safe_exec('chown -R ' . Settings::Get('system.httpuser') . ':' . Settings::Get('system.httpgroup') . ' ' . escapeshellarg($socketdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $socket;
|
return $socket;
|
||||||
@@ -331,9 +331,9 @@ class Fpm
|
|||||||
$tmpdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
$tmpdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||||
|
|
||||||
if (! is_dir($tmpdir) && $createifnotexists) {
|
if (! is_dir($tmpdir) && $createifnotexists) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||||
safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
\Froxlor\FileDir::safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
||||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
\Froxlor\FileDir::safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tmpdir;
|
return $tmpdir;
|
||||||
@@ -357,8 +357,8 @@ class Fpm
|
|||||||
|
|
||||||
$configdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.aliasconfigdir') . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
$configdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.aliasconfigdir') . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
||||||
if (! is_dir($configdir) && $createifnotexists) {
|
if (! is_dir($configdir) && $createifnotexists) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
\Froxlor\FileDir::safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $configdir;
|
return $configdir;
|
||||||
@@ -373,7 +373,7 @@ class Fpm
|
|||||||
public static function createDummyPool($configdir)
|
public static function createDummyPool($configdir)
|
||||||
{
|
{
|
||||||
if (! is_dir($configdir)) {
|
if (! is_dir($configdir)) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||||
}
|
}
|
||||||
$config = \Froxlor\FileDir::makeCorrectFile($configdir . '/dummy.conf');
|
$config = \Froxlor\FileDir::makeCorrectFile($configdir . '/dummy.conf');
|
||||||
$dummy = "[dummy]
|
$dummy = "[dummy]
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class MailboxsizeCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
if (file_exists($_maildir) && is_dir($_maildir)) {
|
if (file_exists($_maildir) && is_dir($_maildir)) {
|
||||||
// mail-address allows many special characters, see http://en.wikipedia.org/wiki/Email_address#Local_part
|
// mail-address allows many special characters, see http://en.wikipedia.org/wiki/Email_address#Local_part
|
||||||
$return = false;
|
$return = false;
|
||||||
$back = safe_exec('du -sk ' . escapeshellarg($_maildir), $return, array(
|
$back = \Froxlor\FileDir::safe_exec('du -sk ' . escapeshellarg($_maildir), $return, array(
|
||||||
'|',
|
'|',
|
||||||
'&',
|
'&',
|
||||||
'`',
|
'`',
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
// Use the old fashioned way with "du"
|
// Use the old fashioned way with "du"
|
||||||
if (file_exists($row['documentroot']) && is_dir($row['documentroot'])) {
|
if (file_exists($row['documentroot']) && is_dir($row['documentroot'])) {
|
||||||
$back = safe_exec('du -sk ' . escapeshellarg($row['documentroot']) . '');
|
$back = \Froxlor\FileDir::safe_exec('du -sk ' . escapeshellarg($row['documentroot']) . '');
|
||||||
foreach ($back as $backrow) {
|
foreach ($back as $backrow) {
|
||||||
$webspaceusage = explode(' ', $backrow);
|
$webspaceusage = explode(' ', $backrow);
|
||||||
}
|
}
|
||||||
@@ -393,7 +393,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
$maildir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.vmail_homedir') . $row['loginname']);
|
$maildir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.vmail_homedir') . $row['loginname']);
|
||||||
if (file_exists($maildir) && is_dir($maildir)) {
|
if (file_exists($maildir) && is_dir($maildir)) {
|
||||||
$back = safe_exec('du -sk ' . escapeshellarg($maildir) . '');
|
$back = \Froxlor\FileDir::safe_exec('du -sk ' . escapeshellarg($maildir) . '');
|
||||||
foreach ($back as $backrow) {
|
foreach ($back as $backrow) {
|
||||||
$emailusage = explode(' ', $backrow);
|
$emailusage = explode(' ', $backrow);
|
||||||
}
|
}
|
||||||
@@ -515,7 +515,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
$stringdata = "0 " . $current_diskspace['all'] * 1024 . "";
|
$stringdata = "0 " . $current_diskspace['all'] * 1024 . "";
|
||||||
fwrite($fh, $stringdata);
|
fwrite($fh, $stringdata);
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
safe_exec('chown ' . $user . ':' . $group . ' ' . escapeshellarg($quotafile) . '');
|
\Froxlor\FileDir::safe_exec('chown ' . $user . ':' . $group . ' ' . escapeshellarg($quotafile) . '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -623,7 +623,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
$staticOutputdir = \Froxlor\FileDir::makeCorrectDir($outputdir . '/' . date('Y') . '-' . date('m'));
|
$staticOutputdir = \Froxlor\FileDir::makeCorrectDir($outputdir . '/' . date('Y') . '-' . date('m'));
|
||||||
|
|
||||||
if (! is_dir($staticOutputdir)) {
|
if (! is_dir($staticOutputdir)) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($staticOutputdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($staticOutputdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for correct path of awstats_buildstaticpages.pl
|
// check for correct path of awstats_buildstaticpages.pl
|
||||||
@@ -637,7 +637,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Running awstats_buildstaticpages.pl for domain '" . $domain . "' (Output: '" . $staticOutputdir . "')");
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Running awstats_buildstaticpages.pl for domain '" . $domain . "' (Output: '" . $staticOutputdir . "')");
|
||||||
safe_exec($awbsp . ' -awstatsprog=' . escapeshellarg($awprog) . ' -update -month=' . date('m') . ' -year=' . date('Y') . ' -config=' . $domain . ' -dir=' . escapeshellarg($staticOutputdir));
|
\Froxlor\FileDir::safe_exec($awbsp . ' -awstatsprog=' . escapeshellarg($awprog) . ' -update -month=' . date('m') . ' -year=' . date('Y') . ' -config=' . $domain . ' -dir=' . escapeshellarg($staticOutputdir));
|
||||||
|
|
||||||
// update our awstats index files
|
// update our awstats index files
|
||||||
awstatsGenerateIndex($domain, $outputdir);
|
awstatsGenerateIndex($domain, $outputdir);
|
||||||
@@ -645,7 +645,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
// the default selection is 'current',
|
// the default selection is 'current',
|
||||||
// so link the latest dir to it
|
// so link the latest dir to it
|
||||||
$new_current = \Froxlor\FileDir::makeCorrectFile($outputdir . '/current');
|
$new_current = \Froxlor\FileDir::makeCorrectFile($outputdir . '/current');
|
||||||
safe_exec('ln -fTs ' . escapeshellarg($staticOutputdir) . ' ' . escapeshellarg($new_current));
|
\Froxlor\FileDir::safe_exec('ln -fTs ' . escapeshellarg($staticOutputdir) . ' ' . escapeshellarg($new_current));
|
||||||
|
|
||||||
// statistics file looks like: 'awstats[month][year].[domain].txt'
|
// statistics file looks like: 'awstats[month][year].[domain].txt'
|
||||||
$file = \Froxlor\FileDir::makeCorrectFile($outputdir . '/awstats' . date('mY', time()) . '.' . $domain . '.txt');
|
$file = \Froxlor\FileDir::makeCorrectFile($outputdir . '/awstats' . date('mY', time()) . '.' . $domain . '.txt');
|
||||||
@@ -833,7 +833,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
$outputdir = \Froxlor\FileDir::makeCorrectDir($outputdir);
|
$outputdir = \Froxlor\FileDir::makeCorrectDir($outputdir);
|
||||||
if (! file_exists($outputdir)) {
|
if (! file_exists($outputdir)) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($outputdir));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($outputdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists($outputdir . 'webalizer.hist.1')) {
|
if (file_exists($outputdir . 'webalizer.hist.1')) {
|
||||||
@@ -841,7 +841,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists($outputdir . 'webalizer.hist') && ! file_exists($outputdir . 'webalizer.hist.1')) {
|
if (file_exists($outputdir . 'webalizer.hist') && ! file_exists($outputdir . 'webalizer.hist.1')) {
|
||||||
safe_exec('cp ' . escapeshellarg($outputdir . 'webalizer.hist') . ' ' . escapeshellarg($outputdir . 'webalizer.hist.1'));
|
\Froxlor\FileDir::safe_exec('cp ' . escapeshellarg($outputdir . 'webalizer.hist') . ' ' . escapeshellarg($outputdir . 'webalizer.hist.1'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$verbosity = '';
|
$verbosity = '';
|
||||||
@@ -859,7 +859,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Running webalizer for domain '" . $caption . "'");
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Running webalizer for domain '" . $caption . "'");
|
||||||
safe_exec($we . ' ' . $verbosity . ' -p -o ' . escapeshellarg($outputdir) . ' -n ' . escapeshellarg($caption) . $domainargs . ' ' . escapeshellarg($logfile));
|
\Froxlor\FileDir::safe_exec($we . ' ' . $verbosity . ' -p -o ' . escapeshellarg($outputdir) . ' -n ' . escapeshellarg($caption) . $domainargs . ' ' . escapeshellarg($logfile));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format of webalizer.hist-files:
|
* Format of webalizer.hist-files:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Froxlor;
|
namespace Froxlor;
|
||||||
|
|
||||||
use Froxlor\Database as Database;
|
use Froxlor\Database\Database;
|
||||||
|
|
||||||
class FileDir
|
class FileDir
|
||||||
{
|
{
|
||||||
@@ -346,7 +346,7 @@ class FileDir
|
|||||||
*/
|
*/
|
||||||
public static function setImmutable($filename = null)
|
public static function setImmutable($filename = null)
|
||||||
{
|
{
|
||||||
safe_exec(self::getImmutableFunction(false) . escapeshellarg($filename));
|
\Froxlor\FileDir::safe_exec(self::getImmutableFunction(false) . escapeshellarg($filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -359,7 +359,7 @@ class FileDir
|
|||||||
*/
|
*/
|
||||||
public static function removeImmutable($filename = null)
|
public static function removeImmutable($filename = null)
|
||||||
{
|
{
|
||||||
safe_exec(self::getImmutableFunction(true) . escapeshellarg($filename));
|
\Froxlor\FileDir::safe_exec(self::getImmutableFunction(true) . escapeshellarg($filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -49,6 +49,6 @@ function makeChownWithNewStats($row) {
|
|||||||
// only run chown if directory exists
|
// only run chown if directory exists
|
||||||
if (file_exists($dir)) {
|
if (file_exists($dir)) {
|
||||||
// run chown
|
// run chown
|
||||||
safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
|
\Froxlor\FileDir::safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ function storeDefaultIndex($loginname = null, $destination = null, $logger = nul
|
|||||||
if ($logger !== null) {
|
if ($logger !== null) {
|
||||||
$logger->logAction(CRON_ACTION, LOG_NOTICE, 'Running: cp -a ' . \Froxlor\Froxlor::getInstallDir() . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
|
$logger->logAction(CRON_ACTION, LOG_NOTICE, 'Running: cp -a ' . \Froxlor\Froxlor::getInstallDir() . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
|
||||||
}
|
}
|
||||||
safe_exec('cp -a ' . \Froxlor\Froxlor::getInstallDir() . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
|
\Froxlor\FileDir::safe_exec('cp -a ' . \Froxlor\Froxlor::getInstallDir() . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot
|
|||||||
|
|
||||||
$awstats_dir = \Froxlor\FileDir::makeCorrectDir($customerDocroot.'/awstats/'.$siteDomain.'/');
|
$awstats_dir = \Froxlor\FileDir::makeCorrectDir($customerDocroot.'/awstats/'.$siteDomain.'/');
|
||||||
if (!is_dir($awstats_dir)) {
|
if (!is_dir($awstats_dir)) {
|
||||||
safe_exec('mkdir -p '.escapeshellarg($awstats_dir));
|
\Froxlor\FileDir::safe_exec('mkdir -p '.escapeshellarg($awstats_dir));
|
||||||
}
|
}
|
||||||
// chown created folder, #258
|
// chown created folder, #258
|
||||||
makeChownWithNewStats($awstats_params);
|
makeChownWithNewStats($awstats_params);
|
||||||
|
|
||||||
// weird but could happen...
|
// weird but could happen...
|
||||||
if (!is_dir(Settings::Get('system.awstats_conf'))) {
|
if (!is_dir(Settings::Get('system.awstats_conf'))) {
|
||||||
safe_exec('mkdir -p '.escapeshellarg(Settings::Get('system.awstats_conf')));
|
\Froxlor\FileDir::safe_exec('mkdir -p '.escapeshellarg(Settings::Get('system.awstats_conf')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// These are the variables we will replace
|
// These are the variables we will replace
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ if (function_exists('exec')) {
|
|||||||
|
|
||||||
// error log
|
// error log
|
||||||
if (file_exists($error_log)) {
|
if (file_exists($error_log)) {
|
||||||
$result = safe_exec('tail -n ' . $last_n . ' ' . escapeshellarg($error_log));
|
$result = \Froxlor\FileDir::safe_exec('tail -n ' . $last_n . ' ' . escapeshellarg($error_log));
|
||||||
$error_log_content = implode("\n", $result) . "</textarea>";
|
$error_log_content = implode("\n", $result) . "</textarea>";
|
||||||
} else {
|
} else {
|
||||||
$error_log_content = "Error-Log" . (AREA == 'admin' ? " '" . $error_log . "'" : "") . " does not seem to exist";
|
$error_log_content = "Error-Log" . (AREA == 'admin' ? " '" . $error_log . "'" : "") . " does not seem to exist";
|
||||||
@@ -72,7 +72,7 @@ if (function_exists('exec')) {
|
|||||||
|
|
||||||
// access log
|
// access log
|
||||||
if (file_exists($access_log)) {
|
if (file_exists($access_log)) {
|
||||||
$result = safe_exec('tail -n ' . $last_n . ' ' . escapeshellarg($access_log));
|
$result = \Froxlor\FileDir::safe_exec('tail -n ' . $last_n . ' ' . escapeshellarg($access_log));
|
||||||
$access_log_content = implode("\n", $result);
|
$access_log_content = implode("\n", $result);
|
||||||
} else {
|
} else {
|
||||||
$access_log_content = "Access-Log" . (AREA == 'admin' ? " '" . $access_log . "'" : "") . " does not seem to exist";
|
$access_log_content = "Access-Log" . (AREA == 'admin' ? " '" . $access_log . "'" : "") . " does not seem to exist";
|
||||||
|
|||||||
Reference in New Issue
Block a user