use correct makeCorrect(Dir/File) everywhere
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -32,7 +32,7 @@ class Bind extends DnsBase
|
||||
|
||||
// check for subfolder in bind-config-directory
|
||||
if (! file_exists(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/'))) {
|
||||
$this->_logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir ' . escapeshellarg(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/')));
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class Bind extends DnsBase
|
||||
if ($domain['ismainbutsubto'] == 0) {
|
||||
$zoneContent = (string) createDomainZone(($domain['id'] == 'none') ? $domain : $domain['id'], $isFroxlorHostname);
|
||||
$domain['zonefile'] = 'domains/' . $domain['domain'] . '.zone';
|
||||
$zonefile_name = makeCorrectFile(Settings::Get('system.bindconf_directory') . '/' . $domain['zonefile']);
|
||||
$zonefile_name = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.bindconf_directory') . '/' . $domain['zonefile']);
|
||||
$zonefile_handler = fopen($zonefile_name, 'w');
|
||||
fwrite($zonefile_handler, $zoneContent . $subzones);
|
||||
fclose($zonefile_handler);
|
||||
@@ -148,7 +148,7 @@ class Bind extends DnsBase
|
||||
foreach ($its as $it) {
|
||||
if ($it->isFile()) {
|
||||
// remove file
|
||||
\Froxlor\FileDir::safe_exec('rm -f ' . escapeshellarg(makeCorrectFile($its->getPathname())));
|
||||
\Froxlor\FileDir::safe_exec('rm -f ' . escapeshellarg(\Froxlor\FileDir::makeCorrectFile($its->getPathname())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,9 +181,9 @@ abstract class DnsBase
|
||||
public function writeDKIMconfigs()
|
||||
{
|
||||
if (Settings::Get('dkim.use_dkim') == '1') {
|
||||
if (! file_exists(makeCorrectDir(Settings::Get('dkim.dkim_prefix')))) {
|
||||
$this->_logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir -p ' . escapeshellarg(makeCorrectDir(Settings::Get('dkim.dkim_prefix'))));
|
||||
safe_exec('mkdir -p ' . escapeshellarg(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'))));
|
||||
safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix'))));
|
||||
}
|
||||
|
||||
$dkimdomains = '';
|
||||
@@ -195,18 +195,18 @@ abstract class DnsBase
|
||||
|
||||
while ($domain = $result_domains_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
|
||||
$privkey_filename = makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id']);
|
||||
$pubkey_filename = makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id'] . '.public');
|
||||
$privkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id']);
|
||||
$pubkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id'] . '.public');
|
||||
|
||||
if ($domain['dkim_privkey'] == '' || $domain['dkim_pubkey'] == '') {
|
||||
$max_dkim_id_stmt = Database::query("SELECT MAX(`dkim_id`) as `max_dkim_id` FROM `" . TABLE_PANEL_DOMAINS . "`");
|
||||
$max_dkim_id = $max_dkim_id_stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
$domain['dkim_id'] = (int) $max_dkim_id['max_dkim_id'] + 1;
|
||||
$privkey_filename = 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'));
|
||||
$domain['dkim_privkey'] = file_get_contents($privkey_filename);
|
||||
safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
||||
$pubkey_filename = 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));
|
||||
$domain['dkim_pubkey'] = file_get_contents($pubkey_filename);
|
||||
safe_exec("chmod 0664 " . escapeshellarg($pubkey_filename));
|
||||
@@ -244,11 +244,11 @@ abstract class DnsBase
|
||||
$dkimkeys .= "*@" . $domain['domain'] . ":" . $domain['domain'] . ":" . $privkey_filename . "\n";
|
||||
}
|
||||
|
||||
$dkimdomains_filename = makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/' . Settings::Get('dkim.dkim_domains'));
|
||||
$dkimdomains_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/' . Settings::Get('dkim.dkim_domains'));
|
||||
$dkimdomains_file_handler = fopen($dkimdomains_filename, "w");
|
||||
fwrite($dkimdomains_file_handler, $dkimdomains);
|
||||
fclose($dkimdomains_file_handler);
|
||||
$dkimkeys_filename = makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/' . Settings::Get('dkim.dkim_dkimkeys'));
|
||||
$dkimkeys_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/' . Settings::Get('dkim.dkim_dkimkeys'));
|
||||
$dkimkeys_file_handler = fopen($dkimkeys_filename, "w");
|
||||
fwrite($dkimkeys_file_handler, $dkimkeys);
|
||||
fclose($dkimkeys_file_handler);
|
||||
|
||||
@@ -105,13 +105,13 @@ class Apache extends HttpConfigBase
|
||||
}
|
||||
$this->virtualhosts_data[$vhosts_filename] .= ' </Directory>' . "\n";
|
||||
|
||||
$ocsp_cache_filename = makeCorrectFile($vhosts_folder . '/03_froxlor_ocsp_cache.conf');
|
||||
$ocsp_cache_filename = \Froxlor\FileDir::makeCorrectFile($vhosts_folder . '/03_froxlor_ocsp_cache.conf');
|
||||
if (Settings::Get('system.use_ssl') == '1' && Settings::Get('system.apache24') == 1) {
|
||||
$this->virtualhosts_data[$ocsp_cache_filename] = 'SSLStaplingCache ' . Settings::Get('system.apache24_ocsp_cache_path') . "\n";
|
||||
} else {
|
||||
if (file_exists($ocsp_cache_filename)) {
|
||||
\Froxlor\FroxlorLogger::getInstance()->logAction(CRON_ACTION, LOG_NOTICE, 'apache::_createStandardDirectoryEntry: unlinking ' . basename($ocsp_cache_filename));
|
||||
unlink(makeCorrectFile($ocsp_cache_filename));
|
||||
unlink(\Froxlor\FileDir::makeCorrectFile($ocsp_cache_filename));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ class ConfigIO
|
||||
// now get rid of old stuff
|
||||
// (but append /*.conf so we don't delete the directory)
|
||||
$configdir .= '/*.conf';
|
||||
\Froxlor\FileDir::safe_exec('rm -f ' . makeCorrectFile($configdir));
|
||||
\Froxlor\FileDir::safe_exec('rm -f ' . \Froxlor\FileDir::makeCorrectFile($configdir));
|
||||
} else {
|
||||
\Froxlor\FileDir::safe_exec('mkdir -p ' . $configdir);
|
||||
}
|
||||
|
||||
@@ -63,15 +63,15 @@ class DomainSSL
|
||||
// check if it's an array and if the most important field is set
|
||||
if (is_array($dom_certs) && isset($dom_certs['ssl_cert_file']) && $dom_certs['ssl_cert_file'] != '') {
|
||||
// get destination path
|
||||
$sslcertpath = makeCorrectDir(Settings::Get('system.customer_ssl_path'));
|
||||
$sslcertpath = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.customer_ssl_path'));
|
||||
// create path if it does not exist
|
||||
if (! file_exists($sslcertpath)) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($sslcertpath));
|
||||
}
|
||||
// make correct files for the certificates
|
||||
$ssl_files = array(
|
||||
'ssl_cert_file' => makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '.crt'),
|
||||
'ssl_key_file' => makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '.key')
|
||||
'ssl_cert_file' => \Froxlor\FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '.crt'),
|
||||
'ssl_key_file' => \Froxlor\FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '.key')
|
||||
);
|
||||
|
||||
if (Settings::Get('system.webserver') == 'lighttpd') {
|
||||
@@ -85,19 +85,19 @@ class DomainSSL
|
||||
$ssl_files['ssl_cert_chainfile'] = '';
|
||||
// set them if they are != empty
|
||||
if ($dom_certs['ssl_ca_file'] != '') {
|
||||
$ssl_files['ssl_ca_file'] = makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_CA.pem');
|
||||
$ssl_files['ssl_ca_file'] = \Froxlor\FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_CA.pem');
|
||||
}
|
||||
if ($dom_certs['ssl_cert_chainfile'] != '') {
|
||||
if (Settings::Get('system.webserver') == 'nginx') {
|
||||
// put ca.crt in my.crt, as nginx does not support a separate chain file.
|
||||
$dom_certs['ssl_cert_file'] = trim($dom_certs['ssl_cert_file']) . "\n" . trim($dom_certs['ssl_cert_chainfile']) . "\n";
|
||||
} else {
|
||||
$ssl_files['ssl_cert_chainfile'] = makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_chain.pem');
|
||||
$ssl_files['ssl_cert_chainfile'] = \Froxlor\FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_chain.pem');
|
||||
}
|
||||
}
|
||||
// will only be generated to be used externally, froxlor does not need this
|
||||
if ($dom_certs['ssl_fullchain_file'] != '') {
|
||||
$ssl_files['ssl_fullchain_file'] = makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_fullchain.pem');
|
||||
$ssl_files['ssl_fullchain_file'] = \Froxlor\FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_fullchain.pem');
|
||||
}
|
||||
// create them on the filesystem
|
||||
foreach ($ssl_files as $type => $filename) {
|
||||
|
||||
@@ -61,13 +61,13 @@ class HttpConfigBase
|
||||
{
|
||||
if (! empty($ip_port) && $ip_port['docroot'] == '') {
|
||||
if (Settings::Get('system.froxlordirectlyviahostname')) {
|
||||
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__))));
|
||||
$mypath = \Froxlor\FileDir::makeCorrectDir(dirname(dirname(dirname(__FILE__))));
|
||||
} else {
|
||||
$mypath = makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__)))));
|
||||
$mypath = \Froxlor\FileDir::makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__)))));
|
||||
}
|
||||
} else {
|
||||
// user-defined docroot, #417
|
||||
$mypath = makeCorrectDir($ip_port['docroot']);
|
||||
$mypath = \Froxlor\FileDir::makeCorrectDir($ip_port['docroot']);
|
||||
}
|
||||
return $mypath;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class Lighttpd extends HttpConfigBase
|
||||
foreach ($restart_cmds as $restart_cmd) {
|
||||
// check whether the config dir is empty (no domains uses this daemon)
|
||||
// so we need to create a dummy
|
||||
$_conffiles = glob(makeCorrectFile($restart_cmd['config_dir'] . "/*.conf"));
|
||||
$_conffiles = glob(\Froxlor\FileDir::makeCorrectFile($restart_cmd['config_dir'] . "/*.conf"));
|
||||
if ($_conffiles === false || empty($_conffiles)) {
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: fpm config directory "' . $restart_cmd['config_dir'] . '" is empty. Creating dummy.');
|
||||
Fpm::createDummyPool($restart_cmd['config_dir']);
|
||||
@@ -86,7 +86,7 @@ class Lighttpd extends HttpConfigBase
|
||||
}
|
||||
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::createIpPort: creating ip/port settings for ' . $ip . ":" . $port);
|
||||
$vhost_filename = makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/10_froxlor_ipandport_' . trim(str_replace(':', '.', $row_ipsandports['ip']), '.') . '.' . $row_ipsandports['port'] . '.conf');
|
||||
$vhost_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/10_froxlor_ipandport_' . trim(str_replace(':', '.', $row_ipsandports['ip']), '.') . '.' . $row_ipsandports['port'] . '.conf');
|
||||
|
||||
if (! isset($this->lighttpd_data[$vhost_filename])) {
|
||||
$this->lighttpd_data[$vhost_filename] = '';
|
||||
@@ -254,7 +254,7 @@ class Lighttpd extends HttpConfigBase
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.engine = "enable"' . "\n";
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.use-compression = "disable"' . "\n";
|
||||
if (!empty(Settings::Get('system.dhparams_file'))) {
|
||||
$dhparams = makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||
if (!file_exists($dhparams)) {
|
||||
safe_exec('openssl dhparam -out '.escapeshellarg($dhparams).' 4096');
|
||||
}
|
||||
@@ -265,7 +265,7 @@ class Lighttpd extends HttpConfigBase
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.use-sslv3 = "disable"' . "\n";
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.cipher-list = "' . Settings::Get('system.ssl_cipher_list') . '"' . "\n";
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.honor-cipher-order = "enable"' . "\n";
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.pemfile = "' . makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.pemfile = "' . \Froxlor\FileDir::makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
|
||||
|
||||
if ($domain['ssl_ca_file'] != '') {
|
||||
// check for existence, #1485
|
||||
@@ -273,7 +273,7 @@ class Lighttpd extends HttpConfigBase
|
||||
$this->logger->logAction(CRON_ACTION, LOG_ERR, $ip . ':' . $port . ' :: certificate CA file "' . $domain['ssl_ca_file'] . '" does not exist! Cannot create ssl-directives');
|
||||
echo $ip . ':' . port . ' :: certificate CA file "' . $domain['ssl_ca_file'] . '" does not exist! SSL-directives might not be working' . "\n";
|
||||
} else {
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.ca-file = "' . makeCorrectFile($domain['ssl_ca_file']) . '"' . "\n";
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.ca-file = "' . \Froxlor\FileDir::makeCorrectFile($domain['ssl_ca_file']) . '"' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,7 +310,7 @@ class Lighttpd extends HttpConfigBase
|
||||
private function _createStandardErrorHandler()
|
||||
{
|
||||
if (Settings::Get('defaultwebsrverrhandler.enabled') == '1' && Settings::Get('defaultwebsrverrhandler.err404') != '') {
|
||||
$vhost_filename = makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/05_froxlor_default_errorhandler.conf');
|
||||
$vhost_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/05_froxlor_default_errorhandler.conf');
|
||||
|
||||
if (! isset($this->lighttpd_data[$vhost_filename])) {
|
||||
$this->lighttpd_data[$vhost_filename] = '';
|
||||
@@ -318,7 +318,7 @@ class Lighttpd extends HttpConfigBase
|
||||
|
||||
$defhandler = Settings::Get('defaultwebsrverrhandler.err404');
|
||||
if (! validateUrl($defhandler)) {
|
||||
$defhandler = makeCorrectFile($defhandler);
|
||||
$defhandler = \Froxlor\FileDir::makeCorrectFile($defhandler);
|
||||
}
|
||||
$this->lighttpd_data[$vhost_filename] = 'server.error-handler-404 = "' . $defhandler . '"';
|
||||
}
|
||||
@@ -337,7 +337,7 @@ class Lighttpd extends HttpConfigBase
|
||||
|
||||
$htaccess_text = '';
|
||||
while ($row_htpasswds = $result_htpasswds_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$row_htpasswds['path'] = makeCorrectDir($row_htpasswds['path']);
|
||||
$row_htpasswds['path'] = \Froxlor\FileDir::makeCorrectDir($row_htpasswds['path']);
|
||||
mkDirWithCorrectOwnership($domain['documentroot'], $row_htpasswds['path'], $domain['guid'], $domain['guid']);
|
||||
|
||||
$filename = $row_htpasswds['customerid'] . '-' . md5($row_htpasswds['path']) . '.htpasswd';
|
||||
@@ -352,11 +352,11 @@ class Lighttpd extends HttpConfigBase
|
||||
}
|
||||
|
||||
$htaccess_path = substr($row_htpasswds['path'], strlen($domain['documentroot']) - 1);
|
||||
$htaccess_path = makeCorrectDir($htaccess_path);
|
||||
$htaccess_path = \Froxlor\FileDir::makeCorrectDir($htaccess_path);
|
||||
|
||||
$htaccess_text .= ' $HTTP["url"] =~ "^' . $htaccess_path . '" {' . "\n";
|
||||
$htaccess_text .= ' auth.backend = "htpasswd"' . "\n";
|
||||
$htaccess_text .= ' auth.backend.htpasswd.userfile = "' . makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $filename) . '"' . "\n";
|
||||
$htaccess_text .= ' auth.backend.htpasswd.userfile = "' . \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $filename) . '"' . "\n";
|
||||
$htaccess_text .= ' auth.require = ( ' . "\n";
|
||||
$htaccess_text .= ' "' . $htaccess_path . '" =>' . "\n";
|
||||
$htaccess_text .= ' (' . "\n";
|
||||
@@ -392,12 +392,12 @@ class Lighttpd extends HttpConfigBase
|
||||
foreach ($domains as $domain) {
|
||||
|
||||
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg(makeCorrectDir(Settings::Get('system.apacheconf_vhost') . '/vhosts/')));
|
||||
safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost') . '/vhosts/')));
|
||||
|
||||
// determine correct include-path:
|
||||
// e.g. '/etc/lighttpd/conf-enabled/vhosts/ has to become'
|
||||
// 'conf-enabled/vhosts/' (damn debian, but luckily works too on other distros)
|
||||
$_tmp_path = substr(makeCorrectDir(Settings::Get('system.apacheconf_vhost')), 0, - 1);
|
||||
$_tmp_path = substr(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost')), 0, - 1);
|
||||
$_pos = strrpos($_tmp_path, '/');
|
||||
$_inc_path = substr($_tmp_path, $_pos + 1);
|
||||
|
||||
@@ -417,7 +417,7 @@ class Lighttpd extends HttpConfigBase
|
||||
$vhost_no = (int) $vhost_no += 10;
|
||||
}
|
||||
|
||||
$vhost_filename = makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/vhosts/' . $vhost_no . '_' . $domain['domain'] . '.conf');
|
||||
$vhost_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/vhosts/' . $vhost_no . '_' . $domain['domain'] . '.conf');
|
||||
$included_vhosts[] = $_inc_path . '/vhosts/' . $vhost_no . '_' . $domain['domain'] . '.conf';
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ class Lighttpd extends HttpConfigBase
|
||||
//$ssl_settings .= 'ssl.engine = "enable"' . "\n";
|
||||
$ssl_settings .= 'ssl.use-compression = "disable"' . "\n";
|
||||
if (!empty(Settings::Get('system.dhparams_file'))) {
|
||||
$dhparams = makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||
if (!file_exists($dhparams)) {
|
||||
safe_exec('openssl dhparam -out '.escapeshellarg($dhparams).' 4096');
|
||||
}
|
||||
@@ -587,10 +587,10 @@ class Lighttpd extends HttpConfigBase
|
||||
$ssl_settings .= 'ssl.use-sslv3 = "disable"' . "\n";
|
||||
$ssl_settings .= 'ssl.cipher-list = "' . Settings::Get('system.ssl_cipher_list') . '"' . "\n";
|
||||
$ssl_settings .= 'ssl.honor-cipher-order = "enable"' . "\n";
|
||||
$ssl_settings .= 'ssl.pemfile = "' . makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
|
||||
$ssl_settings .= 'ssl.pemfile = "' . \Froxlor\FileDir::makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
|
||||
|
||||
if ($domain['ssl_ca_file'] != '') {
|
||||
$ssl_settings .= 'ssl.ca-file = "' . makeCorrectFile($domain['ssl_ca_file']) . '"' . "\n";
|
||||
$ssl_settings .= 'ssl.ca-file = "' . \Froxlor\FileDir::makeCorrectFile($domain['ssl_ca_file']) . '"' . "\n";
|
||||
}
|
||||
|
||||
if ($domain['hsts'] >= 0) {
|
||||
@@ -626,7 +626,7 @@ class Lighttpd extends HttpConfigBase
|
||||
// error log cannot be set conditionally see
|
||||
// https://redmine.lighttpd.net/issues/665
|
||||
if ($domain['writeaccesslog']) {
|
||||
$access_log = makeCorrectFile(Settings::Get('system.logfiles_directory') . $domain['loginname'] . $speciallogfile . '-access.log');
|
||||
$access_log = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.logfiles_directory') . $domain['loginname'] . $speciallogfile . '-access.log');
|
||||
// Create the logfile if it does not exist (fixes #46)
|
||||
touch($access_log);
|
||||
chown($access_log, Settings::Get('system.httpuser'));
|
||||
@@ -703,7 +703,7 @@ class Lighttpd extends HttpConfigBase
|
||||
if (! empty($row['error404path'])) {
|
||||
$defhandler = $row['error404path'];
|
||||
if (! validateUrl($defhandler)) {
|
||||
$defhandler = makeCorrectFile($domain['documentroot'] . '/' . $defhandler);
|
||||
$defhandler = \Froxlor\FileDir::makeCorrectFile($domain['documentroot'] . '/' . $defhandler);
|
||||
}
|
||||
$error_string .= ' server.error-handler-404 = "' . $defhandler . '"' . "\n\n";
|
||||
}
|
||||
@@ -715,7 +715,7 @@ class Lighttpd extends HttpConfigBase
|
||||
$error_string = '';
|
||||
}
|
||||
|
||||
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
$path = \Froxlor\FileDir::makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
|
||||
|
||||
// We need to remove the last slash, otherwise the regex wouldn't work
|
||||
@@ -730,7 +730,7 @@ class Lighttpd extends HttpConfigBase
|
||||
}
|
||||
|
||||
if (customerHasPerlEnabled($domain['customerid']) && $row['options_cgi'] != '0') {
|
||||
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
$path = \Froxlor\FileDir::makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
|
||||
|
||||
// We need to remove the last slash, otherwise the regex wouldn't work
|
||||
@@ -739,8 +739,8 @@ class Lighttpd extends HttpConfigBase
|
||||
}
|
||||
$path_options .= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
|
||||
$path_options .= "\t" . 'cgi.assign = (' . "\n";
|
||||
$path_options .= "\t\t" . '".pl" => "' . makeCorrectFile(Settings::Get('system.perl_path')) . '",' . "\n";
|
||||
$path_options .= "\t\t" . '".cgi" => "' . makeCorrectFile(Settings::Get('system.perl_path')) . '"' . "\n";
|
||||
$path_options .= "\t\t" . '".pl" => "' . \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.perl_path')) . '",' . "\n";
|
||||
$path_options .= "\t\t" . '".cgi" => "' . \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.perl_path')) . '"' . "\n";
|
||||
$path_options .= "\t" . ')' . "\n";
|
||||
$path_options .= ' }' . "\n\n";
|
||||
}
|
||||
@@ -766,21 +766,21 @@ class Lighttpd extends HttpConfigBase
|
||||
if ($this->auth_backend_loaded[$domain['ipandport']] != 'yes') {
|
||||
$auth_backend_loaded[$domain['ipandport']] = 'yes';
|
||||
$diroption_text .= 'auth.backend = "htpasswd"' . "\n";
|
||||
$diroption_text .= 'auth.backend.htpasswd.userfile = "' . makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $filename) . '"' . "\n";
|
||||
$diroption_text .= 'auth.backend.htpasswd.userfile = "' . \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $filename) . '"' . "\n";
|
||||
$this->needed_htpasswds[$filename] = $row_htpasswds['username'] . ':' . $row_htpasswds['password'] . "\n";
|
||||
$diroption_text .= 'auth.require = ( ' . "\n";
|
||||
$previous_domain_id = '1';
|
||||
} elseif ($this->auth_backend_loaded[$domain['ssl_ipandport']] != 'yes') {
|
||||
$auth_backend_loaded[$domain['ssl_ipandport']] = 'yes';
|
||||
$diroption_text .= 'auth.backend= "htpasswd"' . "\n";
|
||||
$diroption_text .= 'auth.backend.htpasswd.userfile = "' . makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $filename) . '"' . "\n";
|
||||
$diroption_text .= 'auth.backend.htpasswd.userfile = "' . \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $filename) . '"' . "\n";
|
||||
$this->needed_htpasswds[$filename] = $row_htpasswds['username'] . ':' . $row_htpasswds['password'] . "\n";
|
||||
$diroption_text .= 'auth.require = ( ' . "\n";
|
||||
$previous_domain_id = '1';
|
||||
}
|
||||
}
|
||||
|
||||
$diroption_text .= '"' . makeCorrectDir($row_htpasswds['path']) . '" =>' . "\n";
|
||||
$diroption_text .= '"' . \Froxlor\FileDir::makeCorrectDir($row_htpasswds['path']) . '" =>' . "\n";
|
||||
$diroption_text .= '(' . "\n";
|
||||
$diroption_text .= ' "method" => "basic",' . "\n";
|
||||
$diroption_text .= ' "realm" => "' . $row_htpasswds['authname'] . '",' . "\n";
|
||||
@@ -796,7 +796,7 @@ class Lighttpd extends HttpConfigBase
|
||||
}
|
||||
}
|
||||
|
||||
return ' auth.backend.htpasswd.userfile = "' . makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $filename) . '"' . "\n";
|
||||
return ' auth.backend.htpasswd.userfile = "' . \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $filename) . '"' . "\n";
|
||||
}
|
||||
|
||||
protected function getServerNames($domain)
|
||||
@@ -870,7 +870,7 @@ class Lighttpd extends HttpConfigBase
|
||||
|
||||
if ($domain['deactivated'] == '1' && Settings::Get('system.deactivateddocroot') != '') {
|
||||
$webroot_text .= ' # Using docroot for deactivated users...' . "\n";
|
||||
$webroot_text .= ' server.document-root = "' . makeCorrectDir(Settings::Get('system.deactivateddocroot')) . "\"\n";
|
||||
$webroot_text .= ' server.document-root = "' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.deactivateddocroot')) . "\"\n";
|
||||
$this->_deactivated = true;
|
||||
} else {
|
||||
if ($ssl === false && $domain['ssl_redirect'] == '1') {
|
||||
@@ -888,7 +888,7 @@ class Lighttpd extends HttpConfigBase
|
||||
$webroot_text .= "\t" . '"/" => "' . $redirect_domain . '"' . "\n";
|
||||
$webroot_text .= ' )' . "\n";
|
||||
} else {
|
||||
$webroot_text .= ' server.document-root = "' . makeCorrectDir($domain['documentroot']) . "\"\n";
|
||||
$webroot_text .= ' server.document-root = "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . "\"\n";
|
||||
}
|
||||
$this->_deactivated = false;
|
||||
}
|
||||
@@ -906,34 +906,34 @@ class Lighttpd extends HttpConfigBase
|
||||
if ($domain['speciallogfile'] == '1') {
|
||||
if ($domain['parentdomainid'] == '0') {
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$stats_text .= ' alias.url = ( "/awstats/" => "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url = ( "/awstats/" => "' . \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
|
||||
} else {
|
||||
$stats_text .= ' alias.url = ( "/webalizer/" => "' . makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['domain']) . '/" )' . "\n";
|
||||
$stats_text .= ' alias.url = ( "/webalizer/" => "' . \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['domain']) . '/" )' . "\n";
|
||||
}
|
||||
} else {
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$stats_text .= ' alias.url = ( "/awstats/" => "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['parentdomain']) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url = ( "/awstats/" => "' . \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['parentdomain']) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
|
||||
} else {
|
||||
$stats_text .= ' alias.url = ( "/webalizer/" => "' . makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['parentdomain']) . '/" )' . "\n";
|
||||
$stats_text .= ' alias.url = ( "/webalizer/" => "' . \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/' . $domain['parentdomain']) . '/" )' . "\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($domain['customerroot'] != $domain['documentroot']) {
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$stats_text .= ' alias.url = ( "/awstats/" => "' . makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url = ( "/awstats/" => "' . \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
|
||||
} else {
|
||||
$stats_text .= ' alias.url = ( "/webalizer/" => "' . makeCorrectFile($domain['customerroot'] . '/webalizer/') . '" )' . "\n";
|
||||
$stats_text .= ' alias.url = ( "/webalizer/" => "' . \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/') . '" )' . "\n";
|
||||
}
|
||||
} // if the docroots are equal, we still have to set an alias for awstats
|
||||
// because the stats are in /awstats/[domain], not just /awstats/
|
||||
// also, the awstats-icons are someplace else too!
|
||||
// -> webalizer does not need this!
|
||||
elseif (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$stats_text .= ' alias.url = ( "/awstats/" => "' . makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url = ( "/awstats/" => "' . \Froxlor\FileDir::makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '" )' . "\n";
|
||||
$stats_text .= ' alias.url += ( "/awstats-icon" => "' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '" )' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,8 +969,8 @@ class Lighttpd extends HttpConfigBase
|
||||
fclose($vhosts_file_handler);
|
||||
} else {
|
||||
if (! file_exists(Settings::Get('system.apacheconf_vhost'))) {
|
||||
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'lighttpd::writeConfigs: mkdir ' . escapeshellarg(makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||
safe_exec('mkdir ' . escapeshellarg(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'))));
|
||||
}
|
||||
|
||||
// Write a single file for every vhost
|
||||
@@ -993,10 +993,10 @@ class Lighttpd extends HttpConfigBase
|
||||
if ($htpasswdDir->isConfigDir()) {
|
||||
foreach ($this->needed_htpasswds as $key => $data) {
|
||||
if (! is_dir(Settings::Get('system.apacheconf_htpasswddir'))) {
|
||||
mkdir(makeCorrectDir(Settings::Get('system.apacheconf_htpasswddir')));
|
||||
mkdir(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_htpasswddir')));
|
||||
}
|
||||
|
||||
$filename = makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $key);
|
||||
$filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $key);
|
||||
$htpasswd_handler = fopen($filename, 'w');
|
||||
fwrite($htpasswd_handler, $data);
|
||||
fclose($htpasswd_handler);
|
||||
|
||||
@@ -94,7 +94,7 @@ class LighttpdFcgi extends Lighttpd
|
||||
public function createOwnVhostStarter()
|
||||
{
|
||||
if (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.enabled_ownvhost') == '1') {
|
||||
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown
|
||||
$mypath = \Froxlor\FileDir::makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown
|
||||
|
||||
$user = Settings::Get('phpfpm.vhost_httpuser');
|
||||
$group = Settings::Get('phpfpm.vhost_httpgroup');
|
||||
|
||||
@@ -66,7 +66,7 @@ class Nginx extends HttpConfigBase
|
||||
foreach ($restart_cmds as $restart_cmd) {
|
||||
// check whether the config dir is empty (no domains uses this daemon)
|
||||
// so we need to create a dummy
|
||||
$_conffiles = glob(makeCorrectFile($restart_cmd['config_dir'] . "/*.conf"));
|
||||
$_conffiles = glob(\Froxlor\FileDir::makeCorrectFile($restart_cmd['config_dir'] . "/*.conf"));
|
||||
if ($_conffiles === false || empty($_conffiles)) {
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: fpm config directory "' . $restart_cmd['config_dir'] . '" is empty. Creating dummy.');
|
||||
Fpm::createDummyPool($restart_cmd['config_dir']);
|
||||
@@ -96,12 +96,12 @@ class Nginx extends HttpConfigBase
|
||||
if (Settings::Get('defaultwebsrverrhandler.enabled') == '1' && (Settings::Get('defaultwebsrverrhandler.err401') != '' || Settings::Get('defaultwebsrverrhandler.err403') != '' || Settings::Get('defaultwebsrverrhandler.err404') != '' || Settings::Get('defaultwebsrverrhandler.err500') != '')) {
|
||||
$vhosts_folder = '';
|
||||
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
|
||||
$vhosts_folder = makeCorrectDir(Settings::Get('system.apacheconf_vhost'));
|
||||
$vhosts_folder = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'));
|
||||
} else {
|
||||
$vhosts_folder = makeCorrectDir(dirname(Settings::Get('system.apacheconf_vhost')));
|
||||
$vhosts_folder = \Froxlor\FileDir::makeCorrectDir(dirname(Settings::Get('system.apacheconf_vhost')));
|
||||
}
|
||||
|
||||
$vhosts_filename = makeCorrectFile($vhosts_folder . '/05_froxlor_default_errorhandler.conf');
|
||||
$vhosts_filename = \Froxlor\FileDir::makeCorrectFile($vhosts_folder . '/05_froxlor_default_errorhandler.conf');
|
||||
|
||||
if (! isset($this->nginx_data[$vhosts_filename])) {
|
||||
$this->nginx_data[$vhosts_filename] = '';
|
||||
@@ -117,7 +117,7 @@ class Nginx extends HttpConfigBase
|
||||
if (Settings::Get('defaultwebsrverrhandler.err' . $statusCode) != '') {
|
||||
$defhandler = Settings::Get('defaultwebsrverrhandler.err' . $statusCode);
|
||||
if (! validateUrl($defhandler)) {
|
||||
$defhandler = makeCorrectFile($defhandler);
|
||||
$defhandler = \Froxlor\FileDir::makeCorrectFile($defhandler);
|
||||
}
|
||||
$this->nginx_data[$vhosts_filename] .= 'error_page ' . $statusCode . ' ' . $defhandler . ';' . "\n";
|
||||
}
|
||||
@@ -146,7 +146,7 @@ class Nginx extends HttpConfigBase
|
||||
$port = $row_ipsandports['port'];
|
||||
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::createIpPort: creating ip/port settings for ' . $ip . ":" . $port);
|
||||
$vhost_filename = makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/10_froxlor_ipandport_' . trim(str_replace(':', '.', $row_ipsandports['ip']), '.') . '.' . $row_ipsandports['port'] . '.conf');
|
||||
$vhost_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/10_froxlor_ipandport_' . trim(str_replace(':', '.', $row_ipsandports['ip']), '.') . '.' . $row_ipsandports['port'] . '.conf');
|
||||
|
||||
if (! isset($this->nginx_data[$vhost_filename])) {
|
||||
$this->nginx_data[$vhost_filename] = '';
|
||||
@@ -339,7 +339,7 @@ class Nginx extends HttpConfigBase
|
||||
foreach ($domains as $domain) {
|
||||
|
||||
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg(makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||
safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||
}
|
||||
|
||||
$vhost_filename = $this->getVhostFilename($domain);
|
||||
@@ -377,9 +377,9 @@ class Nginx extends HttpConfigBase
|
||||
}
|
||||
|
||||
if ($ssl_vhost === true) {
|
||||
$vhost_filename = makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/' . $vhost_no . '_froxlor_ssl_vhost_' . $domain['domain'] . '.conf');
|
||||
$vhost_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/' . $vhost_no . '_froxlor_ssl_vhost_' . $domain['domain'] . '.conf');
|
||||
} else {
|
||||
$vhost_filename = makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/' . $vhost_no . '_froxlor_normal_vhost_' . $domain['domain'] . '.conf');
|
||||
$vhost_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/' . $vhost_no . '_froxlor_normal_vhost_' . $domain['domain'] . '.conf');
|
||||
}
|
||||
|
||||
return $vhost_filename;
|
||||
@@ -645,7 +645,7 @@ class Nginx extends HttpConfigBase
|
||||
$sslsettings .= "\t" . 'ssl_protocols ' . str_replace(",", " ", Settings::Get('system.ssl_protocols')) . ';' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_ciphers ' . Settings::Get('system.ssl_cipher_list') . ';' . "\n";
|
||||
if (! empty(Settings::Get('system.dhparams_file'))) {
|
||||
$dhparams = makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||
$dhparams = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.dhparams_file'));
|
||||
if (! file_exists($dhparams)) {
|
||||
safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096');
|
||||
}
|
||||
@@ -653,14 +653,14 @@ class Nginx extends HttpConfigBase
|
||||
}
|
||||
$sslsettings .= "\t" . 'ssl_ecdh_curve secp384r1;' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_prefer_server_ciphers on;' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_certificate ' . makeCorrectFile($domain_or_ip['ssl_cert_file']) . ';' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_certificate ' . \Froxlor\FileDir::makeCorrectFile($domain_or_ip['ssl_cert_file']) . ';' . "\n";
|
||||
|
||||
if ($domain_or_ip['ssl_key_file'] != '') {
|
||||
// check for existence, #1485
|
||||
if (! file_exists($domain_or_ip['ssl_key_file'])) {
|
||||
$this->logger->logAction(CRON_ACTION, LOG_ERR, $domain_or_ip['domain'] . ' :: certificate key file "' . $domain_or_ip['ssl_key_file'] . '" does not exist! Cannot create ssl-directives');
|
||||
} else {
|
||||
$sslsettings .= "\t" . 'ssl_certificate_key ' . makeCorrectFile($domain_or_ip['ssl_key_file']) . ';' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_certificate_key ' . \Froxlor\FileDir::makeCorrectFile($domain_or_ip['ssl_key_file']) . ';' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ class Nginx extends HttpConfigBase
|
||||
if ((isset($domain_or_ip['ocsp_stapling']) && $domain_or_ip['ocsp_stapling'] == "1") || (isset($domain_or_ip['letsencrypt']) && $domain_or_ip['letsencrypt'] == "1")) {
|
||||
$sslsettings .= "\t" . 'ssl_stapling on;' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_stapling_verify on;' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_trusted_certificate ' . makeCorrectFile($domain_or_ip['ssl_cert_file']) . ';' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_trusted_certificate ' . \Froxlor\FileDir::makeCorrectFile($domain_or_ip['ssl_cert_file']) . ';' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -704,7 +704,7 @@ class Nginx extends HttpConfigBase
|
||||
if (! empty($row['error404path'])) {
|
||||
$defhandler = $row['error404path'];
|
||||
if (! validateUrl($defhandler)) {
|
||||
$defhandler = makeCorrectFile($defhandler);
|
||||
$defhandler = \Froxlor\FileDir::makeCorrectFile($defhandler);
|
||||
}
|
||||
$path_options .= "\t" . 'error_page 404 ' . $defhandler . ';' . "\n";
|
||||
}
|
||||
@@ -712,7 +712,7 @@ class Nginx extends HttpConfigBase
|
||||
if (! empty($row['error403path'])) {
|
||||
$defhandler = $row['error403path'];
|
||||
if (! validateUrl($defhandler)) {
|
||||
$defhandler = makeCorrectFile($defhandler);
|
||||
$defhandler = \Froxlor\FileDir::makeCorrectFile($defhandler);
|
||||
}
|
||||
$path_options .= "\t" . 'error_page 403 ' . $defhandler . ';' . "\n";
|
||||
}
|
||||
@@ -720,13 +720,13 @@ class Nginx extends HttpConfigBase
|
||||
if (! empty($row['error500path'])) {
|
||||
$defhandler = $row['error500path'];
|
||||
if (! validateUrl($defhandler)) {
|
||||
$defhandler = makeCorrectFile($defhandler);
|
||||
$defhandler = \Froxlor\FileDir::makeCorrectFile($defhandler);
|
||||
}
|
||||
$path_options .= "\t" . 'error_page 500 502 503 504 ' . $defhandler . ';' . "\n";
|
||||
}
|
||||
|
||||
// if ($row['options_indexes'] != '0') {
|
||||
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
$path = \Froxlor\FileDir::makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
|
||||
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
|
||||
|
||||
@@ -754,7 +754,7 @@ class Nginx extends HttpConfigBase
|
||||
default:
|
||||
if ($single['path'] == '/') {
|
||||
$path_options .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
|
||||
$path_options .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||
$path_options .= "\t\t" . 'auth_basic_user_file ' . \Froxlor\FileDir::makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
|
||||
$path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n";
|
||||
} else {
|
||||
@@ -787,7 +787,7 @@ class Nginx extends HttpConfigBase
|
||||
* required the fastCGI wrapper to be running to receive the CGI requests.
|
||||
*/
|
||||
if (customerHasPerlEnabled($domain['customerid']) && $row['options_cgi'] != '0') {
|
||||
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
$path = \Froxlor\FileDir::makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
|
||||
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
|
||||
|
||||
// We need to remove the last slash, otherwise the regex wouldn't work
|
||||
@@ -814,9 +814,9 @@ class Nginx extends HttpConfigBase
|
||||
unset($htpasswds[$idx]);
|
||||
break;
|
||||
default:
|
||||
$path_options .= "\t" . 'location ' . makeCorrectDir($single['path']) . ' {' . "\n";
|
||||
$path_options .= "\t" . 'location ' . \Froxlor\FileDir::makeCorrectDir($single['path']) . ' {' . "\n";
|
||||
$path_options .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
|
||||
$path_options .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||
$path_options .= "\t\t" . 'auth_basic_user_file ' . \Froxlor\FileDir::makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
|
||||
$path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n";
|
||||
} else {
|
||||
@@ -852,7 +852,7 @@ class Nginx extends HttpConfigBase
|
||||
$x = 0;
|
||||
while ($row_htpasswds = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if (count($row_htpasswds) > 0) {
|
||||
$htpasswd_filename = makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $row_htpasswds['customerid'] . '-' . md5($row_htpasswds['path']) . '.htpasswd');
|
||||
$htpasswd_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.apacheconf_htpasswddir') . '/' . $row_htpasswds['customerid'] . '-' . md5($row_htpasswds['path']) . '.htpasswd');
|
||||
|
||||
// ensure we can write to the array with index $htpasswd_filename
|
||||
if (! isset($this->htpasswds_data[$htpasswd_filename])) {
|
||||
@@ -865,15 +865,15 @@ class Nginx extends HttpConfigBase
|
||||
// the nginx user, we have to evaluate the right path which is to protect
|
||||
if (stripos($row_htpasswds['path'], $domain['documentroot']) !== false) {
|
||||
// if the website contents is located in the user directory
|
||||
$path = makeCorrectDir(substr($row_htpasswds['path'], strlen($domain['documentroot']) - 1));
|
||||
$path = \Froxlor\FileDir::makeCorrectDir(substr($row_htpasswds['path'], strlen($domain['documentroot']) - 1));
|
||||
} else {
|
||||
// if the website contents is located in a subdirectory of the user
|
||||
preg_match('/^([\/[:print:]]*\/)([[:print:]\/]+){1}$/i', $row_htpasswds['path'], $matches);
|
||||
$path = makeCorrectDir(substr($row_htpasswds['path'], strlen($matches[1]) - 1));
|
||||
$path = \Froxlor\FileDir::makeCorrectDir(substr($row_htpasswds['path'], strlen($matches[1]) - 1));
|
||||
}
|
||||
|
||||
$returnval[$x]['path'] = $path;
|
||||
$returnval[$x]['root'] = makeCorrectDir($domain['documentroot']);
|
||||
$returnval[$x]['root'] = \Froxlor\FileDir::makeCorrectDir($domain['documentroot']);
|
||||
|
||||
// Ensure there is only one auth name per password block, otherwise
|
||||
// the directives are inserted multiple times -> invalid config
|
||||
@@ -927,10 +927,10 @@ class Nginx extends HttpConfigBase
|
||||
|
||||
if ($domain['deactivated'] == '1' && Settings::Get('system.deactivateddocroot') != '') {
|
||||
$webroot_text .= "\t" . '# Using docroot for deactivated users...' . "\n";
|
||||
$webroot_text .= "\t" . 'root ' . makeCorrectDir(Settings::Get('system.deactivateddocroot')) . ';' . "\n";
|
||||
$webroot_text .= "\t" . 'root ' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.deactivateddocroot')) . ';' . "\n";
|
||||
$this->_deactivated = true;
|
||||
} else {
|
||||
$webroot_text .= "\t" . 'root ' . makeCorrectDir($domain['documentroot']) . ';' . "\n";
|
||||
$webroot_text .= "\t" . 'root ' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . ';' . "\n";
|
||||
$this->_deactivated = false;
|
||||
}
|
||||
|
||||
@@ -966,16 +966,16 @@ class Nginx extends HttpConfigBase
|
||||
|
||||
// define basic path to the stats
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$alias_dir = makeCorrectFile($domain['customerroot'] . '/awstats/');
|
||||
$alias_dir = \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/');
|
||||
} else {
|
||||
$alias_dir = makeCorrectFile($domain['customerroot'] . '/webalizer/');
|
||||
$alias_dir = \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/webalizer/');
|
||||
}
|
||||
|
||||
// if this is a parentdomain, we use this domain-name
|
||||
if ($domain['parentdomainid'] == '0') {
|
||||
$alias_dir = makeCorrectDir($alias_dir . '/' . $domain['domain']);
|
||||
$alias_dir = \Froxlor\FileDir::makeCorrectDir($alias_dir . '/' . $domain['domain']);
|
||||
} else {
|
||||
$alias_dir = makeCorrectDir($alias_dir . '/' . $domain['parentdomain']);
|
||||
$alias_dir = \Froxlor\FileDir::makeCorrectDir($alias_dir . '/' . $domain['parentdomain']);
|
||||
}
|
||||
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
@@ -988,13 +988,13 @@ class Nginx extends HttpConfigBase
|
||||
|
||||
$stats_text .= "\t\t" . 'alias ' . $alias_dir . ';' . "\n";
|
||||
$stats_text .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
|
||||
$stats_text .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||
$stats_text .= "\t\t" . 'auth_basic_user_file ' . \Froxlor\FileDir::makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||
$stats_text .= "\t" . '}' . "\n\n";
|
||||
|
||||
// awstats icons
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$stats_text .= "\t" . 'location ~ ^/awstats-icon/(.*)$ {' . "\n";
|
||||
$stats_text .= "\t\t" . 'alias ' . makeCorrectDir(Settings::Get('system.awstats_icons')) . '$1;' . "\n";
|
||||
$stats_text .= "\t\t" . 'alias ' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_icons')) . '$1;' . "\n";
|
||||
$stats_text .= "\t" . '}' . "\n\n";
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ class Nginx extends HttpConfigBase
|
||||
|
||||
if ($domain['writeerrorlog']) {
|
||||
// The normal access/error - logging is enabled
|
||||
$error_log = makeCorrectFile(Settings::Get('system.logfiles_directory') . $domain['loginname'] . $speciallogfile . '-error.log');
|
||||
$error_log = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.logfiles_directory') . $domain['loginname'] . $speciallogfile . '-error.log');
|
||||
// Create the logfile if it does not exist (fixes #46)
|
||||
touch($error_log);
|
||||
chown($error_log, Settings::Get('system.httpuser'));
|
||||
@@ -1026,7 +1026,7 @@ class Nginx extends HttpConfigBase
|
||||
}
|
||||
|
||||
if ($domain['writeaccesslog']) {
|
||||
$access_log = makeCorrectFile(Settings::Get('system.logfiles_directory') . $domain['loginname'] . $speciallogfile . '-access.log');
|
||||
$access_log = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.logfiles_directory') . $domain['loginname'] . $speciallogfile . '-access.log');
|
||||
// Create the logfile if it does not exist (fixes #46)
|
||||
touch($access_log);
|
||||
chown($access_log, Settings::Get('system.httpuser'));
|
||||
@@ -1158,8 +1158,8 @@ class Nginx extends HttpConfigBase
|
||||
fclose($vhosts_file_handler);
|
||||
} else {
|
||||
if (! file_exists(Settings::Get('system.apacheconf_vhost'))) {
|
||||
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'nginx::writeConfigs: mkdir ' . escapeshellarg(makeCorrectDir(Settings::Get('system.apacheconf_vhost'))));
|
||||
safe_exec('mkdir -p ' . escapeshellarg(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'))));
|
||||
}
|
||||
|
||||
// Write a single file for every vhost
|
||||
|
||||
@@ -63,7 +63,7 @@ class NginxFcgi extends Nginx
|
||||
public function createOwnVhostStarter()
|
||||
{
|
||||
if (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.enabled_ownvhost') == '1') {
|
||||
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown
|
||||
$mypath = \Froxlor\FileDir::makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown
|
||||
|
||||
$user = Settings::Get('phpfpm.vhost_httpuser');
|
||||
$group = Settings::Get('phpfpm.vhost_httpgroup');
|
||||
|
||||
@@ -158,8 +158,8 @@ class Fcgid
|
||||
'OPEN_BASEDIR' => $openbasedir,
|
||||
'OPEN_BASEDIR_C' => $openbasedirc,
|
||||
'OPEN_BASEDIR_GLOBAL' => Settings::Get('system.phpappendopenbasedir'),
|
||||
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot']),
|
||||
'CUSTOMER_HOMEDIR' => makeCorrectDir($this->_domain['customerroot'])
|
||||
'DOCUMENT_ROOT' => \Froxlor\FileDir::makeCorrectDir($this->_domain['documentroot']),
|
||||
'CUSTOMER_HOMEDIR' => \Froxlor\FileDir::makeCorrectDir($this->_domain['customerroot'])
|
||||
);
|
||||
|
||||
// insert a small header for the file
|
||||
@@ -187,7 +187,7 @@ class Fcgid
|
||||
*/
|
||||
public function getConfigDir($createifnotexists = true)
|
||||
{
|
||||
$configdir = 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) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
@@ -207,7 +207,7 @@ class Fcgid
|
||||
*/
|
||||
public function getTempDir($createifnotexists = true)
|
||||
{
|
||||
$tmpdir = 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) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
@@ -225,7 +225,7 @@ class Fcgid
|
||||
*/
|
||||
public function getStarterFile()
|
||||
{
|
||||
$starter_filename = makeCorrectFile($this->getConfigDir() . '/php-fcgi-starter');
|
||||
$starter_filename = \Froxlor\FileDir::makeCorrectFile($this->getConfigDir() . '/php-fcgi-starter');
|
||||
return $starter_filename;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ class Fcgid
|
||||
*/
|
||||
public function getIniFile()
|
||||
{
|
||||
$phpini_filename = makeCorrectFile($this->getConfigDir() . '/php.ini');
|
||||
$phpini_filename = \Froxlor\FileDir::makeCorrectFile($this->getConfigDir() . '/php.ini');
|
||||
return $phpini_filename;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,15 +172,15 @@ class Fpm
|
||||
if ($phpconfig['fpm_slowlog'] == '1') {
|
||||
$fpm_config .= 'request_terminate_timeout = ' . $phpconfig['fpm_reqterm'] . "\n";
|
||||
$fpm_config .= 'request_slowlog_timeout = ' . $phpconfig['fpm_reqslow'] . "\n";
|
||||
$slowlog = makeCorrectFile(Settings::Get('system.logfiles_directory') . '/' . $this->_domain['loginname'] . '-php-slow.log');
|
||||
$slowlog = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.logfiles_directory') . '/' . $this->_domain['loginname'] . '-php-slow.log');
|
||||
$fpm_config .= 'slowlog = ' . $slowlog . "\n";
|
||||
$fpm_config .= 'catch_workers_output = yes' . "\n";
|
||||
}
|
||||
|
||||
$fpm_config .= ';chroot = ' . makeCorrectDir($this->_domain['documentroot']) . "\n";
|
||||
$fpm_config .= ';chroot = ' . \Froxlor\FileDir::makeCorrectDir($this->_domain['documentroot']) . "\n";
|
||||
$fpm_config .= 'security.limit_extensions = ' . $fpm_limit_extensions . "\n";
|
||||
|
||||
$tmpdir = makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||
$tmpdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||
if (! is_dir($tmpdir)) {
|
||||
$this->getTempDir();
|
||||
}
|
||||
@@ -217,8 +217,8 @@ class Fpm
|
||||
$openbasedir .= $_phpappendopenbasedir;
|
||||
}
|
||||
}
|
||||
$fpm_config .= 'php_admin_value[session.save_path] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
$fpm_config .= 'php_admin_value[upload_tmp_dir] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
$fpm_config .= 'php_admin_value[session.save_path] = ' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
$fpm_config .= 'php_admin_value[upload_tmp_dir] = ' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
|
||||
$admin = $this->_getAdminData($this->_domain['adminid']);
|
||||
$php_ini_variables = array(
|
||||
@@ -233,8 +233,8 @@ class Fpm
|
||||
'OPEN_BASEDIR' => $openbasedir,
|
||||
'OPEN_BASEDIR_C' => '',
|
||||
'OPEN_BASEDIR_GLOBAL' => Settings::Get('system.phpappendopenbasedir'),
|
||||
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot']),
|
||||
'CUSTOMER_HOMEDIR' => makeCorrectDir($this->_domain['customerroot'])
|
||||
'DOCUMENT_ROOT' => \Froxlor\FileDir::makeCorrectDir($this->_domain['documentroot']),
|
||||
'CUSTOMER_HOMEDIR' => \Froxlor\FileDir::makeCorrectDir($this->_domain['customerroot'])
|
||||
);
|
||||
|
||||
$phpini = replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
@@ -287,7 +287,7 @@ class Fpm
|
||||
public function getConfigFile($createifnotexists = true)
|
||||
{
|
||||
$configdir = $this->_fpm_cfg['config_dir'];
|
||||
$config = makeCorrectFile($configdir . '/' . $this->_domain['domain'] . '.conf');
|
||||
$config = \Froxlor\FileDir::makeCorrectFile($configdir . '/' . $this->_domain['domain'] . '.conf');
|
||||
|
||||
if (! is_dir($configdir) && $createifnotexists) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
@@ -306,9 +306,9 @@ class Fpm
|
||||
*/
|
||||
public function getSocketFile($createifnotexists = true)
|
||||
{
|
||||
$socketdir = makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir'));
|
||||
$socketdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir'));
|
||||
// add fpm-config-id to filename so it's unique for the fpm-daemon and doesn't interfere with running configs when reuilding
|
||||
$socket = strtolower(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) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($socketdir));
|
||||
@@ -328,7 +328,7 @@ class Fpm
|
||||
*/
|
||||
public function getTempDir($createifnotexists = true)
|
||||
{
|
||||
$tmpdir = makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||
$tmpdir = \Froxlor\FileDir::makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||
|
||||
if (! is_dir($tmpdir) && $createifnotexists) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
@@ -355,7 +355,7 @@ class Fpm
|
||||
Settings::Set('phpfpm.aliasconfigdir', '/var/www/php-fpm');
|
||||
}
|
||||
|
||||
$configdir = 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) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||
@@ -375,7 +375,7 @@ class Fpm
|
||||
if (! is_dir($configdir)) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
}
|
||||
$config = makeCorrectFile($configdir . '/dummy.conf');
|
||||
$config = \Froxlor\FileDir::makeCorrectFile($configdir . '/dummy.conf');
|
||||
$dummy = "[dummy]
|
||||
user = " . Settings::Get('system.httpuser') . "
|
||||
listen = /run/" . md5($configdir) . "-fpm.sock
|
||||
|
||||
@@ -29,7 +29,7 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron
|
||||
{
|
||||
// Check Traffic-Lock
|
||||
if (function_exists('pcntl_fork')) {
|
||||
$BackupLock = makeCorrectFile(dirname(self::getLockfile()) . "/froxlor_cron_backup.lock");
|
||||
$BackupLock = \Froxlor\FileDir::makeCorrectFile(dirname(self::getLockfile()) . "/froxlor_cron_backup.lock");
|
||||
if (file_exists($BackupLock) && is_numeric($BackupPid = file_get_contents($BackupLock))) {
|
||||
if (function_exists('posix_kill')) {
|
||||
$BackupPidStatus = @posix_kill($BackupPid, 0);
|
||||
@@ -87,8 +87,8 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron
|
||||
if (is_array($row['data'])) {
|
||||
|
||||
if (isset($row['data']['customerid']) && isset($row['data']['loginname']) && isset($row['data']['destdir'])) {
|
||||
$row['data']['destdir'] = makeCorrectDir($row['data']['destdir']);
|
||||
$customerdocroot = makeCorrectDir(Settings::Get('system.documentroot_prefix') . '/' . $row['data']['loginname'] . '/');
|
||||
$row['data']['destdir'] = \Froxlor\FileDir::makeCorrectDir($row['data']['destdir']);
|
||||
$customerdocroot = \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.documentroot_prefix') . '/' . $row['data']['loginname'] . '/');
|
||||
|
||||
// create folder if not exists
|
||||
if (! file_exists($row['data']['destdir']) && $row['data']['destdir'] != '/' && $row['data']['destdir'] != Settings::Get('system.documentroot_prefix') && $row['data']['destdir'] != $customerdocroot) {
|
||||
@@ -125,7 +125,7 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron
|
||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'Creating Backup for user "' . $data['loginname'] . '"');
|
||||
|
||||
// create tmp folder
|
||||
$tmpdir = makeCorrectDir($data['destdir'] . '/.tmp/');
|
||||
$tmpdir = \Froxlor\FileDir::makeCorrectDir($data['destdir'] . '/.tmp/');
|
||||
$cronlog->logAction(CRON_ACTION, LOG_DEBUG, 'Creating tmp-folder "' . $tmpdir . '"');
|
||||
$cronlog->logAction(CRON_ACTION, LOG_DEBUG, 'shell> mkdir -p ' . escapeshellarg($tmpdir));
|
||||
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
@@ -135,8 +135,8 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron
|
||||
if ($data['backup_dbs'] == 1) {
|
||||
|
||||
$cronlog->logAction(CRON_ACTION, LOG_DEBUG, 'Creating mysql-folder "' . \Froxlor\FileDir::makeCorrectDir($tmpdir . '/mysql') . '"');
|
||||
$cronlog->logAction(CRON_ACTION, LOG_DEBUG, 'shell> mkdir -p ' . escapeshellarg(makeCorrectDir($tmpdir . '/mysql')));
|
||||
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(makeCorrectDir($tmpdir . '/mysql')));
|
||||
$cronlog->logAction(CRON_ACTION, LOG_DEBUG, 'shell> mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir($tmpdir . '/mysql')));
|
||||
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir($tmpdir . '/mysql')));
|
||||
|
||||
// get all customer database-names
|
||||
$sel_stmt = Database::prepare("SELECT `databasename` FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid` = :cid");
|
||||
|
||||
@@ -35,7 +35,7 @@ class MailboxsizeCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
while ($maildir = $maildirs_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
|
||||
$_maildir = makeCorrectDir($maildir['maildirpath']);
|
||||
$_maildir = \Froxlor\FileDir::makeCorrectDir($maildir['maildirpath']);
|
||||
|
||||
if (file_exists($_maildir) && is_dir($_maildir)) {
|
||||
// mail-address allows many special characters, see http://en.wikipedia.org/wiki/Email_address#Local_part
|
||||
|
||||
@@ -112,9 +112,9 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
}
|
||||
|
||||
// include english language file (fallback)
|
||||
include_once makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||
// include admin/customer language file
|
||||
include_once makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||
|
||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||
$result2_stmt = Database::prepare("
|
||||
@@ -214,9 +214,9 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
}
|
||||
|
||||
// include english language file (fallback)
|
||||
include_once makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||
// include admin/customer language file
|
||||
include_once makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||
|
||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||
$result2_stmt = Database::prepare("
|
||||
|
||||
@@ -28,7 +28,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
// Check Traffic-Lock
|
||||
if (function_exists('pcntl_fork') && ! defined('CRON_NOFORK_FLAG')) {
|
||||
$TrafficLock = makeCorrectFile(dirname($lockfile) . "/froxlor_cron_traffic.lock");
|
||||
$TrafficLock = \Froxlor\FileDir::makeCorrectFile(dirname($lockfile) . "/froxlor_cron_traffic.lock");
|
||||
if (file_exists($TrafficLock) && is_numeric($TrafficPid = file_get_contents($TrafficLock))) {
|
||||
if (function_exists('posix_kill')) {
|
||||
$TrafficPidStatus = @posix_kill($TrafficPid, 0);
|
||||
@@ -69,7 +69,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, $msg . " Not forking traffic-cron, this may take a long time!");
|
||||
}
|
||||
|
||||
require_once makeCorrectFile(dirname(__FILE__) . '/TrafficCron.inc.functions.php');
|
||||
require_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/TrafficCron.inc.functions.php');
|
||||
|
||||
/**
|
||||
* TRAFFIC AND DISKUSAGE MESSURE
|
||||
@@ -83,7 +83,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `aliasdomain` IS NULL AND `email_only` <> '1';
|
||||
");
|
||||
|
||||
while ($row_domainlist = $result_domainlist_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($row_domainlist = $result_domainlist_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
|
||||
if (! isset($domainlist[$row_domainlist['customerid']])) {
|
||||
$domainlist[$row_domainlist['customerid']] = array();
|
||||
@@ -106,11 +106,11 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
$databases_list = array();
|
||||
Database::needRoot(true);
|
||||
$databases_list_result_stmt = Database::query("SHOW DATABASES");
|
||||
while ($databases_list_row = $databases_list_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($databases_list_row = $databases_list_result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$databases_list[] = strtolower($databases_list_row['Database']);
|
||||
}
|
||||
|
||||
while ($row_database = $databases_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($row_database = $databases_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
|
||||
if ($last_dbserver != $row_database['dbserver']) {
|
||||
Database::needRoot(true, $row_database['dbserver']);
|
||||
@@ -118,7 +118,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
$databases_list = array();
|
||||
$databases_list_result_stmt = Database::query("SHOW DATABASES");
|
||||
while ($databases_list_row = $databases_list_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($databases_list_row = $databases_list_result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$databases_list[] = strtolower($databases_list_row['Database']);
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` ORDER BY `customerid` ASC");
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
/**
|
||||
* HTTP-Traffic
|
||||
*/
|
||||
@@ -255,7 +255,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
Database::pexecute($domains_stmt, array(
|
||||
"cid" => $row['customerid']
|
||||
));
|
||||
while ($domainRow = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($domainRow = $domains_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$domainMailTraffic = $mailTrafficCalc->getDomainTraffic($domainRow["domain"]);
|
||||
if (! is_array($domainMailTraffic)) {
|
||||
continue;
|
||||
@@ -282,7 +282,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$updRow = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$updRow = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_TRAFFIC . "` SET
|
||||
`mail` = :mail
|
||||
WHERE `id` = :id");
|
||||
@@ -391,7 +391,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'calculating mailspace usage for ' . $row['loginname']);
|
||||
$emailusage = 0;
|
||||
|
||||
$maildir = 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)) {
|
||||
$back = safe_exec('du -sk ' . escapeshellarg($maildir) . '');
|
||||
foreach ($back as $backrow) {
|
||||
@@ -509,7 +509,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
$group = $row['guid'];
|
||||
}
|
||||
|
||||
while ($row_quota = $result_quota_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($row_quota = $result_quota_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$quotafile = "" . $row_quota['homedir'] . ".ftpquota";
|
||||
$fh = fopen($quotafile, 'w');
|
||||
$stringdata = "0 " . $current_diskspace['all'] * 1024 . "";
|
||||
@@ -525,7 +525,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
*/
|
||||
$result_stmt = Database::query("SELECT `adminid` FROM `" . TABLE_PANEL_ADMINS . "` ORDER BY `adminid` ASC");
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
|
||||
if (isset($admin_traffic[$row['adminid']])) {
|
||||
|
||||
@@ -615,20 +615,20 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
{
|
||||
$returnval = 0;
|
||||
|
||||
$domainconfig = makeCorrectFile(Settings::Get('system.awstats_conf') . '/awstats.' . $domain . '.conf');
|
||||
$domainconfig = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_conf') . '/awstats.' . $domain . '.conf');
|
||||
|
||||
if (file_exists($domainconfig)) {
|
||||
|
||||
$outputdir = makeCorrectDir($outputdir . '/' . $domain);
|
||||
$staticOutputdir = makeCorrectDir($outputdir . '/' . date('Y') . '-' . date('m'));
|
||||
$outputdir = \Froxlor\FileDir::makeCorrectDir($outputdir . '/' . $domain);
|
||||
$staticOutputdir = \Froxlor\FileDir::makeCorrectDir($outputdir . '/' . date('Y') . '-' . date('m'));
|
||||
|
||||
if (! is_dir($staticOutputdir)) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($staticOutputdir));
|
||||
}
|
||||
|
||||
// check for correct path of awstats_buildstaticpages.pl
|
||||
$awbsp = makeCorrectFile(Settings::Get('system.awstats_path') . '/awstats_buildstaticpages.pl');
|
||||
$awprog = makeCorrectFile(Settings::Get('system.awstats_awstatspath') . '/awstats.pl');
|
||||
$awbsp = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_path') . '/awstats_buildstaticpages.pl');
|
||||
$awprog = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_awstatspath') . '/awstats.pl');
|
||||
|
||||
if (! file_exists($awbsp)) {
|
||||
echo "WANRING: Necessary awstats_buildstaticpages.pl script could not be found, no traffic is being calculated and no stats are generated. Please check your AWStats-Path setting";
|
||||
@@ -644,11 +644,11 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
// the default selection is 'current',
|
||||
// so link the latest dir to it
|
||||
$new_current = makeCorrectFile($outputdir . '/current');
|
||||
$new_current = \Froxlor\FileDir::makeCorrectFile($outputdir . '/current');
|
||||
safe_exec('ln -fTs ' . escapeshellarg($staticOutputdir) . ' ' . escapeshellarg($new_current));
|
||||
|
||||
// statistics file looks like: 'awstats[month][year].[domain].txt'
|
||||
$file = makeCorrectFile($outputdir . '/awstats' . date('mY', time()) . '.' . $domain . '.txt');
|
||||
$file = \Froxlor\FileDir::makeCorrectFile($outputdir . '/awstats' . date('mY', time()) . '.' . $domain . '.txt');
|
||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Gathering traffic information from '" . $file . "'");
|
||||
|
||||
if (file_exists($file)) {
|
||||
@@ -694,7 +694,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
// Looking for {year}-{month} directories
|
||||
$entries = array();
|
||||
foreach (scandir($outputdir) as $a) {
|
||||
if (is_dir(makeCorrectDir($outputdir . '/' . $a)) && preg_match('/^[0-9]{4}-[0-9]{2}$/', $a)) {
|
||||
if (is_dir(\Froxlor\FileDir::makeCorrectDir($outputdir . '/' . $a)) && preg_match('/^[0-9]{4}-[0-9]{2}$/', $a)) {
|
||||
array_push($entries, '<option value="' . $a . '">' . $a . '</option>');
|
||||
}
|
||||
}
|
||||
@@ -712,16 +712,16 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
// File names
|
||||
$index_file = \Froxlor\Froxlor::getInstallDir() . '/templates/misc/awstats/index.html';
|
||||
$index_file = makeCorrectFile($index_file);
|
||||
$index_file = \Froxlor\FileDir::makeCorrectFile($index_file);
|
||||
$nav_file = \Froxlor\Froxlor::getInstallDir() . '/templates/misc/awstats/nav.html';
|
||||
$nav_file = makeCorrectFile($nav_file);
|
||||
$nav_file = \Froxlor\FileDir::makeCorrectFile($nav_file);
|
||||
|
||||
// Write the index file
|
||||
{
|
||||
// 'index.html' used to be a symlink (ignore errors in case this is the first run and no index.html exists yet)
|
||||
@unlink(makeCorrectFile($outputdir . '/' . 'index.html'));
|
||||
@unlink(\Froxlor\FileDir::makeCorrectFile($outputdir . '/' . 'index.html'));
|
||||
|
||||
$awstats_index_file = fopen(makeCorrectFile($outputdir . '/' . 'index.html'), 'w');
|
||||
$awstats_index_file = fopen(\Froxlor\FileDir::makeCorrectFile($outputdir . '/' . 'index.html'), 'w');
|
||||
$awstats_index_tpl = fopen($index_file, 'r');
|
||||
|
||||
// Write the header
|
||||
@@ -739,7 +739,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
// Write the nav file
|
||||
{
|
||||
$awstats_nav_file = fopen(makeCorrectFile($outputdir . '/' . 'nav.html'), 'w');
|
||||
$awstats_nav_file = fopen(\Froxlor\FileDir::makeCorrectFile($outputdir . '/' . 'nav.html'), 'w');
|
||||
$awstats_nav_tpl = fopen($nav_file, 'r');
|
||||
|
||||
// Write the header
|
||||
@@ -823,7 +823,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
$returnval = 0;
|
||||
|
||||
$logfile = makeCorrectFile(Settings::Get('system.logfiles_directory') . $logfile . '-access.log');
|
||||
$logfile = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.logfiles_directory') . $logfile . '-access.log');
|
||||
if (file_exists($logfile)) {
|
||||
$domainargs = '';
|
||||
foreach ($usersdomainlist as $domainid => $domain) {
|
||||
@@ -831,7 +831,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
||||
$domainargs .= ' -r ' . escapeshellarg($domain);
|
||||
}
|
||||
|
||||
$outputdir = makeCorrectDir($outputdir);
|
||||
$outputdir = \Froxlor\FileDir::makeCorrectDir($outputdir);
|
||||
if (! file_exists($outputdir)) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($outputdir));
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ if ((int)Settings::Get('system.report_webmax') > 0)
|
||||
}
|
||||
|
||||
// include english language file (fallback)
|
||||
include_once makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||
// include admin/customer language file
|
||||
include_once makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||
|
||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||
$result2_stmt = Database::prepare("
|
||||
@@ -158,9 +158,9 @@ if ((int)Settings::Get('system.report_webmax') > 0)
|
||||
}
|
||||
|
||||
// include english language file (fallback)
|
||||
include_once makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||
// include admin/customer language file
|
||||
include_once makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||
|
||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||
$result2_stmt = Database::prepare("
|
||||
|
||||
Reference in New Issue
Block a user