Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc8ca57f8c | ||
|
|
7e4bba2d55 | ||
|
|
7e635f9be4 | ||
|
|
e9406a20f2 | ||
|
|
de7729cec8 | ||
|
|
d60e48849b | ||
|
|
908df5a7bb | ||
|
|
c1952afb94 | ||
|
|
7a22e8f4dd | ||
|
|
3ac0da2cdd | ||
|
|
eb816c4cc6 | ||
|
|
64d8bf4fba | ||
|
|
ae6ee95973 | ||
|
|
e9051dc30a | ||
|
|
b6c7c53c3a | ||
|
|
f36bc61fc7 | ||
|
|
c56e0b9dac | ||
|
|
1deb08bf75 | ||
|
|
b30d7a8252 | ||
|
|
b03e11c18d | ||
|
|
bf7d22a794 | ||
|
|
fb57a8a3b5 | ||
|
|
0d625797b0 | ||
|
|
6777fbf229 | ||
|
|
23f1f79eff | ||
|
|
a5af104d53 |
@@ -53,7 +53,7 @@ return [
|
|||||||
'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i',
|
'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingClearCertificates',
|
||||||
'advanced_mode' => true
|
'advanced_mode' => true
|
||||||
],
|
],
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"ext-fileinfo": "*",
|
"ext-fileinfo": "*",
|
||||||
"ext-gmp": "*",
|
"ext-gmp": "*",
|
||||||
|
"ext-gd": "*",
|
||||||
"phpmailer/phpmailer": "~6.0",
|
"phpmailer/phpmailer": "~6.0",
|
||||||
"monolog/monolog": "^1.24",
|
"monolog/monolog": "^1.24",
|
||||||
"robthree/twofactorauth": "^1.6",
|
"robthree/twofactorauth": "^1.6",
|
||||||
|
|||||||
759
composer.lock
generated
759
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -71,7 +71,7 @@ if ($page == 'overview' || $page == 'emails') {
|
|||||||
'listing' => Listing::format($collection, $emaildomain_list_data, 'emaildomain_list'),
|
'listing' => Listing::format($collection, $emaildomain_list_data, 'emaildomain_list'),
|
||||||
'actions_links' => CurrentUser::canAddResource('emails') ? [
|
'actions_links' => CurrentUser::canAddResource('emails') ? [
|
||||||
[
|
[
|
||||||
'href' => $linker->getLink(['section' => 'email', 'page' => $page, 'action' => 'add']),
|
'href' => $linker->getLink(['section' => 'email', 'page' => 'email_domain', 'action' => 'add']),
|
||||||
'label' => lng('emails.emails_add')
|
'label' => lng('emails.emails_add')
|
||||||
]
|
]
|
||||||
] : null,
|
] : null,
|
||||||
@@ -123,7 +123,7 @@ if ($page == 'email_domain') {
|
|||||||
}
|
}
|
||||||
if (CurrentUser::canAddResource('emails')) {
|
if (CurrentUser::canAddResource('emails')) {
|
||||||
$actions_links[] = [
|
$actions_links[] = [
|
||||||
'href' => $linker->getLink(['section' => 'email', 'page' => 'email_domain', 'action' => 'add']),
|
'href' => $linker->getLink(['section' => 'email', 'page' => 'email_domain', 'action' => 'add', 'domainid' => $email_domainid]),
|
||||||
'label' => lng('emails.emails_add')
|
'label' => lng('emails.emails_add')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,11 @@ if ($page == 'email_domain') {
|
|||||||
"cid" => $userinfo['customerid']
|
"cid" => $userinfo['customerid']
|
||||||
]);
|
]);
|
||||||
$domains = [];
|
$domains = [];
|
||||||
|
$selected_domain = "";
|
||||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
if ($email_domainid == $row['id']) {
|
||||||
|
$selected_domain = $row['domain'];
|
||||||
|
}
|
||||||
$domains[$row['domain']] = $idna_convert->decode($row['domain']);
|
$domains[$row['domain']] = $idna_convert->decode($row['domain']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ if ($page == 'overview' || $page == 'accounts') {
|
|||||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||||
$domainlist = [];
|
$domainlist = [];
|
||||||
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||||
WHERE `customerid`= :customerid");
|
WHERE `customerid`= :customerid ORDER BY `domain` ASC");
|
||||||
Database::pexecute($result_domains_stmt, [
|
Database::pexecute($result_domains_stmt, [
|
||||||
"customerid" => $userinfo['customerid']
|
"customerid" => $userinfo['customerid']
|
||||||
]);
|
]);
|
||||||
@@ -127,7 +127,6 @@ if ($page == 'overview' || $page == 'accounts') {
|
|||||||
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$domainlist[$row_domain['domain']] = $idna_convert->decode($row_domain['domain']);
|
$domainlist[$row_domain['domain']] = $idna_convert->decode($row_domain['domain']);
|
||||||
}
|
}
|
||||||
sort($domainlist);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings::Get('system.allow_customer_shell') == '1') {
|
if (Settings::Get('system.allow_customer_shell') == '1') {
|
||||||
|
|||||||
@@ -697,7 +697,7 @@ opcache.validate_timestamps'),
|
|||||||
('system', 'distribution', ''),
|
('system', 'distribution', ''),
|
||||||
('system', 'update_channel', 'stable'),
|
('system', 'update_channel', 'stable'),
|
||||||
('system', 'updatecheck_data', ''),
|
('system', 'updatecheck_data', ''),
|
||||||
('system', 'update_notify_last', '2.0.12'),
|
('system', 'update_notify_last', '2.0.14'),
|
||||||
('system', 'traffictool', 'goaccess'),
|
('system', 'traffictool', 'goaccess'),
|
||||||
('api', 'enabled', '0'),
|
('api', 'enabled', '0'),
|
||||||
('api', 'customer_default', '1'),
|
('api', 'customer_default', '1'),
|
||||||
@@ -742,8 +742,8 @@ opcache.validate_timestamps'),
|
|||||||
('panel', 'logo_overridetheme', '0'),
|
('panel', 'logo_overridetheme', '0'),
|
||||||
('panel', 'logo_overridecustom', '0'),
|
('panel', 'logo_overridecustom', '0'),
|
||||||
('panel', 'settings_mode', '0'),
|
('panel', 'settings_mode', '0'),
|
||||||
('panel', 'version', '2.0.12'),
|
('panel', 'version', '2.0.14'),
|
||||||
('panel', 'db_version', '202302030');
|
('panel', 'db_version', '202303150');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_tasks`;
|
DROP TABLE IF EXISTS `panel_tasks`;
|
||||||
@@ -983,7 +983,9 @@ CREATE TABLE IF NOT EXISTS `domain_ssl_settings` (
|
|||||||
`ssl_cert_chainfile` mediumtext,
|
`ssl_cert_chainfile` mediumtext,
|
||||||
`ssl_csr_file` mediumtext,
|
`ssl_csr_file` mediumtext,
|
||||||
`ssl_fullchain_file` mediumtext,
|
`ssl_fullchain_file` mediumtext,
|
||||||
`expirationdate` datetime DEFAULT NULL,
|
`validfromdate` datetime DEFAULT NULL,
|
||||||
|
`validtodate` datetime DEFAULT NULL,
|
||||||
|
`issuer` varchar(255) NOT NULL default '',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY (`domainid`)
|
UNIQUE KEY (`domainid`)
|
||||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
|
|||||||
@@ -23,11 +23,11 @@
|
|||||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Froxlor\Froxlor;
|
|
||||||
use Froxlor\FileDir;
|
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
use Froxlor\Settings;
|
use Froxlor\FileDir;
|
||||||
|
use Froxlor\Froxlor;
|
||||||
use Froxlor\Install\Update;
|
use Froxlor\Install\Update;
|
||||||
|
use Froxlor\Settings;
|
||||||
|
|
||||||
if (!defined('_CRON_UPDATE')) {
|
if (!defined('_CRON_UPDATE')) {
|
||||||
if (!defined('AREA') || (defined('AREA') && AREA != 'admin') || !isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
if (!defined('AREA') || (defined('AREA') && AREA != 'admin') || !isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
||||||
@@ -93,7 +93,8 @@ if (Froxlor::isFroxlorVersion('0.10.38.3')) {
|
|||||||
while ($dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
if (isset($dbserver['allowed_mysqlserver']) && !empty($dbserver['allowed_mysqlserver'])) {
|
if (isset($dbserver['allowed_mysqlserver']) && !empty($dbserver['allowed_mysqlserver'])) {
|
||||||
$allowed_mysqlserver = json_encode(explode(",", $dbserver['allowed_mysqlserver']));
|
$allowed_mysqlserver = json_encode(explode(",", $dbserver['allowed_mysqlserver']));
|
||||||
Database::pexecute($upd_stmt, ['allowed_mysql_server' => $allowed_mysqlserver, 'customerid' => $dbserver['customerid']]);
|
Database::pexecute($upd_stmt,
|
||||||
|
['allowed_mysql_server' => $allowed_mysqlserver, 'customerid' => $dbserver['customerid']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Update::lastStepStatus(0);
|
Update::lastStepStatus(0);
|
||||||
@@ -140,7 +141,8 @@ if (Froxlor::isFroxlorVersion('0.10.38.3')) {
|
|||||||
// none of the files existed
|
// none of the files existed
|
||||||
Update::lastStepStatus(0);
|
Update::lastStepStatus(0);
|
||||||
} else {
|
} else {
|
||||||
Update::lastStepStatus(1, 'manual commands needed', 'Please run the following commands manually:<br><pre>' . $del_list . '</pre>');
|
Update::lastStepStatus(1, 'manual commands needed',
|
||||||
|
'Please run the following commands manually:<br><pre>' . $del_list . '</pre>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +226,8 @@ EOF;
|
|||||||
} else {
|
} else {
|
||||||
$cron_run_cmd = 'chmod +x ' . FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . PHP_EOL;
|
$cron_run_cmd = 'chmod +x ' . FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . PHP_EOL;
|
||||||
$cron_run_cmd .= FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . ' froxlor:cron -r 99';
|
$cron_run_cmd .= FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . ' froxlor:cron -r 99';
|
||||||
Update::lastStepStatus(1, 'manual commands needed', 'Please run the following commands manually:<br><pre>' . $cron_run_cmd . '</pre>');
|
Update::lastStepStatus(1, 'manual commands needed',
|
||||||
|
'Please run the following commands manually:<br><pre>' . $cron_run_cmd . '</pre>');
|
||||||
}
|
}
|
||||||
|
|
||||||
Froxlor::updateToDbVersion('202212060');
|
Froxlor::updateToDbVersion('202212060');
|
||||||
@@ -283,7 +286,8 @@ EOF;
|
|||||||
} else {
|
} else {
|
||||||
$cron_run_cmd = 'chmod +x ' . FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . PHP_EOL;
|
$cron_run_cmd = 'chmod +x ' . FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . PHP_EOL;
|
||||||
$cron_run_cmd .= FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . ' froxlor:cron -r 99';
|
$cron_run_cmd .= FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/bin/froxlor-cli') . ' froxlor:cron -r 99';
|
||||||
Update::lastStepStatus(1, 'manual commands needed', 'Please run the following commands manually:<br><pre>' . $cron_run_cmd . '</pre>');
|
Update::lastStepStatus(1, 'manual commands needed',
|
||||||
|
'Please run the following commands manually:<br><pre>' . $cron_run_cmd . '</pre>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Froxlor::updateToVersion('2.0.4');
|
Froxlor::updateToVersion('2.0.4');
|
||||||
@@ -323,7 +327,7 @@ if (Froxlor::isDatabaseVersion('202212060')) {
|
|||||||
$system_letsencryptchallengepath_upd = isset($_POST['system_letsencryptchallengepath_upd']) ? $_POST['system_letsencryptchallengepath_upd'] : $acmesh_challenge_dir;
|
$system_letsencryptchallengepath_upd = isset($_POST['system_letsencryptchallengepath_upd']) ? $_POST['system_letsencryptchallengepath_upd'] : $acmesh_challenge_dir;
|
||||||
if ($acmesh_challenge_dir != $system_letsencryptchallengepath_upd) {
|
if ($acmesh_challenge_dir != $system_letsencryptchallengepath_upd) {
|
||||||
Settings::Set('system.letsencryptchallengepath', $system_letsencryptchallengepath_upd);
|
Settings::Set('system.letsencryptchallengepath', $system_letsencryptchallengepath_upd);
|
||||||
if ((int) Settings::Get('system.leenabled') == 1) {
|
if ((int)Settings::Get('system.leenabled') == 1) {
|
||||||
// create JSON string for --apply
|
// create JSON string for --apply
|
||||||
$dist = Settings::Get('system.distribution');
|
$dist = Settings::Get('system.distribution');
|
||||||
$webserver = Settings::Get('system.webserver');
|
$webserver = Settings::Get('system.webserver');
|
||||||
@@ -400,3 +404,57 @@ if (Froxlor::isFroxlorVersion('2.0.11')) {
|
|||||||
Update::showUpdateStep("Updating from 2.0.11 to 2.0.12", false);
|
Update::showUpdateStep("Updating from 2.0.11 to 2.0.12", false);
|
||||||
Froxlor::updateToVersion('2.0.12');
|
Froxlor::updateToVersion('2.0.12');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Froxlor::isFroxlorVersion('2.0.12')) {
|
||||||
|
Update::showUpdateStep("Updating from 2.0.12 to 2.0.13", false);
|
||||||
|
Froxlor::updateToVersion('2.0.13');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Froxlor::isDatabaseVersion('202302030')) {
|
||||||
|
Update::showUpdateStep("Correcting language mapping of templates created pre 2.0.x");
|
||||||
|
// languages from 0.10.x
|
||||||
|
$language_mapping_comp = [
|
||||||
|
'de' => 'Deutsch',
|
||||||
|
'en' => 'English',
|
||||||
|
'fr' => 'Français',
|
||||||
|
'pt' => 'Português',
|
||||||
|
'it' => 'Italiano',
|
||||||
|
'nl' => 'Nederlands',
|
||||||
|
'se' => 'Svenska',
|
||||||
|
'cz' => 'Česká republika'
|
||||||
|
];
|
||||||
|
$upd_tpl_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `language` = :iso WHERE `language` = :lng");
|
||||||
|
foreach ($language_mapping_comp as $iso => $lang) {
|
||||||
|
Database::pexecute($upd_tpl_stmt, ['iso' => $iso, 'lng' => $lang]);
|
||||||
|
}
|
||||||
|
Update::lastStepStatus(0);
|
||||||
|
|
||||||
|
Update::showUpdateStep("Enhancing ssl data table");
|
||||||
|
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` RENAME COLUMN `expirationdate` TO `validtodate`;");
|
||||||
|
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` ADD `validfromdate` datetime DEFAULT NULL AFTER `ssl_fullchain_file`;");
|
||||||
|
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` ADD `issuer` varchar(255) NOT NULL default '' AFTER `validtodate`;");
|
||||||
|
Update::lastStepStatus(0);
|
||||||
|
|
||||||
|
Update::showUpdateStep("Filling new ssl data fields with existing certificate data");
|
||||||
|
$crt_upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` SET `validfromdate` = :validfromdate, `issuer` = :issuer WHERE `id` = :id");
|
||||||
|
$crt_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`");
|
||||||
|
Database::pexecute($crt_stmt);
|
||||||
|
while ($cert = $crt_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
|
$cert_content = openssl_x509_parse($cert['ssl_cert_file']);
|
||||||
|
if (is_array($cert_content)) {
|
||||||
|
$validfromdate = empty($cert_content['validFrom_time_t']) ? null : date("Y-m-d H:i:s", $cert_content['validFrom_time_t']);
|
||||||
|
$issuer = $cert_content['issuer']['O'] ?? "";
|
||||||
|
Database::pexecute($crt_upd_stmt, ['validfromdate' => $validfromdate, 'issuer' => $issuer, 'id' => $cert['id']]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// clear possible user customized columns
|
||||||
|
Database::query("DELETE FROM `" . TABLE_PANEL_USERCOLUMNS . "` WHERE `section` = 'sslcertificates_list'");
|
||||||
|
Update::lastStepStatus(0);
|
||||||
|
|
||||||
|
Froxlor::updateToDbVersion('202303150');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Froxlor::isFroxlorVersion('2.0.13')) {
|
||||||
|
Update::showUpdateStep("Updating from 2.0.13 to 2.0.14", false);
|
||||||
|
Froxlor::updateToVersion('2.0.14');
|
||||||
|
}
|
||||||
|
|||||||
@@ -127,7 +127,9 @@ class Certificates extends ApiCommand implements ResourceEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
$do_verify = true;
|
$do_verify = true;
|
||||||
$expirationdate = null;
|
$validtodate = null;
|
||||||
|
$validtodate = null;
|
||||||
|
$issuer = "";
|
||||||
// no cert-file given -> forget everything
|
// no cert-file given -> forget everything
|
||||||
if ($ssl_cert_file == '') {
|
if ($ssl_cert_file == '') {
|
||||||
$ssl_key_file = '';
|
$ssl_key_file = '';
|
||||||
@@ -168,7 +170,10 @@ class Certificates extends ApiCommand implements ResourceEntity
|
|||||||
} else {
|
} else {
|
||||||
Response::standardError('sslcertificateinvalidcert', '', true);
|
Response::standardError('sslcertificateinvalidcert', '', true);
|
||||||
}
|
}
|
||||||
$expirationdate = empty($cert_content['validTo_time_t']) ? null : date("Y-m-d H:i:s", $cert_content['validTo_time_t']);
|
// get data from certificate to store in the table
|
||||||
|
$validfromdate = empty($cert_content['validFrom_time_t']) ? null : date("Y-m-d H:i:s", $cert_content['validFrom_time_t']);
|
||||||
|
$validtodate = empty($cert_content['validTo_time_t']) ? null : date("Y-m-d H:i:s", $cert_content['validTo_time_t']);
|
||||||
|
$issuer = $cert_content['issuer']['O'] ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add/Update database entry
|
// Add/Update database entry
|
||||||
@@ -183,7 +188,9 @@ class Certificates extends ApiCommand implements ResourceEntity
|
|||||||
`ssl_key_file` = :ssl_key_file,
|
`ssl_key_file` = :ssl_key_file,
|
||||||
`ssl_ca_file` = :ssl_ca_file,
|
`ssl_ca_file` = :ssl_ca_file,
|
||||||
`ssl_cert_chainfile` = :ssl_cert_chainfile,
|
`ssl_cert_chainfile` = :ssl_cert_chainfile,
|
||||||
`expirationdate` = :expirationdate
|
`validfromdate` = :validfromdate,
|
||||||
|
`validtodate` = :validtodate,
|
||||||
|
`issuer` = :issuer
|
||||||
" . $qrywhere . " `domainid`= :domainid
|
" . $qrywhere . " `domainid`= :domainid
|
||||||
");
|
");
|
||||||
$params = [
|
$params = [
|
||||||
@@ -191,7 +198,9 @@ class Certificates extends ApiCommand implements ResourceEntity
|
|||||||
"ssl_key_file" => $ssl_key_file,
|
"ssl_key_file" => $ssl_key_file,
|
||||||
"ssl_ca_file" => $ssl_ca_file,
|
"ssl_ca_file" => $ssl_ca_file,
|
||||||
"ssl_cert_chainfile" => $ssl_cert_chainfile,
|
"ssl_cert_chainfile" => $ssl_cert_chainfile,
|
||||||
"expirationdate" => $expirationdate,
|
"validfromdate" => $validfromdate,
|
||||||
|
"validtodate" => $validtodate,
|
||||||
|
"issuer" => $issuer,
|
||||||
"domainid" => $domainid
|
"domainid" => $domainid
|
||||||
];
|
];
|
||||||
Database::pexecute($stmt, $params, true, true);
|
Database::pexecute($stmt, $params, true, true);
|
||||||
@@ -299,27 +308,23 @@ class Certificates extends ApiCommand implements ResourceEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set data from certificate
|
// Set data from certificate
|
||||||
|
$cert['isvalid'] = false;
|
||||||
|
$cert['san'] = null;
|
||||||
$cert_data = openssl_x509_parse($cert['ssl_cert_file']);
|
$cert_data = openssl_x509_parse($cert['ssl_cert_file']);
|
||||||
if ($cert_data) {
|
if ($cert_data) {
|
||||||
$cert['validfromdate'] = date('Y-m-d H:i:s', $cert_data['validFrom_time_t']);
|
|
||||||
$cert['validtodate'] = date('Y-m-d H:i:s', $cert_data['validTo_time_t']);
|
|
||||||
$cert['isvalid'] = (bool)$cert_data['validTo_time_t'] > time();
|
$cert['isvalid'] = (bool)$cert_data['validTo_time_t'] > time();
|
||||||
$cert['issuer'] = $cert_data['issuer']['O'] ?? null;
|
// Set subject alt names from certificate
|
||||||
}
|
if (isset($cert_data['extensions']['subjectAltName']) && !empty($cert_data['extensions']['subjectAltName'])) {
|
||||||
|
$SANs = explode(",", $cert_data['extensions']['subjectAltName']);
|
||||||
// Set subject alt names from certificate
|
$SANs = array_map('trim', $SANs);
|
||||||
$cert['san'] = null;
|
foreach ($SANs as $san) {
|
||||||
if (isset($cert_data['extensions']['subjectAltName']) && !empty($cert_data['extensions']['subjectAltName'])) {
|
$san = str_replace("DNS:", "", $san);
|
||||||
$SANs = explode(",", $cert_data['extensions']['subjectAltName']);
|
if ($san != $cert_data['subject']['CN'] && strpos($san, "othername:") === false) {
|
||||||
$SANs = array_map('trim', $SANs);
|
$cert['san'][] = $san;
|
||||||
foreach ($SANs as $san) {
|
}
|
||||||
$san = str_replace("DNS:", "", $san);
|
|
||||||
if ($san != $cert_data['subject']['CN'] && strpos($san, "othername:") === false) {
|
|
||||||
$cert['san'][] = $san;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result[] = $cert;
|
$result[] = $cert;
|
||||||
}
|
}
|
||||||
return $this->response([
|
return $this->response([
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ final class ValidateAcmeWebroot extends CliCommand
|
|||||||
'domain' => Settings::Get('system.hostname')
|
'domain' => Settings::Get('system.hostname')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$upd_stmt = Database::prepare("UPDATE domain_ssl_settings SET expirationdate=NULL WHERE `domainid` = :did");
|
$upd_stmt = Database::prepare("UPDATE domain_ssl_settings SET `validtodate`=NULL WHERE `domainid` = :did");
|
||||||
$acmesh_dir = dirname(Settings::Get('system.acmeshpath'));
|
$acmesh_dir = dirname(Settings::Get('system.acmeshpath'));
|
||||||
$acmesh_challenge_dir = rtrim(FileDir::makeCorrectDir(Settings::Get('system.letsencryptchallengepath')), "/");
|
$acmesh_challenge_dir = rtrim(FileDir::makeCorrectDir(Settings::Get('system.letsencryptchallengepath')), "/");
|
||||||
$recommended = rtrim(FileDir::makeCorrectDir(Froxlor::getInstallDir()), "/");
|
$recommended = rtrim(FileDir::makeCorrectDir(Froxlor::getInstallDir()), "/");
|
||||||
|
|||||||
@@ -196,6 +196,9 @@ class ApacheFcgi extends Apache
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$php_options_text .= ' FcgidIdleTimeout ' . Settings::Get('system.mod_fcgid_idle_timeout') . "\n";
|
$php_options_text .= ' FcgidIdleTimeout ' . Settings::Get('system.mod_fcgid_idle_timeout') . "\n";
|
||||||
|
if ($phpconfig['pass_authorizationheader'] == '1') {
|
||||||
|
$php_options_text .= ' FcgidPassHeader Authorization' . "\n";
|
||||||
|
}
|
||||||
if ((int)Settings::Get('system.mod_fcgid_wrapper') == 0) {
|
if ((int)Settings::Get('system.mod_fcgid_wrapper') == 0) {
|
||||||
$php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
|
$php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
|
||||||
$php_options_text .= ' ScriptAlias /php/ ' . $php->getInterface()->getConfigDir() . "\n";
|
$php_options_text .= ' ScriptAlias /php/ ' . $php->getInterface()->getConfigDir() . "\n";
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class HttpConfigBase
|
|||||||
$froxlor_ssl_settings_stmt = Database::prepare("
|
$froxlor_ssl_settings_stmt = Database::prepare("
|
||||||
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
||||||
WHERE `domainid` = '0' AND
|
WHERE `domainid` = '0' AND
|
||||||
(`expirationdate` < DATE_ADD(NOW(), INTERVAL 30 DAY) OR `expirationdate` IS NULL)
|
(`validtodate` < DATE_ADD(NOW(), INTERVAL 30 DAY) OR `validtodate` IS NULL)
|
||||||
");
|
");
|
||||||
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
||||||
if ($froxlor_ssl && !empty($froxlor_ssl['ssl_cert_file'])) {
|
if ($froxlor_ssl && !empty($froxlor_ssl['ssl_cert_file'])) {
|
||||||
|
|||||||
@@ -114,7 +114,9 @@ class AcmeSh extends FroxlorCron
|
|||||||
`ssl_cert_chainfile` = :chain,
|
`ssl_cert_chainfile` = :chain,
|
||||||
`ssl_csr_file` = :csr,
|
`ssl_csr_file` = :csr,
|
||||||
`ssl_fullchain_file` = :fullchain,
|
`ssl_fullchain_file` = :fullchain,
|
||||||
`expirationdate` = :expirationdate
|
`validfromdate` = :validfromdate,
|
||||||
|
`validtodate` = :validtodate,
|
||||||
|
`issuer` = :issuer
|
||||||
");
|
");
|
||||||
|
|
||||||
// prepare domain update sql
|
// prepare domain update sql
|
||||||
@@ -136,7 +138,9 @@ class AcmeSh extends FroxlorCron
|
|||||||
'lepublickey' => Settings::Get('system.lepublickey'),
|
'lepublickey' => Settings::Get('system.lepublickey'),
|
||||||
'leregistered' => Settings::Get('system.leregistered'),
|
'leregistered' => Settings::Get('system.leregistered'),
|
||||||
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
|
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
|
||||||
'expirationdate' => null,
|
'validfromdate' => null,
|
||||||
|
'validtodate' => null,
|
||||||
|
'issuer' => "",
|
||||||
'ssl_cert_file' => null,
|
'ssl_cert_file' => null,
|
||||||
'ssl_key_file' => null,
|
'ssl_key_file' => null,
|
||||||
'ssl_ca_file' => null,
|
'ssl_ca_file' => null,
|
||||||
@@ -171,7 +175,9 @@ class AcmeSh extends FroxlorCron
|
|||||||
'lepublickey' => Settings::Get('system.lepublickey'),
|
'lepublickey' => Settings::Get('system.lepublickey'),
|
||||||
'leregistered' => Settings::Get('system.leregistered'),
|
'leregistered' => Settings::Get('system.leregistered'),
|
||||||
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
|
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
|
||||||
'expirationdate' => is_array($renew_froxlor) ? $renew_froxlor['expirationdate'] : date('Y-m-d H:i:s', 0),
|
'validfromdate' => is_array($renew_froxlor) ? $renew_froxlor['validfromdate'] : date('Y-m-d H:i:s', 0),
|
||||||
|
'validtodate' => is_array($renew_froxlor) ? $renew_froxlor['validtodate'] : date('Y-m-d H:i:s', 0),
|
||||||
|
'issuer' => is_array($renew_froxlor) ? $renew_froxlor['issuer'] : "",
|
||||||
'ssl_cert_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_cert_file'] : null,
|
'ssl_cert_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_cert_file'] : null,
|
||||||
'ssl_key_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_key_file'] : null,
|
'ssl_key_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_key_file'] : null,
|
||||||
'ssl_ca_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_ca_file'] : null,
|
'ssl_ca_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_ca_file'] : null,
|
||||||
@@ -187,7 +193,7 @@ class AcmeSh extends FroxlorCron
|
|||||||
'loginname' => $domain['loginname'],
|
'loginname' => $domain['loginname'],
|
||||||
'adminsession' => 0
|
'adminsession' => 0
|
||||||
]);
|
]);
|
||||||
if (defined('CRON_IS_FORCED') || self::checkFsFilesAreNewer($domain['domain'], $domain['expirationdate'])) {
|
if (defined('CRON_IS_FORCED') || self::checkFsFilesAreNewer($domain['domain'], $domain['validtodate'])) {
|
||||||
self::certToDb($domain, $cronlog, []);
|
self::certToDb($domain, $cronlog, []);
|
||||||
$changedetected = 1;
|
$changedetected = 1;
|
||||||
}
|
}
|
||||||
@@ -221,7 +227,9 @@ class AcmeSh extends FroxlorCron
|
|||||||
");
|
");
|
||||||
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
||||||
// also check for possible existing certificate
|
// also check for possible existing certificate
|
||||||
if (!$froxlor_ssl && !self::checkFsFilesAreNewer(Settings::Get('system.hostname'), date('Y-m-d H:i:s'))) {
|
if (($froxlor_ssl && empty($froxlor_ssl['validtodate']))
|
||||||
|
|| (!$froxlor_ssl && !self::checkFsFilesAreNewer(Settings::Get('system.hostname'), date('Y-m-d H:i:s')))
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,7 +287,9 @@ EOC;
|
|||||||
SELECT
|
SELECT
|
||||||
domssl.`id`,
|
domssl.`id`,
|
||||||
domssl.`domainid`,
|
domssl.`domainid`,
|
||||||
domssl.`expirationdate`,
|
domssl.`validfromdate`,
|
||||||
|
domssl.`validtodate`,
|
||||||
|
domssl.`issuer`,
|
||||||
domssl.`ssl_cert_file`,
|
domssl.`ssl_cert_file`,
|
||||||
domssl.`ssl_key_file`,
|
domssl.`ssl_key_file`,
|
||||||
domssl.`ssl_ca_file`,
|
domssl.`ssl_ca_file`,
|
||||||
@@ -306,7 +316,7 @@ EOC;
|
|||||||
AND dom.`letsencrypt` = 1
|
AND dom.`letsencrypt` = 1
|
||||||
AND dom.`aliasdomain` IS NULL
|
AND dom.`aliasdomain` IS NULL
|
||||||
AND dom.`iswildcarddomain` = 0
|
AND dom.`iswildcarddomain` = 0
|
||||||
AND domssl.`expirationdate` IS NULL
|
AND domssl.`validtodate` IS NULL
|
||||||
");
|
");
|
||||||
$customer_ssl = $certificates_stmt->fetchAll(PDO::FETCH_ASSOC);
|
$customer_ssl = $certificates_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
if ($customer_ssl) {
|
if ($customer_ssl) {
|
||||||
@@ -330,7 +340,7 @@ EOC;
|
|||||||
");
|
");
|
||||||
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
||||||
// also check for possible existing certificate
|
// also check for possible existing certificate
|
||||||
if ($froxlor_ssl && self::checkFsFilesAreNewer(Settings::Get('system.hostname'), $froxlor_ssl['expirationdate'])) {
|
if ($froxlor_ssl && self::checkFsFilesAreNewer(Settings::Get('system.hostname'), $froxlor_ssl['validtodate'])) {
|
||||||
return $froxlor_ssl;
|
return $froxlor_ssl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -346,7 +356,9 @@ EOC;
|
|||||||
SELECT
|
SELECT
|
||||||
domssl.`id`,
|
domssl.`id`,
|
||||||
domssl.`domainid`,
|
domssl.`domainid`,
|
||||||
domssl.`expirationdate`,
|
domssl.`validfromdate`,
|
||||||
|
domssl.`validtodate`,
|
||||||
|
domssl.`issuer`,
|
||||||
domssl.`ssl_cert_file`,
|
domssl.`ssl_cert_file`,
|
||||||
domssl.`ssl_key_file`,
|
domssl.`ssl_key_file`,
|
||||||
dom.`domain`,
|
dom.`domain`,
|
||||||
@@ -370,7 +382,7 @@ EOC;
|
|||||||
if ($renew_certs) {
|
if ($renew_certs) {
|
||||||
if ($check) {
|
if ($check) {
|
||||||
foreach ($renew_certs as $cert) {
|
foreach ($renew_certs as $cert) {
|
||||||
if (self::checkFsFilesAreNewer($cert['domain'], $cert['expirationdate'])) {
|
if (self::checkFsFilesAreNewer($cert['domain'], $cert['validtodate'])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -453,7 +465,7 @@ EOC;
|
|||||||
// Only issue let's encrypt certificate if no broken ssl_redirect is enabled
|
// Only issue let's encrypt certificate if no broken ssl_redirect is enabled
|
||||||
if ($certrow['ssl_redirect'] != 2) {
|
if ($certrow['ssl_redirect'] != 2) {
|
||||||
$do_force = false;
|
$do_force = false;
|
||||||
if (!empty($certrow['ssl_cert_file']) && empty($certrow['expirationdate'])) {
|
if (!empty($certrow['ssl_cert_file']) && empty($certrow['validtodate'])) {
|
||||||
// domain changed (SAN or similar)
|
// domain changed (SAN or similar)
|
||||||
$do_force = true;
|
$do_force = true;
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Re-creating certificate for " . $certrow['domain']);
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Re-creating certificate for " . $certrow['domain']);
|
||||||
@@ -594,7 +606,9 @@ EOC;
|
|||||||
'chain' => $return['chain'],
|
'chain' => $return['chain'],
|
||||||
'csr' => $return['csr'],
|
'csr' => $return['csr'],
|
||||||
'fullchain' => $return['fullchain'],
|
'fullchain' => $return['fullchain'],
|
||||||
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
'validfromdate' => date('Y-m-d H:i:s', $newcert['validFrom_time_t']),
|
||||||
|
'validtodate' => date('Y-m-d H:i:s', $newcert['validTo_time_t']),
|
||||||
|
'issuer' => $newcert['issuer']['O'] ?? ""
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($certrow['ssl_redirect'] == 3) {
|
if ($certrow['ssl_redirect'] == 3) {
|
||||||
|
|||||||
@@ -1040,6 +1040,9 @@ class Nginx extends HttpConfigBase
|
|||||||
$path_options .= "\t\t" . 'auth_basic_user_file ' . FileDir::makeCorrectFile($single['usrf']) . ';' . "\n";
|
$path_options .= "\t\t" . 'auth_basic_user_file ' . FileDir::makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||||
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
|
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
|
||||||
$path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n";
|
$path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n";
|
||||||
|
$path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n";
|
||||||
|
$path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
|
||||||
|
$path_options .= "\t\t" . '}' . "\n\n";
|
||||||
} else {
|
} else {
|
||||||
$path_options .= "\t\t" . 'index index.html index.htm;' . "\n";
|
$path_options .= "\t\t" . 'index index.html index.htm;' . "\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -342,8 +342,17 @@ pm.max_children = 1
|
|||||||
public function getSocketFile($createifnotexists = true)
|
public function getSocketFile($createifnotexists = true)
|
||||||
{
|
{
|
||||||
$socketdir = FileDir::makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir'));
|
$socketdir = 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
|
// 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(FileDir::makeCorrectFile($socketdir . '/' . $this->domain['fpm_config_id'] . '-' . $this->domain['loginname'] . '-' . $this->domain['domain'] . '-php-fpm.socket'));
|
$socket_filename = $socketdir . '/' . $this->domain['fpm_config_id'] . '-' . $this->domain['loginname'] . '-' . $this->domain['domain'] . '-php-fpm.socket';
|
||||||
|
if (strlen($socket_filename) > 100) {
|
||||||
|
// respect the unix socket-length limitation
|
||||||
|
$socket_filename = $socketdir . '/' . $this->domain['fpm_config_id'] . '-' . $this->domain['loginname'] . '-' . $this->domain['id'] . '-php-fpm.socket';
|
||||||
|
if (strlen($socket_filename) > 100) {
|
||||||
|
// even a long loginname it seems
|
||||||
|
$socket_filename = $socketdir . '/' . $this->domain['fpm_config_id'] . '-' . $this->domain['guid'] . '-' . $this->domain['id'] . '-php-fpm.socket';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$socket = strtolower(FileDir::makeCorrectFile($socket_filename));
|
||||||
|
|
||||||
if (!is_dir($socketdir) && $createifnotexists) {
|
if (!is_dir($socketdir) && $createifnotexists) {
|
||||||
FileDir::safe_exec('mkdir -p ' . escapeshellarg($socketdir));
|
FileDir::safe_exec('mkdir -p ' . escapeshellarg($socketdir));
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ namespace Froxlor\Cron\Traffic;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Froxlor\Cron\FroxlorCron;
|
use Froxlor\Cron\FroxlorCron;
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
use Froxlor\FileDir;
|
|
||||||
use Froxlor\Froxlor;
|
|
||||||
use Froxlor\FroxlorLogger;
|
use Froxlor\FroxlorLogger;
|
||||||
use Froxlor\PhpHelper;
|
use Froxlor\PhpHelper;
|
||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
@@ -99,8 +97,8 @@ class ReportsCron extends FroxlorCron
|
|||||||
'COMPANY' => $rep_userinfo['company'],
|
'COMPANY' => $rep_userinfo['company'],
|
||||||
'USERNAME' => $rep_userinfo['loginname'],
|
'USERNAME' => $rep_userinfo['loginname'],
|
||||||
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
||||||
'TRAFFIC' => PhpHelper::sizeReadable($row['traffic'], null, 'bi'),
|
'TRAFFIC' => PhpHelper::sizeReadable((int)$row['traffic'], null, 'bi'),
|
||||||
'TRAFFICUSED' => PhpHelper::sizeReadable($row['traffic_used'], null, 'bi'),
|
'TRAFFICUSED' => PhpHelper::sizeReadable((int)$row['traffic_used'], null, 'bi'),
|
||||||
'USAGE_PERCENT' => round(($row['traffic_used'] * 100) / $row['traffic'], 2),
|
'USAGE_PERCENT' => round(($row['traffic_used'] * 100) / $row['traffic'], 2),
|
||||||
'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
|
'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
|
||||||
];
|
];
|
||||||
@@ -182,8 +180,8 @@ class ReportsCron extends FroxlorCron
|
|||||||
if (isset($row['traffic']) && $row['traffic'] > 0 && (($row['traffic_used_total'] * 100) / ($row['traffic'])) >= (int)Settings::Get('system.report_trafficmax')) {
|
if (isset($row['traffic']) && $row['traffic'] > 0 && (($row['traffic_used_total'] * 100) / ($row['traffic'])) >= (int)Settings::Get('system.report_trafficmax')) {
|
||||||
$replace_arr = [
|
$replace_arr = [
|
||||||
'NAME' => $row['name'],
|
'NAME' => $row['name'],
|
||||||
'TRAFFIC' => PhpHelper::sizeReadable($row['traffic'], null, 'bi'),
|
'TRAFFIC' => PhpHelper::sizeReadable((int)$row['traffic'], null, 'bi'),
|
||||||
'TRAFFICUSED' => PhpHelper::sizeReadable($row['traffic_used_total'], null, 'bi'),
|
'TRAFFICUSED' => PhpHelper::sizeReadable((int)$row['traffic_used_total'], null, 'bi'),
|
||||||
'USAGE_PERCENT' => round(($row['traffic_used_total'] * 100) / $row['traffic'], 2),
|
'USAGE_PERCENT' => round(($row['traffic_used_total'] * 100) / $row['traffic'], 2),
|
||||||
'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
|
'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
|
||||||
];
|
];
|
||||||
@@ -265,10 +263,10 @@ class ReportsCron extends FroxlorCron
|
|||||||
|
|
||||||
while ($customer = $customers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($customer = $customers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$customer['traffic'] *= 1024;
|
$customer['traffic'] *= 1024;
|
||||||
$t = $customer['traffic_used_total'] * 1024;
|
$t = (int) $customer['traffic_used_total'] * 1024;
|
||||||
if ($customer['traffic'] > 0) {
|
if ($customer['traffic'] > 0) {
|
||||||
$p = (($t * 100) / $customer['traffic']);
|
$p = (($t * 100) / $customer['traffic']);
|
||||||
$tg = $customer['traffic'];
|
$tg = (int) $customer['traffic'];
|
||||||
$str = sprintf('%s ( %00.1f %% )', PhpHelper::sizeReadable($t, null, 'bi'), $p);
|
$str = sprintf('%s ( %00.1f %% )', PhpHelper::sizeReadable($t, null, 'bi'), $p);
|
||||||
$mail_body .= sprintf('%-15s', $customer['loginname']) . ' ' . sprintf('%-25s', $str) . ' ' . sprintf('%s', PhpHelper::sizeReadable($tg, null, 'bi')) . "\n";
|
$mail_body .= sprintf('%-15s', $customer['loginname']) . ' ' . sprintf('%-25s', $str) . ' ' . sprintf('%s', PhpHelper::sizeReadable($tg, null, 'bi')) . "\n";
|
||||||
} elseif ($customer['traffic'] == 0) {
|
} elseif ($customer['traffic'] == 0) {
|
||||||
@@ -282,10 +280,10 @@ class ReportsCron extends FroxlorCron
|
|||||||
|
|
||||||
$mail_body .= '---------------------------------------------------------------' . "\n";
|
$mail_body .= '---------------------------------------------------------------' . "\n";
|
||||||
|
|
||||||
$t = $row['traffic_used_total'];
|
$t = (int) $row['traffic_used_total'];
|
||||||
if ($row['traffic'] > 0) {
|
if ($row['traffic'] > 0) {
|
||||||
$p = (($t * 100) / $row['traffic']);
|
$p = (($t * 100) / $row['traffic']);
|
||||||
$tg = $row['traffic'];
|
$tg = (int) $row['traffic'];
|
||||||
$str = sprintf('%s ( %00.1f %% )', PhpHelper::sizeReadable($t, null, 'bi'), $p);
|
$str = sprintf('%s ( %00.1f %% )', PhpHelper::sizeReadable($t, null, 'bi'), $p);
|
||||||
$mail_body .= sprintf('%-15s', $row['loginname']) . ' ' . sprintf('%-25s', $str) . ' ' . sprintf('%s', PhpHelper::sizeReadable($tg, null, 'bi')) . "\n";
|
$mail_body .= sprintf('%-15s', $row['loginname']) . ' ' . sprintf('%-25s', $str) . ' ' . sprintf('%s', PhpHelper::sizeReadable($tg, null, 'bi')) . "\n";
|
||||||
} elseif ($row['traffic'] == 0) {
|
} elseif ($row['traffic'] == 0) {
|
||||||
@@ -369,8 +367,8 @@ class ReportsCron extends FroxlorCron
|
|||||||
'COMPANY' => $rep_userinfo['company'],
|
'COMPANY' => $rep_userinfo['company'],
|
||||||
'USERNAME' => $rep_userinfo['loginname'],
|
'USERNAME' => $rep_userinfo['loginname'],
|
||||||
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
||||||
'DISKAVAILABLE' => PhpHelper::sizeReadable($row['diskspace'], null, 'bi'),
|
'DISKAVAILABLE' => PhpHelper::sizeReadable((int)$row['diskspace'], null, 'bi'),
|
||||||
'DISKUSED' => PhpHelper::sizeReadable($row['diskspace_used'], null, 'bi'),
|
'DISKUSED' => PhpHelper::sizeReadable((int)$row['diskspace_used'], null, 'bi'),
|
||||||
'USAGE_PERCENT' => round(($row['diskspace_used'] * 100) / $row['diskspace'], 2),
|
'USAGE_PERCENT' => round(($row['diskspace_used'] * 100) / $row['diskspace'], 2),
|
||||||
'MAX_PERCENT' => Settings::Get('system.report_webmax')
|
'MAX_PERCENT' => Settings::Get('system.report_webmax')
|
||||||
];
|
];
|
||||||
@@ -443,8 +441,8 @@ class ReportsCron extends FroxlorCron
|
|||||||
if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int)Settings::Get('system.report_webmax')) {
|
if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int)Settings::Get('system.report_webmax')) {
|
||||||
$replace_arr = [
|
$replace_arr = [
|
||||||
'NAME' => $row['name'],
|
'NAME' => $row['name'],
|
||||||
'DISKAVAILABLE' => PhpHelper::sizeReadable($row['diskspace'], null, 'bi'),
|
'DISKAVAILABLE' => PhpHelper::sizeReadable((int)$row['diskspace'], null, 'bi'),
|
||||||
'DISKUSED' => PhpHelper::sizeReadable($row['diskspace_used'], null, 'bi'),
|
'DISKUSED' => PhpHelper::sizeReadable((int)$row['diskspace_used'], null, 'bi'),
|
||||||
'USAGE_PERCENT' => ($row['diskspace_used'] * 100) / $row['diskspace'],
|
'USAGE_PERCENT' => ($row['diskspace_used'] * 100) / $row['diskspace'],
|
||||||
'MAX_PERCENT' => Settings::Get('system.report_webmax')
|
'MAX_PERCENT' => Settings::Get('system.report_webmax')
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class TrafficCron extends FroxlorCron
|
|||||||
// Fork failed
|
// Fork failed
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else if (!defined('CRON_NOFORK_FLAG')) {
|
} elseif (!defined('CRON_NOFORK_FLAG')) {
|
||||||
if (extension_loaded('pcntl')) {
|
if (extension_loaded('pcntl')) {
|
||||||
$msg = "PHP compiled with pcntl but pcntl_fork function is not available.";
|
$msg = "PHP compiled with pcntl but pcntl_fork function is not available.";
|
||||||
} else {
|
} else {
|
||||||
@@ -406,7 +406,7 @@ class TrafficCron extends FroxlorCron
|
|||||||
} else {
|
} else {
|
||||||
// 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 = FileDir::safe_exec('du -sk ' . escapeshellarg($row['documentroot']) . '');
|
$back = FileDir::safe_exec('du -sk ' . escapeshellarg($row['documentroot']));
|
||||||
foreach ($back as $backrow) {
|
foreach ($back as $backrow) {
|
||||||
$webspaceusage = explode(' ', $backrow);
|
$webspaceusage = explode(' ', $backrow);
|
||||||
}
|
}
|
||||||
@@ -426,7 +426,7 @@ class TrafficCron extends FroxlorCron
|
|||||||
|
|
||||||
$maildir = FileDir::makeCorrectDir(Settings::Get('system.vmail_homedir') . $row['loginname']);
|
$maildir = FileDir::makeCorrectDir(Settings::Get('system.vmail_homedir') . $row['loginname']);
|
||||||
if (file_exists($maildir) && is_dir($maildir)) {
|
if (file_exists($maildir) && is_dir($maildir)) {
|
||||||
$back = FileDir::safe_exec('du -sk ' . escapeshellarg($maildir) . '');
|
$back = FileDir::safe_exec('du -sk ' . escapeshellarg($maildir));
|
||||||
foreach ($back as $backrow) {
|
foreach ($back as $backrow) {
|
||||||
$emailusage = explode(' ', $backrow);
|
$emailusage = explode(' ', $backrow);
|
||||||
}
|
}
|
||||||
@@ -627,7 +627,7 @@ class TrafficCron extends FroxlorCron
|
|||||||
* @param string $caption Caption for webalizer output
|
* @param string $caption Caption for webalizer output
|
||||||
* @param array $monthyear_arr
|
* @param array $monthyear_arr
|
||||||
* @param int $current_stamp
|
* @param int $current_stamp
|
||||||
*
|
*
|
||||||
* @return int Used traffic
|
* @return int Used traffic
|
||||||
*/
|
*/
|
||||||
private static function callGoaccessGetTraffic($customerid, $logfile, $outputdir, $caption, array $monthyear_arr = [], int $current_stamp = 0)
|
private static function callGoaccessGetTraffic($customerid, $logfile, $outputdir, $caption, array $monthyear_arr = [], int $current_stamp = 0)
|
||||||
@@ -705,7 +705,7 @@ class TrafficCron extends FroxlorCron
|
|||||||
* @param string $outputdir Place where stats should be build
|
* @param string $outputdir Place where stats should be build
|
||||||
* @param string $caption Caption for webalizer output
|
* @param string $caption Caption for webalizer output
|
||||||
* @param array $usersdomainlist
|
* @param array $usersdomainlist
|
||||||
*
|
*
|
||||||
* @return float Used traffic
|
* @return float Used traffic
|
||||||
*/
|
*/
|
||||||
private static function callWebalizerGetTraffic($logfile, $outputdir, $caption, array $usersdomainlist = [])
|
private static function callWebalizerGetTraffic($logfile, $outputdir, $caption, array $usersdomainlist = [])
|
||||||
|
|||||||
@@ -279,8 +279,7 @@ class Dns
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$zonerecords[] = new DnsEntry($entry['record'], $entry['type'], $entry['content'], $entry['prio'],
|
$zonerecords[] = new DnsEntry($entry['record'], $entry['type'], $entry['content'], $entry['prio'] ?? 0, $entry['ttl']);
|
||||||
$entry['ttl']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// add missing required entries
|
// add missing required entries
|
||||||
|
|||||||
@@ -37,18 +37,18 @@ class PowerDNS
|
|||||||
/**
|
/**
|
||||||
* remove all records and entries of a given domain
|
* remove all records and entries of a given domain
|
||||||
*
|
*
|
||||||
* @param array|null $domain
|
* @param string|null $domain
|
||||||
*/
|
*/
|
||||||
public static function cleanDomainZone(array $domain = null)
|
public static function cleanDomainZone(string $domain = null)
|
||||||
{
|
{
|
||||||
if (is_array($domain) && isset($domain['domain'])) {
|
if (!empty($domain)) {
|
||||||
$pdns_domains_stmt = self::getDB()->prepare("SELECT `id`, `name` FROM `domains` WHERE `name` = :domain");
|
$pdns_domains_stmt = self::getDB()->prepare("SELECT `id`, `name` FROM `domains` WHERE `name` = :domain");
|
||||||
$del_rec_stmt = self::getDB()->prepare("DELETE FROM `records` WHERE `domain_id` = :did");
|
$del_rec_stmt = self::getDB()->prepare("DELETE FROM `records` WHERE `domain_id` = :did");
|
||||||
$del_meta_stmt = self::getDB()->prepare("DELETE FROM `domainmetadata` WHERE `domain_id` = :did");
|
$del_meta_stmt = self::getDB()->prepare("DELETE FROM `domainmetadata` WHERE `domain_id` = :did");
|
||||||
$del_dom_stmt = self::getDB()->prepare("DELETE FROM `domains` WHERE `id` = :did");
|
$del_dom_stmt = self::getDB()->prepare("DELETE FROM `domains` WHERE `id` = :did");
|
||||||
|
|
||||||
$pdns_domains_stmt->execute([
|
$pdns_domains_stmt->execute([
|
||||||
'domain' => $domain['domain']
|
'domain' => $domain
|
||||||
]);
|
]);
|
||||||
$pdns_domain = $pdns_domains_stmt->fetch(PDO::FETCH_ASSOC);
|
$pdns_domain = $pdns_domains_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ class Domain
|
|||||||
$upd_stmt = Database::prepare("UPDATE
|
$upd_stmt = Database::prepare("UPDATE
|
||||||
`" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
`" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
||||||
SET
|
SET
|
||||||
`expirationdate` = null
|
`validtodate` = null
|
||||||
WHERE
|
WHERE
|
||||||
domainid = :domainid
|
domainid = :domainid
|
||||||
");
|
");
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ final class Froxlor
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Main version variable
|
// Main version variable
|
||||||
const VERSION = '2.0.12';
|
const VERSION = '2.0.14';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
const DBVERSION = '202302030';
|
const DBVERSION = '202303150';
|
||||||
|
|
||||||
// Distribution branding-tag (used for Debian etc.)
|
// Distribution branding-tag (used for Debian etc.)
|
||||||
const BRANDING = '';
|
const BRANDING = '';
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class Install
|
|||||||
public $phpVersion;
|
public $phpVersion;
|
||||||
public $formfield;
|
public $formfield;
|
||||||
public string $requiredVersion = '7.4.0';
|
public string $requiredVersion = '7.4.0';
|
||||||
public array $requiredExtensions = ['session', 'ctype', 'xml', 'filter', 'posix', 'mbstring', 'curl', 'gmp', 'json'];
|
public array $requiredExtensions = ['session', 'ctype', 'xml', 'filter', 'posix', 'mbstring', 'curl', 'gmp', 'json', 'gd'];
|
||||||
public array $suggestedExtensions = ['bcmath', 'zip'];
|
public array $suggestedExtensions = ['bcmath', 'zip'];
|
||||||
public array $suggestions = [];
|
public array $suggestions = [];
|
||||||
public array $criticals = [];
|
public array $criticals = [];
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ class MailLogParser
|
|||||||
// Parse MDA traffic
|
// Parse MDA traffic
|
||||||
if (Settings::Get("system.mdaserver") == "dovecot") {
|
if (Settings::Get("system.mdaserver") == "dovecot") {
|
||||||
$this->parseDovecotLog(Settings::Get("system.mdalog"));
|
$this->parseDovecotLog(Settings::Get("system.mdalog"));
|
||||||
$this->parsePostfixLog(Settings::Get("system.mdalog") . ".1");
|
$this->parseDovecotLog(Settings::Get("system.mdalog") . ".1");
|
||||||
} elseif (Settings::Get("system.mdaserver") == "courier") {
|
} elseif (Settings::Get("system.mdaserver") == "courier") {
|
||||||
$this->parseCourierLog(Settings::Get("system.mdalog"));
|
$this->parseCourierLog(Settings::Get("system.mdalog"));
|
||||||
$this->parsePostfixLog(Settings::Get("system.mdalog") . ".1");
|
$this->parseCourierLog(Settings::Get("system.mdalog") . ".1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ class PhpHelper
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function sizeReadable(
|
public static function sizeReadable(
|
||||||
int $size,
|
$size,
|
||||||
?string $max = '',
|
?string $max = '',
|
||||||
string $system = 'si',
|
string $system = 'si',
|
||||||
string $retstring = '%01.2f %s'
|
string $retstring = '%01.2f %s'
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace Froxlor;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
use Froxlor\UI\Form;
|
use Froxlor\UI\Form;
|
||||||
|
use Froxlor\Validate\Validate;
|
||||||
use PDO;
|
use PDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -159,6 +160,9 @@ class SImExporter
|
|||||||
// re-format the array-key for Form::processForm
|
// re-format the array-key for Form::processForm
|
||||||
foreach ($_data as $key => $value) {
|
foreach ($_data as $key => $value) {
|
||||||
$index_split = explode('.', $key, 3);
|
$index_split = explode('.', $key, 3);
|
||||||
|
if (!isset($current_settings[$index_split[0]][$index_split[1]])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (isset($index_split[2]) && $index_split[2] === 'image_data' && !empty($_data[$index_split[0] . '.' . $index_split[1]])) {
|
if (isset($index_split[2]) && $index_split[2] === 'image_data' && !empty($_data[$index_split[0] . '.' . $index_split[1]])) {
|
||||||
$image_data[$key] = $value;
|
$image_data[$key] = $value;
|
||||||
} else {
|
} else {
|
||||||
@@ -190,42 +194,27 @@ class SImExporter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$img_data = base64_decode($value);
|
if (Validate::validateBase64Image($value)) {
|
||||||
$img_filename = Froxlor::getInstallDir() . '/' . str_replace('../', '',
|
$img_data = base64_decode($value);
|
||||||
explode('?', $_data[$index_split[0] . '.' . $index_split[1]], 2)[0]);
|
$img_filename = explode('?', $_data[$index_split[0] . '.' . $index_split[1]], 2)[0];
|
||||||
|
|
||||||
file_put_contents($img_filename, $img_data);
|
$spl = explode('.', $img_filename);
|
||||||
|
$file_extension = strtolower(array_pop($spl));
|
||||||
|
unset($spl);
|
||||||
|
|
||||||
if (function_exists('finfo_open')) {
|
if (!in_array($file_extension, [
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
'jpeg',
|
||||||
$mimetype = finfo_file($finfo, $img_filename);
|
'jpg',
|
||||||
finfo_close($finfo);
|
'png',
|
||||||
} else {
|
'gif'
|
||||||
$mimetype = mime_content_type($img_filename);
|
])) {
|
||||||
|
throw new Exception("Invalid file-extension, use one of: jpeg, jpg, png, gif");
|
||||||
|
}
|
||||||
|
$img_filename = 'img/' . bin2hex(random_bytes(16)) . '.' . $file_extension;
|
||||||
|
file_put_contents(Froxlor::getInstallDir() . '/' . $img_filename, $img_data);
|
||||||
|
$img_index = $index_split[0].'.'.$index_split[1];
|
||||||
|
Settings::Set($img_index, $img_filename . '?v=' . time());
|
||||||
}
|
}
|
||||||
if (empty($mimetype)) {
|
|
||||||
$mimetype = 'application/octet-stream';
|
|
||||||
}
|
|
||||||
if (!in_array($mimetype, ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'])) {
|
|
||||||
@unlink($img_filename);
|
|
||||||
throw new Exception("Uploaded file is not a valid image");
|
|
||||||
}
|
|
||||||
|
|
||||||
$spl = explode('.', $img_filename);
|
|
||||||
$file_extension = strtolower(array_pop($spl));
|
|
||||||
unset($spl);
|
|
||||||
|
|
||||||
if (!in_array($file_extension, [
|
|
||||||
'jpeg',
|
|
||||||
'jpg',
|
|
||||||
'png',
|
|
||||||
'gif'
|
|
||||||
])) {
|
|
||||||
@unlink($img_filename);
|
|
||||||
throw new Exception("Invalid file-extension, use one of: jpeg, jpg, png, gif");
|
|
||||||
}
|
|
||||||
|
|
||||||
Settings::Set($index, $value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// all good
|
// all good
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ use Froxlor\PhpHelper;
|
|||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
use Froxlor\System\Cronjob;
|
use Froxlor\System\Cronjob;
|
||||||
use Froxlor\System\IPTools;
|
use Froxlor\System\IPTools;
|
||||||
|
use Froxlor\Validate\Validate;
|
||||||
use PDO;
|
use PDO;
|
||||||
|
|
||||||
class Store
|
class Store
|
||||||
@@ -45,10 +46,21 @@ class Store
|
|||||||
{
|
{
|
||||||
$returnvalue = self::storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
$returnvalue = self::storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||||
|
|
||||||
if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'le_froxlor_enabled' && $newfieldvalue == '0') {
|
if ($returnvalue !== false
|
||||||
Database::query("
|
&& is_array($fielddata)
|
||||||
DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = '0'
|
&& isset($fielddata['settinggroup'])
|
||||||
");
|
&& $fielddata['settinggroup'] == 'system'
|
||||||
|
&& isset($fielddata['varname'])
|
||||||
|
) {
|
||||||
|
if ($fielddata['varname'] == 'le_froxlor_enabled' && $newfieldvalue == '0') {
|
||||||
|
Database::query("
|
||||||
|
DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = '0'
|
||||||
|
");
|
||||||
|
} elseif ($fielddata['varname'] == 'froxloraliases' && $newfieldvalue != $fielddata['value']) {
|
||||||
|
Database::query("
|
||||||
|
UPDATE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` SET `validtodate`= NULL WHERE `domainid` = '0'
|
||||||
|
");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
@@ -415,40 +427,30 @@ class Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure mime-type matches an image
|
// Make sure mime-type matches an image
|
||||||
if (function_exists('finfo_open')) {
|
$image_content = file_get_contents($_FILES[$fieldname]['tmp_name']);
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$value = base64_encode($image_content);
|
||||||
$mimetype = finfo_file($finfo, $_FILES[$fieldname]['tmp_name']);
|
if (Validate::validateBase64Image($value)) {
|
||||||
finfo_close($finfo);
|
$img_filename = $_FILES[$fieldname]['name'];
|
||||||
} else {
|
|
||||||
$mimetype = mime_content_type($_FILES[$fieldname]['tmp_name']);
|
|
||||||
}
|
|
||||||
if (empty($mimetype)) {
|
|
||||||
$mimetype = 'application/octet-stream';
|
|
||||||
}
|
|
||||||
if (!in_array($mimetype, ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'])) {
|
|
||||||
throw new \Exception("Uploaded file is not a valid image");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine file extension
|
$spl = explode('.', $img_filename);
|
||||||
$spl = explode('.', $_FILES[$fieldname]['name']);
|
$file_extension = strtolower(array_pop($spl));
|
||||||
$file_extension = strtolower(array_pop($spl));
|
unset($spl);
|
||||||
unset($spl);
|
|
||||||
|
|
||||||
if (!in_array($file_extension, [
|
if (!in_array($file_extension, [
|
||||||
'jpeg',
|
'jpeg',
|
||||||
'jpg',
|
'jpg',
|
||||||
'png',
|
'png',
|
||||||
'gif'
|
'gif'
|
||||||
])) {
|
])) {
|
||||||
throw new Exception("Invalid file-extension, use one of: jpeg, jpg, png, gif");
|
throw new Exception("Invalid file-extension, use one of: jpeg, jpg, png, gif");
|
||||||
|
}
|
||||||
|
$filename = bin2hex(random_bytes(16)) . '.' . $file_extension;
|
||||||
|
// Move file
|
||||||
|
if (!move_uploaded_file($_FILES[$fieldname]['tmp_name'], $path . $filename)) {
|
||||||
|
throw new Exception("Unable to save image to img folder");
|
||||||
|
}
|
||||||
|
$save_to = 'img/' . $filename . '?v=' . time();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move file
|
|
||||||
if (!move_uploaded_file($_FILES[$fieldname]['tmp_name'], $path . $fielddata['image_name'] . '.' . $file_extension)) {
|
|
||||||
throw new Exception("Unable to save image to img folder");
|
|
||||||
}
|
|
||||||
|
|
||||||
$save_to = 'img/' . $fielddata['image_name'] . '.' . $file_extension . '?v=' . time();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete file?
|
// Delete file?
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class Crypt
|
|||||||
$update_hash = true;
|
$update_hash = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pwd_hash == $pwd_check || password_verify($password, $pwd_hash)) {
|
if ($pwd_hash === $pwd_check || password_verify($password, $pwd_hash)) {
|
||||||
// check for update of hash (only if our database is ready to handle the bigger string)
|
// check for update of hash (only if our database is ready to handle the bigger string)
|
||||||
$is_ready = Froxlor::versionCompare2("0.9.33", Froxlor::getVersion()) <= 0;
|
$is_ready = Froxlor::versionCompare2("0.9.33", Froxlor::getVersion()) <= 0;
|
||||||
if ((password_needs_rehash($pwd_hash, $algo) || $update_hash) && $is_ready) {
|
if ((password_needs_rehash($pwd_hash, $algo) || $update_hash) && $is_ready) {
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ class Pagination
|
|||||||
}
|
}
|
||||||
if (!empty($this->searchtext) && !empty($this->searchfield)) {
|
if (!empty($this->searchtext) && !empty($this->searchfield)) {
|
||||||
$this->addSearch($this->searchtext, $this->searchfield);
|
$this->addSearch($this->searchtext, $this->searchfield);
|
||||||
|
$pagination_additional_params[] = 'searchfield=' . $this->searchfield;
|
||||||
|
$pagination_additional_params[] = 'searchtext=' . $this->searchtext;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check other ordering requests
|
// check other ordering requests
|
||||||
|
|||||||
@@ -92,21 +92,11 @@ class UI
|
|||||||
*/
|
*/
|
||||||
public static function sendHeaders()
|
public static function sendHeaders()
|
||||||
{
|
{
|
||||||
if (empty($_SERVER['HTTP_HOST'])) {
|
$cookie_host = empty($_SERVER['HTTP_HOST']) ? null : explode (':', $_SERVER['HTTP_HOST'])[0];
|
||||||
if (!self::$install_mode) {
|
|
||||||
// fallback to set hostname in settings
|
|
||||||
$_SERVER['HTTP_HOST'] = Settings::Get('system.hostname');
|
|
||||||
} else {
|
|
||||||
// bad request
|
|
||||||
http_response_code(400);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
session_set_cookie_params([
|
session_set_cookie_params([
|
||||||
'lifetime' => self::$install_mode ? 7200 : 600, // will be renewed based on settings in lib/init.php
|
'lifetime' => self::$install_mode ? 7200 : 600, // will be renewed based on settings in lib/init.php
|
||||||
'path' => '/',
|
'path' => '/',
|
||||||
'domain' => explode(':', $_SERVER['HTTP_HOST'])[0],
|
'domain' => $cookie_host,
|
||||||
'secure' => self::requestIsHttps(),
|
'secure' => self::requestIsHttps(),
|
||||||
'httponly' => true,
|
'httponly' => true,
|
||||||
'samesite' => 'Strict'
|
'samesite' => 'Strict'
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ class Check
|
|||||||
*/
|
*/
|
||||||
public static function checkLocalGroup($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
public static function checkLocalGroup($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
||||||
{
|
{
|
||||||
if (empty($newfieldvalue) || $fielddata == $newfieldvalue) {
|
if (empty($newfieldvalue) || $fielddata['value'] == $newfieldvalue) {
|
||||||
$returnvalue = [
|
$returnvalue = [
|
||||||
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -334,4 +334,40 @@ class Validate
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* validates whether a given base64 string decodes to an image
|
||||||
|
*
|
||||||
|
* @param string $base64string
|
||||||
|
* @return bool
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static function validateBase64Image(string $base64string) {
|
||||||
|
|
||||||
|
if (!extension_loaded('gd')) {
|
||||||
|
Response::standardError('phpgdextensionnotavailable', null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decode the base64 string
|
||||||
|
$data = base64_decode($base64string);
|
||||||
|
|
||||||
|
// Create an image from the decoded data
|
||||||
|
$image = @imagecreatefromstring($data);
|
||||||
|
|
||||||
|
// Check if the image was created successfully
|
||||||
|
if (!$image) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the MIME type of the image
|
||||||
|
$mime = image_type_to_mime_type(getimagesizefromstring($data)[2]);
|
||||||
|
|
||||||
|
// Check if the MIME type is a valid image MIME type
|
||||||
|
if (strpos($mime, 'image/') !== 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If everything is okay, return true
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4599,6 +4599,7 @@ UPLOADGID=
|
|||||||
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
||||||
|
<command><![CDATA[rm /etc/logrotate.d/httpd-prerotate/awstats]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- libnss-extrausers -->
|
<!-- libnss-extrausers -->
|
||||||
<daemon name="libnssextrausers"
|
<daemon name="libnssextrausers"
|
||||||
|
|||||||
@@ -3241,6 +3241,7 @@ UPLOADGID=
|
|||||||
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
||||||
|
<command><![CDATA[rm /etc/logrotate.d/httpd-prerotate/awstats]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- libnss-extrausers -->
|
<!-- libnss-extrausers -->
|
||||||
<daemon name="libnssextrausers"
|
<daemon name="libnssextrausers"
|
||||||
|
|||||||
@@ -4811,6 +4811,7 @@ UPLOADGID=
|
|||||||
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
||||||
|
<command><![CDATA[rm /etc/logrotate.d/httpd-prerotate/awstats]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- libnss-extrausers -->
|
<!-- libnss-extrausers -->
|
||||||
<daemon name="libnssextrausers"
|
<daemon name="libnssextrausers"
|
||||||
|
|||||||
@@ -4802,6 +4802,7 @@ UPLOADGID=
|
|||||||
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
||||||
|
<command><![CDATA[rm /etc/logrotate.d/httpd-prerotate/awstats]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- libnss-extrausers -->
|
<!-- libnss-extrausers -->
|
||||||
<daemon name="libnssextrausers"
|
<daemon name="libnssextrausers"
|
||||||
|
|||||||
@@ -4030,6 +4030,7 @@ UPLOADGID=
|
|||||||
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
||||||
|
<command><![CDATA[rm /etc/logrotate.d/httpd-prerotate/awstats]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- libnss-extrausers -->
|
<!-- libnss-extrausers -->
|
||||||
<daemon name="libnssextrausers"
|
<daemon name="libnssextrausers"
|
||||||
|
|||||||
@@ -4022,6 +4022,7 @@ UPLOADGID=
|
|||||||
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
||||||
|
<command><![CDATA[rm /etc/logrotate.d/httpd-prerotate/awstats]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- libnss-extrausers -->
|
<!-- libnss-extrausers -->
|
||||||
<daemon name="libnssextrausers"
|
<daemon name="libnssextrausers"
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ return [
|
|||||||
'ssl_protocols' => [
|
'ssl_protocols' => [
|
||||||
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') != 'lighttpd',
|
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') != 'lighttpd',
|
||||||
'label' => lng('serversettings.ssl.ssl_protocols.title'),
|
'label' => lng('serversettings.ssl.ssl_protocols.title'),
|
||||||
'desc' => lng('serversettings.ssl.ssl_protocols.description'),
|
'desc' => lng('serversettings.ssl.ssl_protocols.description').lng('admin.domain_override_tls_addinfo'),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => [
|
'value' => [
|
||||||
'TLSv1.2'
|
'TLSv1.2'
|
||||||
@@ -278,14 +278,14 @@ return [
|
|||||||
'ssl_cipher_list' => [
|
'ssl_cipher_list' => [
|
||||||
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1',
|
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1',
|
||||||
'label' => lng('serversettings.ssl.ssl_cipher_list.title'),
|
'label' => lng('serversettings.ssl.ssl_cipher_list.title'),
|
||||||
'desc' => lng('serversettings.ssl.ssl_cipher_list.description'),
|
'desc' => lng('serversettings.ssl.ssl_cipher_list.description').lng('admin.domain_override_tls_addinfo'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'value' => Settings::Get('system.ssl_cipher_list')
|
'value' => Settings::Get('system.ssl_cipher_list')
|
||||||
],
|
],
|
||||||
'tlsv13_cipher_list' => [
|
'tlsv13_cipher_list' => [
|
||||||
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1,
|
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1,
|
||||||
'label' => lng('serversettings.ssl.tlsv13_cipher_list.title'),
|
'label' => lng('serversettings.ssl.tlsv13_cipher_list.title'),
|
||||||
'desc' => lng('serversettings.ssl.tlsv13_cipher_list.description'),
|
'desc' => lng('serversettings.ssl.tlsv13_cipher_list.description').lng('admin.domain_override_tls_addinfo'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'value' => Settings::Get('system.tlsv13_cipher_list')
|
'value' => Settings::Get('system.tlsv13_cipher_list')
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ return [
|
|||||||
'ssl_protocols' => [
|
'ssl_protocols' => [
|
||||||
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') != 'lighttpd',
|
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') != 'lighttpd',
|
||||||
'label' => lng('serversettings.ssl.ssl_protocols.title'),
|
'label' => lng('serversettings.ssl.ssl_protocols.title'),
|
||||||
'desc' => lng('serversettings.ssl.ssl_protocols.description'),
|
'desc' => lng('serversettings.ssl.ssl_protocols.description').lng('admin.domain_override_tls_addinfo'),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => !empty($result['ssl_protocols']) ? explode(",", $result['ssl_protocols']) : explode(",", Settings::Get('system.ssl_protocols')),
|
'value' => !empty($result['ssl_protocols']) ? explode(",", $result['ssl_protocols']) : explode(",", Settings::Get('system.ssl_protocols')),
|
||||||
'values' => [
|
'values' => [
|
||||||
@@ -303,14 +303,14 @@ return [
|
|||||||
'ssl_cipher_list' => [
|
'ssl_cipher_list' => [
|
||||||
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1',
|
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1',
|
||||||
'label' => lng('serversettings.ssl.ssl_cipher_list.title'),
|
'label' => lng('serversettings.ssl.ssl_cipher_list.title'),
|
||||||
'desc' => lng('serversettings.ssl.ssl_cipher_list.description'),
|
'desc' => lng('serversettings.ssl.ssl_cipher_list.description').lng('admin.domain_override_tls_addinfo'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'value' => !empty($result['ssl_cipher_list']) ? $result['ssl_cipher_list'] : Settings::Get('system.ssl_cipher_list')
|
'value' => !empty($result['ssl_cipher_list']) ? $result['ssl_cipher_list'] : Settings::Get('system.ssl_cipher_list')
|
||||||
],
|
],
|
||||||
'tlsv13_cipher_list' => [
|
'tlsv13_cipher_list' => [
|
||||||
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1,
|
'visible' => !empty($ssl_ipsandports) && $userinfo['change_serversettings'] == '1' && Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1,
|
||||||
'label' => lng('serversettings.ssl.tlsv13_cipher_list.title'),
|
'label' => lng('serversettings.ssl.tlsv13_cipher_list.title'),
|
||||||
'desc' => lng('serversettings.ssl.tlsv13_cipher_list.description'),
|
'desc' => lng('serversettings.ssl.tlsv13_cipher_list.description').lng('admin.domain_override_tls_addinfo'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'value' => !empty($result['tlsv13_cipher_list']) ? $result['tlsv13_cipher_list'] : Settings::Get('system.tlsv13_cipher_list')
|
'value' => !empty($result['tlsv13_cipher_list']) ? $result['tlsv13_cipher_list'] : Settings::Get('system.tlsv13_cipher_list')
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ return [
|
|||||||
'value' => '5s'
|
'value' => '5s'
|
||||||
],
|
],
|
||||||
'phpfpm_pass_authorizationheader' => [
|
'phpfpm_pass_authorizationheader' => [
|
||||||
'visible' => Settings::Get('phpfpm.enabled') == 1 && Settings::Get('system.webserver') == "apache2",
|
'visible' => Settings::Get('system.webserver') == "apache2",
|
||||||
'label' => lng('admin.phpsettings.pass_authorizationheader'),
|
'label' => lng('admin.phpsettings.pass_authorizationheader'),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ return [
|
|||||||
'value' => $result['fpm_reqslow']
|
'value' => $result['fpm_reqslow']
|
||||||
],
|
],
|
||||||
'phpfpm_pass_authorizationheader' => [
|
'phpfpm_pass_authorizationheader' => [
|
||||||
'visible' => Settings::Get('phpfpm.enabled') == 1 && Settings::Get('system.webserver') == "apache2",
|
'visible' => Settings::Get('system.webserver') == "apache2",
|
||||||
'label' => lng('admin.phpsettings.pass_authorizationheader'),
|
'label' => lng('admin.phpsettings.pass_authorizationheader'),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
|
|||||||
@@ -23,11 +23,13 @@
|
|||||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$email_domainid ?: 0;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'emails_add' => [
|
'emails_add' => [
|
||||||
'title' => lng('emails.emails_add'),
|
'title' => lng('emails.emails_add'),
|
||||||
'image' => 'fa-solid fa-plus',
|
'image' => 'fa-solid fa-plus',
|
||||||
'self_overview' => ['section' => 'email', 'page' => 'email_domain', 'domainid' => $email_domainid ?: 0],
|
'self_overview' => ['section' => 'email', 'page' => $email_domainid != 0 ? 'email_domain' : 'emails', 'domainid' => $email_domainid],
|
||||||
'sections' => [
|
'sections' => [
|
||||||
'section_a' => [
|
'section_a' => [
|
||||||
'title' => lng('emails.emails_add'),
|
'title' => lng('emails.emails_add'),
|
||||||
@@ -40,7 +42,8 @@ return [
|
|||||||
'domain' => [
|
'domain' => [
|
||||||
'next_to_prefix' => '@',
|
'next_to_prefix' => '@',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $domains
|
'select_var' => $domains,
|
||||||
|
'selected' => $selected_domain
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -25,6 +25,13 @@
|
|||||||
|
|
||||||
use Froxlor\Froxlor;
|
use Froxlor\Froxlor;
|
||||||
|
|
||||||
|
$httpuser = '';
|
||||||
|
$httpgroup = '';
|
||||||
|
if (extension_loaded('posix')) {
|
||||||
|
$httpuser = posix_getpwuid(posix_getuid())['name'] ?? '';
|
||||||
|
$httpgroup = posix_getgrgid(posix_getgid())['name'] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'install' => [
|
'install' => [
|
||||||
'title' => 'install',
|
'title' => 'install',
|
||||||
@@ -194,7 +201,7 @@ return [
|
|||||||
'placeholder' => lng('admin.webserver_user'),
|
'placeholder' => lng('admin.webserver_user'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'mandatory' => true,
|
'mandatory' => true,
|
||||||
'value' => old('httpuser', posix_getpwuid(posix_getuid())['name'] ?? '', 'installation'),
|
'value' => old('httpuser', $httpuser, 'installation'),
|
||||||
'advanced' => true,
|
'advanced' => true,
|
||||||
],
|
],
|
||||||
'httpgroup' => [
|
'httpgroup' => [
|
||||||
@@ -202,7 +209,7 @@ return [
|
|||||||
'placeholder' => lng('admin.webserver_group'),
|
'placeholder' => lng('admin.webserver_group'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'mandatory' => true,
|
'mandatory' => true,
|
||||||
'value' => old('httpgroup', posix_getgrgid(posix_getgid())['name'] ?? '', 'installation'),
|
'value' => old('httpgroup', $httpgroup, 'installation'),
|
||||||
'advanced' => true,
|
'advanced' => true,
|
||||||
],
|
],
|
||||||
'activate_newsfeed' => [
|
'activate_newsfeed' => [
|
||||||
|
|||||||
@@ -329,10 +329,11 @@ if (CurrentUser::hasSession()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update cookie lifetime
|
// update cookie lifetime
|
||||||
|
$cookie_host = empty($_SERVER['HTTP_HOST']) ? null : explode (':', $_SERVER['HTTP_HOST'])[0];
|
||||||
$cookie_params = [
|
$cookie_params = [
|
||||||
'expires' => time() + Settings::Get('session.sessiontimeout'),
|
'expires' => time() + Settings::Get('session.sessiontimeout'),
|
||||||
'path' => '/',
|
'path' => '/',
|
||||||
'domain' => explode(':', $_SERVER['HTTP_HOST'])[0],
|
'domain' => $cookie_host,
|
||||||
'secure' => UI::requestIsHttps(),
|
'secure' => UI::requestIsHttps(),
|
||||||
'httponly' => true,
|
'httponly' => true,
|
||||||
'samesite' => 'Strict'
|
'samesite' => 'Strict'
|
||||||
|
|||||||
@@ -45,30 +45,27 @@ return [
|
|||||||
'callback' => [SSLCertificate::class, 'domainWithSan'],
|
'callback' => [SSLCertificate::class, 'domainWithSan'],
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
],
|
],
|
||||||
'c.issuer' => [
|
's.issuer' => [
|
||||||
'label' => lng('ssl_certificates.issuer'),
|
'label' => lng('ssl_certificates.issuer'),
|
||||||
'field' => 'issuer',
|
'field' => 'issuer',
|
||||||
'searchable' => false,
|
|
||||||
],
|
],
|
||||||
'c.validfromdate' => [
|
's.validfromdate' => [
|
||||||
'label' => lng('ssl_certificates.valid_from'),
|
'label' => lng('ssl_certificates.valid_from'),
|
||||||
'field' => 'validfromdate',
|
'field' => 'validfromdate',
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
'sortable' => false,
|
|
||||||
],
|
],
|
||||||
'c.validtodate' => [
|
's.validtodate' => [
|
||||||
'label' => lng('ssl_certificates.valid_until'),
|
'label' => lng('ssl_certificates.valid_until'),
|
||||||
'field' => 'validtodate',
|
'field' => 'validtodate',
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
'sortable' => false,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'visible_columns' => Listing::getVisibleColumnsForListing('sslcertificates_list', [
|
'visible_columns' => Listing::getVisibleColumnsForListing('sslcertificates_list', [
|
||||||
'd.domain',
|
'd.domain',
|
||||||
'c.domain',
|
'c.domain',
|
||||||
'c.issuer',
|
's.issuer',
|
||||||
'c.validfromdate',
|
's.validfromdate',
|
||||||
'c.validtodate',
|
's.validtodate',
|
||||||
]),
|
]),
|
||||||
'actions' => [
|
'actions' => [
|
||||||
'edit' => [
|
'edit' => [
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ return [
|
|||||||
'nl' => 'Niederländisch',
|
'nl' => 'Niederländisch',
|
||||||
'pt' => 'Portugiesisch',
|
'pt' => 'Portugiesisch',
|
||||||
'se' => 'Schwedisch',
|
'se' => 'Schwedisch',
|
||||||
|
'es' => 'Spanisch',
|
||||||
],
|
],
|
||||||
'2fa' => [
|
'2fa' => [
|
||||||
'2fa' => '2FA Optionen',
|
'2fa' => '2FA Optionen',
|
||||||
@@ -297,7 +298,7 @@ return [
|
|||||||
'request_terminate_timeout' => 'request_terminate_timeout',
|
'request_terminate_timeout' => 'request_terminate_timeout',
|
||||||
'request_slowlog_timeout' => 'request_slowlog_timeout',
|
'request_slowlog_timeout' => 'request_slowlog_timeout',
|
||||||
'activephpconfigs' => 'In Verwendung für PHP-Konfiguration(en)',
|
'activephpconfigs' => 'In Verwendung für PHP-Konfiguration(en)',
|
||||||
'pass_authorizationheader' => 'Füge "-pass-header Authorization" / "CGIPassAuth On" in Vhosts ein',
|
'pass_authorizationheader' => 'Übergeben von HTTP AUTH BASIC/DIGEST-Headern von Apache an PHP',
|
||||||
],
|
],
|
||||||
'misc' => 'Sonstiges',
|
'misc' => 'Sonstiges',
|
||||||
'fpmsettings' => [
|
'fpmsettings' => [
|
||||||
@@ -454,6 +455,7 @@ return [
|
|||||||
'novhostcontainer' => '<br><br><small class="text-danger">Keine der IPs und Ports hat die Option "Erstelle vHost-Container" aktiviert, einige Einstellungen sind daher nicht verfügbar.</small>',
|
'novhostcontainer' => '<br><br><small class="text-danger">Keine der IPs und Ports hat die Option "Erstelle vHost-Container" aktiviert, einige Einstellungen sind daher nicht verfügbar.</small>',
|
||||||
'ownsslvhostsettings' => 'Eigene SSL vHost-Einstellungen',
|
'ownsslvhostsettings' => 'Eigene SSL vHost-Einstellungen',
|
||||||
'domain_override_tls' => 'Überschreibe System TLS Einstellungen',
|
'domain_override_tls' => 'Überschreibe System TLS Einstellungen',
|
||||||
|
'domain_override_tls_addinfo' => '<br /><span class="text-danger">Nur verwendet wenn "Überschreibe System TLS Einstellungen" auf "Ja" gestellt ist</span>',
|
||||||
'domain_sslenabled' => 'Aktiviere Nutzung von SSL',
|
'domain_sslenabled' => 'Aktiviere Nutzung von SSL',
|
||||||
'domain_honorcipherorder' => 'Bevorzuge die serverseitige Cipher Reihenfolge, Standardwert <strong>nein</strong>',
|
'domain_honorcipherorder' => 'Bevorzuge die serverseitige Cipher Reihenfolge, Standardwert <strong>nein</strong>',
|
||||||
'domain_sessiontickets' => 'Aktiviere TLS Sessiontickets (RFC 5077), Standardwert <strong>ja</strong>',
|
'domain_sessiontickets' => 'Aktiviere TLS Sessiontickets (RFC 5077), Standardwert <strong>ja</strong>',
|
||||||
@@ -493,7 +495,7 @@ return [
|
|||||||
'key_add' => 'API Key hinzufügen',
|
'key_add' => 'API Key hinzufügen',
|
||||||
'apikey_removed' => 'Der API Key mit der ID #%s wurde erfolgreich gelöscht.',
|
'apikey_removed' => 'Der API Key mit der ID #%s wurde erfolgreich gelöscht.',
|
||||||
'apikey_added' => 'Der neue API Key wurde erfolgreich angelegt.',
|
'apikey_added' => 'Der neue API Key wurde erfolgreich angelegt.',
|
||||||
'clicktoview' => 'API Key Details anzeigen',
|
'clicktoview' => 'Details anzeigen',
|
||||||
'allowed_from' => 'Erlaube Zugriff von',
|
'allowed_from' => 'Erlaube Zugriff von',
|
||||||
'allowed_from_help' => 'Komma getrennte Liste von IPs oder Netzen.<br>Standard ist leer (von überall erlaubt).',
|
'allowed_from_help' => 'Komma getrennte Liste von IPs oder Netzen.<br>Standard ist leer (von überall erlaubt).',
|
||||||
'valid_until' => 'Gültig bis',
|
'valid_until' => 'Gültig bis',
|
||||||
@@ -568,7 +570,6 @@ return [
|
|||||||
'email_quota' => 'E-Mail-Kontingent',
|
'email_quota' => 'E-Mail-Kontingent',
|
||||||
'email_imap' => 'IMAP',
|
'email_imap' => 'IMAP',
|
||||||
'email_pop3' => 'POP3',
|
'email_pop3' => 'POP3',
|
||||||
'mail_quota' => 'E-Mail-Kontingent',
|
|
||||||
'sendinfomail' => 'Daten per E-Mail an mich senden',
|
'sendinfomail' => 'Daten per E-Mail an mich senden',
|
||||||
'generated_pwd' => 'Passwortvorschlag',
|
'generated_pwd' => 'Passwortvorschlag',
|
||||||
'usedmax' => 'Benutzt / Max.',
|
'usedmax' => 'Benutzt / Max.',
|
||||||
@@ -721,6 +722,8 @@ return [
|
|||||||
'quota_edit' => 'E-Mail-Kontingent ändern',
|
'quota_edit' => 'E-Mail-Kontingent ändern',
|
||||||
'noemaildomainaddedyet' => 'Sie haben bisher noch keine (E-Mail-)Domain in Ihrem Konto.',
|
'noemaildomainaddedyet' => 'Sie haben bisher noch keine (E-Mail-)Domain in Ihrem Konto.',
|
||||||
'back_to_overview' => 'Zurück zur Domain-Übersicht',
|
'back_to_overview' => 'Zurück zur Domain-Übersicht',
|
||||||
|
'accounts' => 'Konten',
|
||||||
|
'emails' => 'Adressen',
|
||||||
],
|
],
|
||||||
'error' => [
|
'error' => [
|
||||||
'error' => 'Fehlermeldung',
|
'error' => 'Fehlermeldung',
|
||||||
@@ -922,6 +925,7 @@ return [
|
|||||||
'mysqlserverstillhasdbs' => 'Datenbank-Server kann für den Kunden nicht entfernt werden, da sich dort noch Datenbanken befinden.',
|
'mysqlserverstillhasdbs' => 'Datenbank-Server kann für den Kunden nicht entfernt werden, da sich dort noch Datenbanken befinden.',
|
||||||
'domaincannotbeedited' => 'Keine Berechtigung, um die Domain %s zu bearbeiten',
|
'domaincannotbeedited' => 'Keine Berechtigung, um die Domain %s zu bearbeiten',
|
||||||
'invalidcronjobintervalvalue' => 'Cronjob Intervall muss einer der folgenden Werte sein: %s',
|
'invalidcronjobintervalvalue' => 'Cronjob Intervall muss einer der folgenden Werte sein: %s',
|
||||||
|
'phpgdextensionnotavailable' => 'Die PHP GD Extension ist nicht verfügbar. Bild-Daten können nicht validiert werden.',
|
||||||
],
|
],
|
||||||
'extras' => [
|
'extras' => [
|
||||||
'description' => 'Hier können Sie zusätzliche Extras einrichten, wie zum Beispiel einen Verzeichnisschutz.<br />Die Änderungen sind erst nach einer kurzen Zeit wirksam.',
|
'description' => 'Hier können Sie zusätzliche Extras einrichten, wie zum Beispiel einen Verzeichnisschutz.<br />Die Änderungen sind erst nach einer kurzen Zeit wirksam.',
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ return [
|
|||||||
'nl' => 'Dutch',
|
'nl' => 'Dutch',
|
||||||
'pt' => 'Portuguese',
|
'pt' => 'Portuguese',
|
||||||
'se' => 'Swedish',
|
'se' => 'Swedish',
|
||||||
|
'es' => 'Spanish',
|
||||||
],
|
],
|
||||||
'2fa' => [
|
'2fa' => [
|
||||||
'2fa' => '2FA options',
|
'2fa' => '2FA options',
|
||||||
@@ -302,7 +303,7 @@ return [
|
|||||||
'request_terminate_timeout' => 'Request terminate-timeout',
|
'request_terminate_timeout' => 'Request terminate-timeout',
|
||||||
'request_slowlog_timeout' => 'Request slowlog-timeout',
|
'request_slowlog_timeout' => 'Request slowlog-timeout',
|
||||||
'activephpconfigs' => 'In use for php-config(s)',
|
'activephpconfigs' => 'In use for php-config(s)',
|
||||||
'pass_authorizationheader' => 'Add "-pass-header Authorization" / "CGIPassAuth On" to vhosts',
|
'pass_authorizationheader' => 'Passing HTTP AUTH BASIC/DIGEST headers from Apache to PHP',
|
||||||
],
|
],
|
||||||
'misc' => 'Miscellaneous',
|
'misc' => 'Miscellaneous',
|
||||||
'fpmsettings' => [
|
'fpmsettings' => [
|
||||||
@@ -461,6 +462,7 @@ return [
|
|||||||
'novhostcontainer' => '<br><br><small class="text-danger">None of the IPs and ports has the "Create vHost-Container" option enabled, many settings here will not be available</small>',
|
'novhostcontainer' => '<br><br><small class="text-danger">None of the IPs and ports has the "Create vHost-Container" option enabled, many settings here will not be available</small>',
|
||||||
'ownsslvhostsettings' => 'Own SSL vHost-settings',
|
'ownsslvhostsettings' => 'Own SSL vHost-settings',
|
||||||
'domain_override_tls' => 'Override system TLS settings',
|
'domain_override_tls' => 'Override system TLS settings',
|
||||||
|
'domain_override_tls_addinfo' => '<br /><span class="text-danger">Only used if "Override system TLS settings" is set to "Yes"</span>',
|
||||||
'domain_sslenabled' => 'Enable usage of SSL',
|
'domain_sslenabled' => 'Enable usage of SSL',
|
||||||
'domain_honorcipherorder' => 'Honor the (server) cipher order, default <strong>no</strong>',
|
'domain_honorcipherorder' => 'Honor the (server) cipher order, default <strong>no</strong>',
|
||||||
'domain_sessiontickets' => 'Enable TLS sessiontickets (RFC 5077), default <strong>yes</strong>',
|
'domain_sessiontickets' => 'Enable TLS sessiontickets (RFC 5077), default <strong>yes</strong>',
|
||||||
@@ -613,7 +615,6 @@ return [
|
|||||||
'email_quota' => 'E-mail quota',
|
'email_quota' => 'E-mail quota',
|
||||||
'email_imap' => 'E-mail IMAP',
|
'email_imap' => 'E-mail IMAP',
|
||||||
'email_pop3' => 'E-mail POP3',
|
'email_pop3' => 'E-mail POP3',
|
||||||
'mail_quota' => 'Mailquota',
|
|
||||||
'sendinfomail' => 'Send data via email to me',
|
'sendinfomail' => 'Send data via email to me',
|
||||||
'generated_pwd' => 'Password suggestion',
|
'generated_pwd' => 'Password suggestion',
|
||||||
'usedmax' => 'Used / Max',
|
'usedmax' => 'Used / Max',
|
||||||
@@ -787,6 +788,8 @@ return [
|
|||||||
'quota_edit' => 'Change E-Mail Quota',
|
'quota_edit' => 'Change E-Mail Quota',
|
||||||
'noemaildomainaddedyet' => 'You do not have a (email-)domain in your account yet.',
|
'noemaildomainaddedyet' => 'You do not have a (email-)domain in your account yet.',
|
||||||
'back_to_overview' => 'Back to domain overview',
|
'back_to_overview' => 'Back to domain overview',
|
||||||
|
'accounts' => 'Accounts',
|
||||||
|
'emails' => 'Addresses',
|
||||||
],
|
],
|
||||||
'error' => [
|
'error' => [
|
||||||
'error' => 'Error',
|
'error' => 'Error',
|
||||||
@@ -991,6 +994,7 @@ return [
|
|||||||
'mysqlserverstillhasdbs' => 'Cannot remove database server from customers allow-list as there are still databases on it.',
|
'mysqlserverstillhasdbs' => 'Cannot remove database server from customers allow-list as there are still databases on it.',
|
||||||
'domaincannotbeedited' => 'You are not permitted to edit the domain %s',
|
'domaincannotbeedited' => 'You are not permitted to edit the domain %s',
|
||||||
'invalidcronjobintervalvalue' => 'Cronjob interval must be one of: %s',
|
'invalidcronjobintervalvalue' => 'Cronjob interval must be one of: %s',
|
||||||
|
'phpgdextensionnotavailable' => 'The PHP GD extension is not available. Unable to validate image-data',
|
||||||
],
|
],
|
||||||
'extras' => [
|
'extras' => [
|
||||||
'description' => 'Here you can add some extras, for example directory protection.<br />The system will need some time to apply the new settings after every change.',
|
'description' => 'Here you can add some extras, for example directory protection.<br />The system will need some time to apply the new settings after every change.',
|
||||||
|
|||||||
2405
lng/es.lng.php
Normal file
2405
lng/es.lng.php
Normal file
File diff suppressed because it is too large
Load Diff
1802
package-lock.json
generated
1802
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
<a href="{{ link|default('#')|raw }}" class="list-group-item list-group-item-action">
|
<a href="{{ link|default('#')|raw }}" class="list-group-item list-group-item-action" target="_blank">
|
||||||
<div class="d-flex w-100 justify-content-between">
|
<div class="d-flex w-100 justify-content-between">
|
||||||
<b class="mb-1">{{ title }}</b>
|
<b class="mb-1">{{ title }}</b>
|
||||||
{% if date is not empty %}
|
{% if date is not empty %}
|
||||||
|
|||||||
Reference in New Issue
Block a user