Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb2db0fed0 | ||
|
|
9680f24640 | ||
|
|
c732fbd81b | ||
|
|
7980b8d14d | ||
|
|
13e88f5b47 | ||
|
|
031596301b | ||
|
|
b34ab45746 | ||
|
|
dbf83c6f24 | ||
|
|
4cb974839c | ||
|
|
1fa714ef2c | ||
|
|
63bbcd4e00 | ||
|
|
49d67d7c27 | ||
|
|
7cc4c9fedb | ||
|
|
afd110a6ed | ||
|
|
7cdf6c8d64 | ||
|
|
60621da243 | ||
|
|
96ccdda304 | ||
|
|
4073984fd7 | ||
|
|
ea31c8a64d | ||
|
|
832ee07e0e | ||
|
|
b542b140c6 | ||
|
|
ac89fc7120 | ||
|
|
150858485d | ||
|
|
e7810e2066 | ||
|
|
4879446567 | ||
|
|
43eff78088 | ||
|
|
55a2ae3801 | ||
|
|
a3b0332d13 | ||
|
|
4b1846883d | ||
|
|
778fd3ba65 | ||
|
|
00456a35e5 | ||
|
|
5958f0516b | ||
|
|
166ffedf04 | ||
|
|
36dfee1263 | ||
|
|
ec0026ecfd | ||
|
|
a721bb3f21 | ||
|
|
83de3dd719 | ||
|
|
5615decd96 | ||
|
|
0348b1ec7e | ||
|
|
1467dab58f | ||
|
|
3a8f48de35 | ||
|
|
46391c06ec | ||
|
|
7103f7dd51 | ||
|
|
9fc1dfee41 | ||
|
|
82dc76fdc6 | ||
|
|
02ae52e3df |
3
.github/workflows/build-docs.yml
vendored
3
.github/workflows/build-docs.yml
vendored
@@ -2,7 +2,8 @@ name: build-documentation
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
# only run for stable releases
|
||||
types: [released]
|
||||
|
||||
jobs:
|
||||
build_docs:
|
||||
|
||||
2
.github/workflows/build-mariadb.yml
vendored
2
.github/workflows/build-mariadb.yml
vendored
@@ -53,7 +53,7 @@ jobs:
|
||||
name: Create nightly/testing tarball
|
||||
runs-on: ubuntu-latest
|
||||
needs: froxlor
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -10,7 +10,8 @@ With that, good luck hacking us ;)
|
||||
|
||||
## Supported versions
|
||||
|
||||
- ️✅ **2.1.x** (`main` git-branch)
|
||||
- ️✅ **2.2.x** (`main` git-branch)
|
||||
- ️✅ **2.1.x** (`v2.1` git-branch)
|
||||
- ❌ 2.0.x (`2.0.x`-tags)
|
||||
- ❌ 0.10.x (`0.10.x`-tags)
|
||||
- ❌ other git-branches
|
||||
|
||||
@@ -248,7 +248,7 @@ return [
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'le_domain_dnscheck_resolver',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^(([0-9]+ [a-z0-9\-\._]+, ?)*[0-9]+ [a-z0-9\-\._]+)?$/i',
|
||||
'string_type' => 'validate_ip',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
|
||||
@@ -60,7 +60,9 @@ if ($userinfo['change_serversettings'] == '1') {
|
||||
|
||||
if (!empty($distribution)) {
|
||||
if (!file_exists($config_dir . '/' . $distribution . ".xml")) {
|
||||
Response::dynamicError("Unknown distribution");
|
||||
// unknown distribution -> redirect to select a valid distribution for config-templates
|
||||
Settings::Set('system.distribution', '');
|
||||
Response::redirectTo('admin_configfiles.php', ['reselect' => 1]);
|
||||
}
|
||||
|
||||
// update setting if different
|
||||
|
||||
@@ -43,7 +43,12 @@ require dirname(__DIR__) . '/lib/tables.inc.php';
|
||||
$application = new Application('froxlor-cli', Froxlor::getFullVersion());
|
||||
|
||||
// files that are no commands
|
||||
$fileIgnoreList = ['CliCommand.php', 'index.html', 'install.functions.php'];
|
||||
$fileIgnoreList = [
|
||||
// Current non-command files
|
||||
'CliCommand.php',
|
||||
'index.html',
|
||||
'install.functions.php',
|
||||
];
|
||||
// directory of commands to include
|
||||
$cmd_files = glob(Froxlor::getInstallDir() . '/lib/Froxlor/Cli/*.php');
|
||||
|
||||
@@ -56,7 +61,7 @@ foreach ($cmd_files as $cmdFile) {
|
||||
// create class-name including namespace
|
||||
$cmdClass = "\\Froxlor\\Cli\\" . substr(basename($cmdFile), 0, -4);
|
||||
// check whether it exists
|
||||
if (class_exists($cmdClass)) {
|
||||
if (class_exists($cmdClass) && is_subclass_of($cmdClass, '\Symfony\Component\Console\Command\Command')) {
|
||||
// add to cli application
|
||||
$application->add(new $cmdClass());
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
"pear/net_dns2": "^1.5",
|
||||
"amnuts/opcache-gui": "^3.4",
|
||||
"league/commonmark": "^2.4"
|
||||
},
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9",
|
||||
"ext-pcntl": "*",
|
||||
|
||||
@@ -115,8 +115,8 @@ if ($page == 'overview') {
|
||||
$userinfo['traffic_bytes_used'] = $userinfo['traffic_used'] * 1024;
|
||||
|
||||
if (Settings::Get('system.mail_quota_enabled')) {
|
||||
$userinfo['email_quota_bytes'] = ($userinfo['email_quota'] > -1) ? $userinfo['email_quota'] * 1024 : -1;
|
||||
$userinfo['email_quota_bytes_used'] = $userinfo['email_quota_used'] * 1024;
|
||||
$userinfo['email_quota_bytes'] = ($userinfo['email_quota'] > -1) ? $userinfo['email_quota'] * 1024 * 1024 : -1;
|
||||
$userinfo['email_quota_bytes_used'] = $userinfo['email_quota_used'] * 1024 * 1024;
|
||||
}
|
||||
|
||||
if ($usages) {
|
||||
|
||||
19
index.php
19
index.php
@@ -74,27 +74,26 @@ if ($action == '2fa_entercode') {
|
||||
$code = isset($_POST['2fa_code']) ? $_POST['2fa_code'] : null;
|
||||
// verify entered code
|
||||
$tfa = new FroxlorTwoFactorAuth('Froxlor ' . Settings::Get('system.hostname'));
|
||||
$result = ($_SESSION['secret_2fa'] == 'email' ? true : $tfa->verifyCode($_SESSION['secret_2fa'], $code, 3));
|
||||
// get user-data
|
||||
$table = $_SESSION['uidtable_2fa'];
|
||||
$field = $_SESSION['uidfield_2fa'];
|
||||
$uid = $_SESSION['uid_2fa'];
|
||||
$isadmin = $_SESSION['unfo_2fa'];
|
||||
if ($_SESSION['secret_2fa'] == 'email') {
|
||||
// verify code set to user's data_2fa field
|
||||
$sel_stmt = Database::prepare("SELECT `data_2fa` FROM " . $table . " WHERE `" . $field . "` = :uid");
|
||||
$userinfo_code = Database::pexecute_first($sel_stmt, ['uid' => $uid]);
|
||||
$result = $tfa->verifyCode($userinfo_code['data_2fa'], $code);
|
||||
} else {
|
||||
$result = $tfa->verifyCode($_SESSION['secret_2fa'], $code, 3);
|
||||
}
|
||||
// either the code is valid when using authenticator-app, or we will select userdata by id and entered code
|
||||
// which is temporarily stored for the customer when using email-2fa
|
||||
if ($result) {
|
||||
$sel_param = [
|
||||
'uid' => $uid
|
||||
];
|
||||
if ($_SESSION['secret_2fa'] == 'email') {
|
||||
// verify code by selecting user by id and the temp. stored code,
|
||||
// so only if it's the correct code, we get the user-data
|
||||
$sel_stmt = Database::prepare("SELECT * FROM " . $table . " WHERE `" . $field . "` = :uid AND `data_2fa` = :code");
|
||||
$sel_param['code'] = $code;
|
||||
} else {
|
||||
// Authenticator-verification has already happened at this point, so just get the user-data
|
||||
$sel_stmt = Database::prepare("SELECT * FROM " . $table . " WHERE `" . $field . "` = :uid");
|
||||
}
|
||||
$sel_stmt = Database::prepare("SELECT * FROM " . $table . " WHERE `" . $field . "` = :uid");
|
||||
$userinfo = Database::pexecute_first($sel_stmt, $sel_param);
|
||||
// whoops, no (valid) user? Start again
|
||||
if (empty($userinfo)) {
|
||||
|
||||
@@ -157,7 +157,7 @@ CREATE TABLE `panel_admins` (
|
||||
`api_allowed` tinyint(1) NOT NULL default '1',
|
||||
PRIMARY KEY (`adminid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_customers`;
|
||||
@@ -299,7 +299,7 @@ CREATE TABLE `panel_domains` (
|
||||
KEY `customerid` (`customerid`),
|
||||
KEY `parentdomain` (`parentdomainid`),
|
||||
KEY `domain` (`domain`)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_ipsandports`;
|
||||
@@ -678,7 +678,7 @@ opcache.validate_timestamps'),
|
||||
('system', 'distribution', ''),
|
||||
('system', 'update_channel', 'stable'),
|
||||
('system', 'updatecheck_data', ''),
|
||||
('system', 'update_notify_last', '2.1.0-rc3'),
|
||||
('system', 'update_notify_last', ''),
|
||||
('system', 'traffictool', 'goaccess'),
|
||||
('system', 'req_limit_per_interval', 60),
|
||||
('system', 'req_limit_interval', 60),
|
||||
@@ -686,7 +686,7 @@ opcache.validate_timestamps'),
|
||||
('api', 'customer_default', '1'),
|
||||
('2fa', 'enabled', '1'),
|
||||
('panel', 'decimal_places', '4'),
|
||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||
('panel', 'adminmail', 'ADMIN_MAIL'),
|
||||
('panel', 'phpmyadmin_url', ''),
|
||||
('panel', 'webmail_url', ''),
|
||||
('panel', 'webftp_url', ''),
|
||||
@@ -726,8 +726,8 @@ opcache.validate_timestamps'),
|
||||
('panel', 'logo_overridecustom', '0'),
|
||||
('panel', 'settings_mode', '0'),
|
||||
('panel', 'menu_collapsed', '1'),
|
||||
('panel', 'version', '2.1.0-rc3'),
|
||||
('panel', 'db_version', '202311260');
|
||||
('panel', 'version', '2.1.5'),
|
||||
('panel', 'db_version', '202312120');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_tasks`;
|
||||
|
||||
@@ -38,6 +38,7 @@ if (!defined('_CRON_UPDATE')) {
|
||||
|
||||
if (Froxlor::isFroxlorVersion('2.0.24')) {
|
||||
Update::showUpdateStep("Cleaning domains table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ROW_FORMAT=DYNAMIC;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` DROP COLUMN `ismainbutsubto`;");
|
||||
Update::lastStepStatus(0);
|
||||
|
||||
@@ -67,15 +68,18 @@ if (Froxlor::isFroxlorVersion('2.0.24')) {
|
||||
}
|
||||
|
||||
Update::showUpdateStep("Adjusting cronjobs");
|
||||
Database::query("
|
||||
$cfupd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET
|
||||
`module`= 'froxlor/export',
|
||||
`cronfile` = 'export',
|
||||
`cronclass` = '\\Froxlor\\Cron\\System\\ExportCron',
|
||||
`cronclass` = :cc,
|
||||
`interval` = '1 HOUR',
|
||||
`desc_lng_key` = 'cron_export'
|
||||
WHERE `module` = 'froxlor/backup'
|
||||
");
|
||||
Database::pexecute($cfupd_stmt, [
|
||||
'cc' => '\\Froxlor\\Cron\\System\\ExportCron'
|
||||
]);
|
||||
Update::lastStepStatus(0);
|
||||
|
||||
Update::showUpdateStep("Adjusting system for data-export function");
|
||||
@@ -130,8 +134,8 @@ if (Froxlor::isDatabaseVersion('202305240')) {
|
||||
$current_fileextension = Settings::Get('system.index_file_extension');
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup`= 'system' AND `varname`= 'index_file_extension'");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_TEMPLATES . "` ADD `file_extension` varchar(50) NOT NULL default 'html';");
|
||||
if (strtolower(trim($current_fileextension)) != 'html') {
|
||||
$stmt = Database::prepare("UPDATE TABLE `" . TABLE_PANEL_TEMPLATES . "` SET `file_extension` = :ext WHERE `templategroup` = 'files'");
|
||||
if (!empty(trim($current_fileextension)) && strtolower(trim($current_fileextension)) != 'html') {
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `file_extension` = :ext WHERE `templategroup` = 'files'");
|
||||
Database::pexecute($stmt, ['ext' => strtolower(trim($current_fileextension))]);
|
||||
}
|
||||
Update::lastStepStatus(0);
|
||||
@@ -143,3 +147,140 @@ if (Froxlor::isFroxlorVersion('2.1.0-rc2')) {
|
||||
Update::showUpdateStep("Updating from 2.1.0-rc2 to 2.1.0-rc3", false);
|
||||
Froxlor::updateToVersion('2.1.0-rc3');
|
||||
}
|
||||
|
||||
if (Froxlor::isDatabaseVersion('202311260')) {
|
||||
Update::showUpdateStep("Cleaning up old files");
|
||||
$to_clean = array(
|
||||
"install/updates/froxlor/update_2.x.inc.php",
|
||||
"install/updates/preconfig/preconfig_2.x.inc.php",
|
||||
"lib/Froxlor/Api/Commands/CustomerBackups.php",
|
||||
"lib/Froxlor/Cli/Action",
|
||||
"lib/Froxlor/Cli/Action.php",
|
||||
"lib/Froxlor/Cli/CmdLineHandler.php",
|
||||
"lib/Froxlor/Cli/ConfigServicesCmd.php",
|
||||
"lib/Froxlor/Cli/PhpSessioncleanCmd.php",
|
||||
"lib/Froxlor/Cli/SwitchServerIpCmd.php",
|
||||
"lib/Froxlor/Cli/UpdateCliCmd.php",
|
||||
"lib/Froxlor/Cron/System/BackupCron.php",
|
||||
"lib/formfields/customer/extras/formfield.backup.php",
|
||||
"lib/tablelisting/customer/tablelisting.backups.php",
|
||||
"templates/Froxlor/assets/mix-manifest.json",
|
||||
"templates/Froxlor/assets/css",
|
||||
"templates/Froxlor/assets/webfonts",
|
||||
"templates/Froxlor/assets/js/main.js",
|
||||
"templates/Froxlor/assets/js/main.js.LICENSE.txt",
|
||||
"templates/Froxlor/src",
|
||||
"templates/Froxlor/user/change_language.html.twig",
|
||||
"templates/Froxlor/user/change_password.html.twig",
|
||||
"templates/Froxlor/user/change_theme.html.twig",
|
||||
"tests/Backup/CustomerBackupsTest.php"
|
||||
);
|
||||
$disabled = explode(',', ini_get('disable_functions'));
|
||||
$exec_allowed = !in_array('exec', $disabled);
|
||||
$del_list = "";
|
||||
foreach ($to_clean as $filedir) {
|
||||
$complete_filedir = Froxlor::getInstallDir() . $filedir;
|
||||
if (file_exists($complete_filedir)) {
|
||||
if ($exec_allowed) {
|
||||
FileDir::safe_exec("rm -rf " . escapeshellarg($complete_filedir));
|
||||
} else {
|
||||
$del_list .= "rm -rf " . escapeshellarg($complete_filedir) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($exec_allowed) {
|
||||
Update::lastStepStatus(0);
|
||||
} else {
|
||||
if (empty($del_list)) {
|
||||
// none of the files existed
|
||||
Update::lastStepStatus(0);
|
||||
} else {
|
||||
Update::lastStepStatus(
|
||||
1,
|
||||
'manual commands needed',
|
||||
'Please run the following commands manually:<br><pre>' . $del_list . '</pre>'
|
||||
);
|
||||
}
|
||||
}
|
||||
Froxlor::updateToDbVersion('202312050');
|
||||
}
|
||||
|
||||
if (Froxlor::isFroxlorVersion('2.1.0-rc3')) {
|
||||
Update::showUpdateStep("Updating from 2.1.0-rc3 to 2.1.0 stable", false);
|
||||
Froxlor::updateToVersion('2.1.0');
|
||||
}
|
||||
|
||||
if (Froxlor::isFroxlorVersion('2.1.0')) {
|
||||
Update::showUpdateStep("Updating from 2.1.0 to 2.1.1", false);
|
||||
Froxlor::updateToVersion('2.1.1');
|
||||
}
|
||||
|
||||
if (Froxlor::isDatabaseVersion('202312050')) {
|
||||
Update::showUpdateStep("Cleaning up old files");
|
||||
$to_clean = array(
|
||||
"lib/configfiles/centos7.xml",
|
||||
"lib/configfiles/centos8.xml",
|
||||
"lib/configfiles/stretch.xml",
|
||||
"lib/configfiles/xenial.xml",
|
||||
"lib/configfiles/buster.xml",
|
||||
"lib/configfiles/bionic.xml",
|
||||
);
|
||||
$disabled = explode(',', ini_get('disable_functions'));
|
||||
$exec_allowed = !in_array('exec', $disabled);
|
||||
$del_list = "";
|
||||
foreach ($to_clean as $filedir) {
|
||||
$complete_filedir = Froxlor::getInstallDir() . $filedir;
|
||||
if (file_exists($complete_filedir)) {
|
||||
if ($exec_allowed) {
|
||||
FileDir::safe_exec("rm -rf " . escapeshellarg($complete_filedir));
|
||||
} else {
|
||||
$del_list .= "rm -rf " . escapeshellarg($complete_filedir) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($exec_allowed) {
|
||||
Update::lastStepStatus(0);
|
||||
} else {
|
||||
if (empty($del_list)) {
|
||||
// none of the files existed
|
||||
Update::lastStepStatus(0);
|
||||
} else {
|
||||
Update::lastStepStatus(
|
||||
1,
|
||||
'manual commands needed',
|
||||
'Please run the following commands manually:<br><pre>' . $del_list . '</pre>'
|
||||
);
|
||||
}
|
||||
}
|
||||
Froxlor::updateToDbVersion('202312100');
|
||||
}
|
||||
|
||||
if (Froxlor::isDatabaseVersion('202312100')) {
|
||||
|
||||
Update::showUpdateStep("Adjusting table row format of larger tables");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` ROW_FORMAT=DYNAMIC;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ROW_FORMAT=DYNAMIC;");
|
||||
Update::lastStepStatus(0);
|
||||
|
||||
Froxlor::updateToDbVersion('202312120');
|
||||
}
|
||||
|
||||
if (Froxlor::isFroxlorVersion('2.1.1')) {
|
||||
Update::showUpdateStep("Updating from 2.1.1 to 2.1.2", false);
|
||||
Froxlor::updateToVersion('2.1.2');
|
||||
}
|
||||
|
||||
if (Froxlor::isFroxlorVersion('2.1.2')) {
|
||||
Update::showUpdateStep("Updating from 2.1.2 to 2.1.3", false);
|
||||
Froxlor::updateToVersion('2.1.3');
|
||||
}
|
||||
|
||||
if (Froxlor::isFroxlorVersion('2.1.3')) {
|
||||
Update::showUpdateStep("Updating from 2.1.3 to 2.1.4", false);
|
||||
Froxlor::updateToVersion('2.1.4');
|
||||
}
|
||||
|
||||
if (Froxlor::isFroxlorVersion('2.1.4')) {
|
||||
Update::showUpdateStep("Updating from 2.1.4 to 2.1.5", false);
|
||||
Froxlor::updateToVersion('2.1.5');
|
||||
}
|
||||
|
||||
@@ -400,7 +400,10 @@ class Customers extends ApiCommand implements ResourceEntity
|
||||
$allowed_phpconfigs = array_map('intval', $allowed_phpconfigs);
|
||||
|
||||
if (empty($allowed_phpconfigs) && $phpenabled == 1) {
|
||||
Response::standardError('customerphpenabledbutnoconfig', '', true);
|
||||
// only required if not using mod_php
|
||||
if ((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) {
|
||||
Response::standardError('customerphpenabledbutnoconfig', '', true);
|
||||
}
|
||||
}
|
||||
|
||||
$allowed_mysqlserver = array();
|
||||
@@ -1053,7 +1056,7 @@ class Customers extends ApiCommand implements ResourceEntity
|
||||
$email = $this->getParam('email', true, $idna_convert->decode($result['email']));
|
||||
$name = $this->getParam('name', true, $result['name']);
|
||||
$firstname = $this->getParam('firstname', true, $result['firstname']);
|
||||
$company_required = empty($result['company']) && ((!empty($name) && empty($firstname)) || (empty($name) && !empty($firstname)) || (empty($name) && empty($firstname)));
|
||||
$company_required = (!empty($name) && empty($firstname)) || (empty($name) && !empty($firstname)) || (empty($name) && empty($firstname));
|
||||
$company = $this->getParam('company', !$company_required, $result['company']);
|
||||
$street = $this->getParam('street', true, $result['street']);
|
||||
$zipcode = $this->getParam('zipcode', true, $result['zipcode']);
|
||||
@@ -1114,7 +1117,10 @@ class Customers extends ApiCommand implements ResourceEntity
|
||||
$allowed_phpconfigs = array_map('intval', $allowed_phpconfigs);
|
||||
}
|
||||
if (empty($allowed_phpconfigs) && $phpenabled == 1) {
|
||||
Response::standardError('customerphpenabledbutnoconfig', '', true);
|
||||
// only required if not using mod_php
|
||||
if ((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) {
|
||||
Response::standardError('customerphpenabledbutnoconfig', '', true);
|
||||
}
|
||||
}
|
||||
|
||||
// add permission for allowed mysql usage if customer was not allowed to use mysql prior
|
||||
|
||||
@@ -157,10 +157,10 @@ class EmailAccounts extends ApiCommand implements ResourceEntity
|
||||
|
||||
// prefix hash-algo
|
||||
switch (Settings::Get('system.passwordcryptfunc')) {
|
||||
case PASSWORD_ARGON2I:
|
||||
case defined('PASSWORD_ARGON2I') && PASSWORD_ARGON2I:
|
||||
$cpPrefix = '{ARGON2I}';
|
||||
break;
|
||||
case PASSWORD_ARGON2ID:
|
||||
case defined('PASSWORD_ARGON2ID') && PASSWORD_ARGON2ID:
|
||||
$cpPrefix = '{ARGON2ID}';
|
||||
break;
|
||||
default:
|
||||
@@ -404,10 +404,10 @@ class EmailAccounts extends ApiCommand implements ResourceEntity
|
||||
$password = Crypt::validatePassword($password, true);
|
||||
// prefix hash-algo
|
||||
switch (Settings::Get('system.passwordcryptfunc')) {
|
||||
case PASSWORD_ARGON2I:
|
||||
case defined('PASSWORD_ARGON2I') && PASSWORD_ARGON2I:
|
||||
$cpPrefix = '{ARGON2I}';
|
||||
break;
|
||||
case PASSWORD_ARGON2ID:
|
||||
case defined('PASSWORD_ARGON2ID') && PASSWORD_ARGON2ID:
|
||||
$cpPrefix = '{ARGON2ID}';
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -259,14 +259,15 @@ class Froxlor extends ApiCommand
|
||||
* returns a random password based on froxlor settings for min-length, included characters, etc.
|
||||
*
|
||||
* @param int $length
|
||||
* optional length of password, defaults to 10
|
||||
* optional length of password, defaults to 0 (panel.password_min_length)
|
||||
*
|
||||
* @access admin, customer
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
public function generatePassword()
|
||||
public function generatePassword(): string
|
||||
{
|
||||
$length = $this->getParam('length', true, 10);
|
||||
$length = $this->getParam('length', true, 0);
|
||||
return $this->response(Crypt::generatePassword($length));
|
||||
}
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ final class ConfigServices extends CliCommand
|
||||
case "file":
|
||||
if (array_key_exists('content', $action)) {
|
||||
$output->writeln('<comment>Creating file "' . $action['name'] . '"</>');
|
||||
file_put_contents($action['name'], trim(strtr($action['content'], $replace_arr)));
|
||||
file_put_contents($action['name'], trim(strtr($action['content'], $replace_arr)) . PHP_EOL);
|
||||
} elseif (array_key_exists('subcommands', $action)) {
|
||||
foreach ($action['subcommands'] as $fileaction) {
|
||||
if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") {
|
||||
@@ -411,7 +411,7 @@ final class ConfigServices extends CliCommand
|
||||
exec(strtr($fileaction['content'], $replace_arr));
|
||||
} elseif ($fileaction['type'] == 'file') {
|
||||
$output->writeln('<comment>Creating file "' . $fileaction['name'] . '"</>');
|
||||
file_put_contents($fileaction['name'], trim(strtr($fileaction['content'], $replace_arr)));
|
||||
file_put_contents($fileaction['name'], trim(strtr($fileaction['content'], $replace_arr)) . PHP_EOL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -514,6 +514,7 @@ final class ConfigServices extends CliCommand
|
||||
'<WEBSERVER_GROUP>' => Settings::Get('system.httpgroup'),
|
||||
'<SSL_CERT_FILE>' => Settings::Get('system.ssl_cert_file'),
|
||||
'<SSL_KEY_FILE>' => Settings::Get('system.ssl_key_file'),
|
||||
'<ADMIN_MAIL>' => Settings::Get('panel.adminmail'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ final class InstallCommand extends Command
|
||||
$ask_field = false;
|
||||
}
|
||||
$fielddata['value'] = $this->formfielddata[$fieldname] ?? ($fielddata['value'] ?? null);
|
||||
$fielddata['label'] = strip_tags(str_replace("<br>", " ", $fielddata['label']));
|
||||
$fielddata['label'] = $this->cliTextFormat($fielddata['label'], " ");
|
||||
if ($ask_field) {
|
||||
if ($fielddata['type'] == 'password') {
|
||||
$this->formfielddata[$fieldname] = $this->io->askHidden($fielddata['label'], function ($value) use ($fielddata) {
|
||||
@@ -267,14 +267,16 @@ final class InstallCommand extends Command
|
||||
case 4:
|
||||
$section = $inst->formfield['install']['sections']['step' . $step] ?? [];
|
||||
$this->io->section($section['title']);
|
||||
$this->io->note($section['description']);
|
||||
$this->io->note($this->cliTextFormat($section['description']));
|
||||
$cmdfield = $section['fields']['system'];
|
||||
$this->io->success([
|
||||
$cmdfield['label'],
|
||||
$cmdfield['value']
|
||||
]);
|
||||
if (!empty($decoded_input) || $this->io->confirm('Execute command now?', false)) {
|
||||
passthru($cmdfield['value']);
|
||||
if (!isset($decoded_input['manual_config']) || (bool)$decoded_input['manual_config'] === false) {
|
||||
if (!empty($decoded_input) || $this->io->confirm('Execute command now?', false)) {
|
||||
passthru($cmdfield['value']);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -305,7 +307,7 @@ final class InstallCommand extends Command
|
||||
$json_output = [];
|
||||
foreach ($fields['install']['sections'] as $section => $section_fields) {
|
||||
foreach ($section_fields['fields'] as $name => $field) {
|
||||
if ($name == 'system' || $name == 'manual_config' || $name == 'target_servername') {
|
||||
if ($name == 'system' || $name == 'target_servername') {
|
||||
continue;
|
||||
}
|
||||
if ($field['type'] == 'text' || $field['type'] == 'email') {
|
||||
@@ -318,7 +320,7 @@ final class InstallCommand extends Command
|
||||
$fieldval = '******';
|
||||
} elseif ($field['type'] == 'select') {
|
||||
$fieldval = implode("|", array_keys($field['select_var']));
|
||||
} else if ($field['type'] == 'checkbox') {
|
||||
} elseif ($field['type'] == 'checkbox') {
|
||||
$fieldval = "1|0";
|
||||
} else {
|
||||
$fieldval = "?";
|
||||
@@ -346,4 +348,10 @@ final class InstallCommand extends Command
|
||||
curl_close($ch);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
private function cliTextFormat(string $text, string $nl_char = "\n"): string
|
||||
{
|
||||
$text = str_replace(['<br>', '<br/>', '<br />'], [$nl_char, $nl_char, $nl_char], $text);
|
||||
return strip_tags($text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,6 +263,8 @@ final class MasterCron extends CliCommand
|
||||
if ($jobcount > 0) {
|
||||
if (Settings::Get('system.nssextrausers') == 1) {
|
||||
Extrausers::generateFiles($this->cronLog);
|
||||
// reload crond as shell users might use crontab and the user is only known to crond if reloaded
|
||||
FileDir::safe_exec(escapeshellcmd(Settings::Get('system.crondreload')));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -275,6 +277,8 @@ final class MasterCron extends CliCommand
|
||||
FileDir::safe_exec('nscd -i group 1> /dev/null', $false_val, [
|
||||
'>'
|
||||
]);
|
||||
// reload crond as shell users might use crontab and the user is only known to crond if reloaded
|
||||
FileDir::safe_exec(escapeshellcmd(Settings::Get('system.crondreload')));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ final class UpdateCommand extends CliCommand
|
||||
$newversionavail = true;
|
||||
$output->writeln('<comment>' . $text . '</>');
|
||||
$result = self::SUCCESS;
|
||||
} else if ($aucheck < 0 || $aucheck > 1) {
|
||||
} elseif ($aucheck < 0 || $aucheck > 1) {
|
||||
if ($input->getOption('integer-return')) {
|
||||
$output->write(-1);
|
||||
return self::INVALID;
|
||||
|
||||
@@ -117,7 +117,7 @@ class ConfigDisplay
|
||||
'<SQL_UNPRIVILEGED_PASSWORD>' => 'FROXLOR_MYSQL_PASSWORD',
|
||||
'<SQL_DB>' => $sql['db'],
|
||||
'<SQL_HOST>' => $sql['host'],
|
||||
'<SQL_SOCKET>' => isset($sql['socket']) ? $sql['socket'] : null,
|
||||
'<SQL_SOCKET>' => $sql['socket'] ?? null,
|
||||
'<SERVERNAME>' => Settings::Get('system.hostname'),
|
||||
'<SERVERIP>' => Settings::Get('system.ipaddress'),
|
||||
'<NAMESERVERS>' => Settings::Get('system.nameservers'),
|
||||
@@ -127,12 +127,15 @@ class ConfigDisplay
|
||||
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),
|
||||
'<SSLPROTOCOLS>' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '',
|
||||
'<CUSTOMER_TMP>' => FileDir::makeCorrectDir($customer_tmpdir),
|
||||
'<BASE_PATH>' => FileDir::makeCorrectDir(Froxlor::getInstallDir()),
|
||||
'<BASE_PATH>' => Froxlor::getInstallDir(),
|
||||
'<BIND_CONFIG_PATH>' => FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory')),
|
||||
'<WEBSERVER_RELOAD_CMD>' => Settings::Get('system.apachereload_command'),
|
||||
'<CUSTOMER_LOGS>' => FileDir::makeCorrectDir(Settings::Get('system.logfiles_directory')),
|
||||
'<FPM_IPCDIR>' => FileDir::makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')),
|
||||
'<WEBSERVER_GROUP>' => Settings::Get('system.httpgroup')
|
||||
'<WEBSERVER_GROUP>' => Settings::Get('system.httpgroup'),
|
||||
'<SSL_CERT_FILE>' => Settings::Get('system.ssl_cert_file'),
|
||||
'<SSL_KEY_FILE>' => Settings::Get('system.ssl_key_file'),
|
||||
'<ADMIN_MAIL>' => Settings::Get('panel.adminmail'),
|
||||
];
|
||||
|
||||
$commands_pre = "";
|
||||
|
||||
@@ -55,18 +55,17 @@ class Bind extends DnsBase
|
||||
$domains = $this->getDomainList();
|
||||
|
||||
if (empty($domains)) {
|
||||
$this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, skipping...');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->bindconf_file = '# ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n\n";
|
||||
|
||||
foreach ($domains as $domain) {
|
||||
if ($domain['is_child']) {
|
||||
// domains that are subdomains to other main domains are handled by recursion within walkDomainList()
|
||||
continue;
|
||||
$this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, not creating any zones...');
|
||||
$this->bindconf_file = '';
|
||||
} else {
|
||||
$this->bindconf_file = '# ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n\n";
|
||||
foreach ($domains as $domain) {
|
||||
if ($domain['is_child']) {
|
||||
// domains that are subdomains to other main domains are handled by recursion within walkDomainList()
|
||||
continue;
|
||||
}
|
||||
$this->walkDomainList($domain, $domains);
|
||||
}
|
||||
$this->walkDomainList($domain, $domains);
|
||||
}
|
||||
|
||||
$bindconf_file_handler = fopen(FileDir::makeCorrectFile(Settings::Get('system.bindconf_directory') . '/froxlor_bind.conf'), 'w');
|
||||
|
||||
@@ -244,7 +244,7 @@ abstract class DnsBase
|
||||
'zonefile' => '',
|
||||
'froxlorhost' => '1'
|
||||
];
|
||||
$domains['none'] = $hostname_arr;
|
||||
$domains[0] = $hostname_arr;
|
||||
}
|
||||
|
||||
if (empty($domains)) {
|
||||
|
||||
@@ -45,18 +45,16 @@ class PowerDNS extends DnsBase
|
||||
$this->clearZoneTables($domains);
|
||||
|
||||
if (empty($domains)) {
|
||||
$this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, skipping...');
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($domains as $domain) {
|
||||
if ($domain['is_child']) {
|
||||
// domains that are subdomains to other main domains are handled by recursion within walkDomainList()
|
||||
continue;
|
||||
$this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, not creating any zones...');
|
||||
} else {
|
||||
foreach ($domains as $domain) {
|
||||
if ($domain['is_child']) {
|
||||
// domains that are subdomains to other main domains are handled by recursion within walkDomainList()
|
||||
continue;
|
||||
}
|
||||
$this->walkDomainList($domain, $domains);
|
||||
}
|
||||
$this->walkDomainList($domain, $domains);
|
||||
}
|
||||
|
||||
$this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'PowerDNS database updated');
|
||||
$this->reloadDaemon();
|
||||
$this->logger->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, 'Task4 finished');
|
||||
|
||||
@@ -43,23 +43,29 @@ class DomainSSL
|
||||
* domain-array as reference so we can set the corresponding array-indices
|
||||
*
|
||||
* @return null
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function setDomainSSLFilesArray(array &$domain = null)
|
||||
{
|
||||
// check if the domain itself has a certificate defined
|
||||
$dom_certs_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :domid
|
||||
SELECT s.*, d.domain
|
||||
FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` s
|
||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` d ON d.id = s.domainid
|
||||
WHERE s.`domainid` = :domid
|
||||
");
|
||||
$dom_certs = Database::pexecute_first($dom_certs_stmt, [
|
||||
'domid' => $domain['id']
|
||||
]);
|
||||
|
||||
$parent_certificate = false;
|
||||
if (!is_array($dom_certs) || !isset($dom_certs['ssl_cert_file']) || $dom_certs['ssl_cert_file'] == '') {
|
||||
// maybe its parent?
|
||||
if (isset($domain['parentdomainid']) && $domain['parentdomainid'] != 0) {
|
||||
$dom_certs = Database::pexecute_first($dom_certs_stmt, [
|
||||
'domid' => $domain['parentdomainid']
|
||||
]);
|
||||
$parent_certificate = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +79,8 @@ class DomainSSL
|
||||
}
|
||||
// make correct files for the certificates
|
||||
$ssl_files = [
|
||||
'ssl_cert_file' => FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '.crt'),
|
||||
'ssl_key_file' => FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '.key')
|
||||
'ssl_cert_file' => FileDir::makeCorrectFile($sslcertpath . '/' . ($parent_certificate ? $dom_certs['domain'] : $domain['domain']) . '.crt'),
|
||||
'ssl_key_file' => FileDir::makeCorrectFile($sslcertpath . '/' . ($parent_certificate ? $dom_certs['domain'] : $domain['domain']) . '.key')
|
||||
];
|
||||
|
||||
if (!$this->validateCertificate($dom_certs)) {
|
||||
@@ -93,19 +99,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'] = FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_CA.pem');
|
||||
$ssl_files['ssl_ca_file'] = FileDir::makeCorrectFile($sslcertpath . '/' . ($parent_certificate ? $dom_certs['domain'] : $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'] = FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_chain.pem');
|
||||
$ssl_files['ssl_cert_chainfile'] = FileDir::makeCorrectFile($sslcertpath . '/' . ($parent_certificate ? $dom_certs['domain'] : $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'] = FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '_fullchain.pem');
|
||||
$ssl_files['ssl_fullchain_file'] = FileDir::makeCorrectFile($sslcertpath . '/' . ($parent_certificate ? $dom_certs['domain'] : $domain['domain']) . '_fullchain.pem');
|
||||
}
|
||||
// create them on the filesystem
|
||||
foreach ($ssl_files as $type => $filename) {
|
||||
@@ -131,7 +137,7 @@ class DomainSSL
|
||||
return;
|
||||
}
|
||||
|
||||
private function validateCertificate($dom_certs = [])
|
||||
private function validateCertificate($dom_certs = []): bool
|
||||
{
|
||||
return openssl_x509_check_private_key($dom_certs['ssl_cert_file'], $dom_certs['ssl_key_file']);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class TrafficCron extends FroxlorCron
|
||||
|
||||
public static function run()
|
||||
{
|
||||
self::runFork([self::class, 'handle']);
|
||||
self::runFork([self::class, 'handle'], [true]);
|
||||
}
|
||||
|
||||
public static function handle()
|
||||
@@ -163,14 +163,14 @@ class TrafficCron extends FroxlorCron
|
||||
|
||||
if (isset($domainlist[$row['customerid']]) && is_array($domainlist[$row['customerid']]) && count($domainlist[$row['customerid']]) != 0) {
|
||||
// Examining which caption to use for default webalizer stats...
|
||||
if ($row['standardsubdomain'] != '0') {
|
||||
if ($row['standardsubdomain'] != '0' && isset($domainlist[$row['customerid']][$row['standardsubdomain']])) {
|
||||
// ... of course we'd prefer to use the standardsubdomain ...
|
||||
$caption = $domainlist[$row['customerid']][$row['standardsubdomain']];
|
||||
} else {
|
||||
// ... but if there is no standardsubdomain, we have to use the loginname ...
|
||||
$caption = $row['loginname'];
|
||||
|
||||
// ... which results in non-usable links to files in the stats, so lets have a look if we find a domain which is not speciallogfiledomain
|
||||
// ... which results in non-usable links to files in the stats, so let's have a look if we find a domain which is not speciallogfiledomain
|
||||
foreach ($domainlist[$row['customerid']] as $domainid => $domain) {
|
||||
if (!isset($speciallogfile_domainlist[$row['customerid']]) || !isset($speciallogfile_domainlist[$row['customerid']][$domainid])) {
|
||||
$caption = $domain;
|
||||
@@ -193,6 +193,8 @@ class TrafficCron extends FroxlorCron
|
||||
} else {
|
||||
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'] . '-' . $domain, $row['documentroot'] . '/webalizer/' . $domain . '/', $domain, $domainlist[$row['customerid']]));
|
||||
}
|
||||
// kind of a keep-alive-call as this unsets the link which leads to a new connection to the database
|
||||
Database::needRoot();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,6 +212,8 @@ class TrafficCron extends FroxlorCron
|
||||
} else {
|
||||
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']]));
|
||||
}
|
||||
// kind of a keep-alive-call as this unsets the link which leads to a new connection to the database
|
||||
Database::needRoot();
|
||||
|
||||
// make the stuff readable for the customer, #258
|
||||
Statistics::makeChownWithNewStats($row);
|
||||
@@ -618,7 +622,7 @@ class TrafficCron extends FroxlorCron
|
||||
$format = Settings::Get('system.logfiles_type') == '2' ? 'VCOMBINED' : 'COMBINED';
|
||||
$monthyear = $monthyear_arr['month'] . '/' . $monthyear_arr['year'];
|
||||
$return_value = false;
|
||||
FileDir::safe_exec("grep '" . $monthyear . "' " . escapeshellarg($logfile) . " | goaccess " . $keep_params . " --db-path=" . escapeshellarg($outputdir) . " -o " . escapeshellarg($outputdir . '.tmp.json') . " -o " . escapeshellarg($outputdir . 'index.html') . " --html-report-title=" . escapeshellarg($caption) . " --log-format=" . $format . " - ", $return_value, ['|']);
|
||||
FileDir::safe_exec("grep '" . $monthyear . "' " . escapeshellarg($logfile) . " | goaccess " . $keep_params . " --db-path=" . escapeshellarg($outputdir) . " -o " . escapeshellarg($outputdir . '.tmp.json') . " -o " . escapeshellarg($outputdir . 'index.html') . " --html-report-title=" . escapeshellarg($caption) . " --log-format=" . $format . " --no-parsing-spinner --no-progress - ", $return_value, ['|']);
|
||||
|
||||
if (file_exists($outputdir . '.tmp.json')) {
|
||||
// need jq here because of potentially LARGE json files
|
||||
@@ -787,6 +791,8 @@ class TrafficCron extends FroxlorCron
|
||||
// 'real' domains and no subdomains which are aliases in the
|
||||
// model-config-file.
|
||||
$returnval += self::awstatsDoSingleDomain($singledomain, $outputdir, $current_stamp);
|
||||
// kind of a keep-alive-call as this unsets the link which leads to a new connection to the database
|
||||
Database::needRoot();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -256,7 +256,7 @@ class Domain
|
||||
]);
|
||||
$result = [];
|
||||
while ($entry = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$result = $entry['id'];
|
||||
$result[] = $entry['id'];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -43,9 +43,6 @@ class IpAddr
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if (!isset($system_ipaddress_array[$row['ip']]) && !in_array($row['ip'], $system_ipaddress_array)) {
|
||||
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
}
|
||||
$system_ipaddress_array[$row['ip']] = $row['ip'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ final class Froxlor
|
||||
{
|
||||
|
||||
// Main version variable
|
||||
const VERSION = '2.1.0-rc3';
|
||||
const VERSION = '2.1.5';
|
||||
|
||||
// Database version (YYYYMMDDC where C is a daily counter)
|
||||
const DBVERSION = '202311260';
|
||||
const DBVERSION = '202312120';
|
||||
|
||||
// Distribution branding-tag (used for Debian etc.)
|
||||
const BRANDING = '';
|
||||
|
||||
@@ -69,7 +69,7 @@ class AutoUpdate
|
||||
if (Settings::Get('system.update_channel') == 'testing') {
|
||||
$channel = '/testing';
|
||||
} elseif (Settings::Get('system.update_channel') == 'nightly') {
|
||||
if (empty(Froxlor::BRANDING)) {
|
||||
if (empty(Froxlor::BRANDING) || substr(Froxlor::BRANDING, 0, 1) == '-') {
|
||||
$channel = '/nightly.0000000';
|
||||
} else {
|
||||
$channel = '/' . substr(Froxlor::BRANDING, 1);
|
||||
@@ -151,6 +151,8 @@ class AutoUpdate
|
||||
$zip->close();
|
||||
// success - remove unused archive
|
||||
@unlink($localArchive);
|
||||
// reset cached version check
|
||||
Settings::Set('system.updatecheck_data', '');
|
||||
// wait a bit before we redirect to be sure
|
||||
sleep(3);
|
||||
return 0;
|
||||
|
||||
@@ -99,7 +99,7 @@ class Install
|
||||
}
|
||||
|
||||
// check for url manipulation or wrong step
|
||||
if ((isset($_SESSION['installation']['stepCompleted']) && ($this->currentStep + 1) > $_SESSION['installation']['stepCompleted'])
|
||||
if ((isset($_SESSION['installation']['stepCompleted']) && $this->currentStep > $_SESSION['installation']['stepCompleted'])
|
||||
|| (!isset($_SESSION['installation']['stepCompleted']) && $this->currentStep > 0)
|
||||
) {
|
||||
$this->currentStep = isset($_SESSION['installation']['stepCompleted']) ? $_SESSION['installation']['stepCompleted'] + 1 : 1;
|
||||
@@ -322,6 +322,8 @@ class Install
|
||||
$email = $validatedData['admin_email'] ?? '';
|
||||
$password = $validatedData['admin_pass'] ?? '';
|
||||
$password_confirm = $validatedData['admin_pass_confirm'] ?? '';
|
||||
$useadminmailassender = $validatedData['use_admin_email_as_sender'] ?? '1';
|
||||
$senderemail = $validatedData['sender_email'] ?? '';
|
||||
|
||||
if (!preg_match('/^[^\r\n\t\f\0]*$/D', $name)) {
|
||||
throw new Exception(lng('error.stringformaterror', ['admin_name']));
|
||||
@@ -329,6 +331,8 @@ class Install
|
||||
throw new Exception(lng('error.loginnameiswrong', [$loginname]));
|
||||
} elseif (empty(trim($email)) || !Validate::validateEmail($email)) {
|
||||
throw new Exception(lng('error.emailiswrong', [$email]));
|
||||
} elseif ((int)$useadminmailassender == 0 && !empty(trim($senderemail)) && !Validate::validateEmail($senderemail)) {
|
||||
throw new Exception(lng('error.emailiswrong', [$senderemail]));
|
||||
} elseif (empty($password) || $password != $password_confirm) {
|
||||
throw new Exception(lng('error.newpasswordconfirmerror'));
|
||||
} elseif ($password == $loginname) {
|
||||
|
||||
@@ -301,8 +301,8 @@ class Core
|
||||
/* continue */
|
||||
}
|
||||
}
|
||||
if (version_compare($db_root->getAttribute(PDO::ATTR_SERVER_VERSION), '10.0.0', '>=')) {
|
||||
// mariadb compatibility
|
||||
if (version_compare($db_root->getAttribute(PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
|
||||
// mariadb & mysql8
|
||||
// create user
|
||||
$stmt = $db_root->prepare("CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY :password");
|
||||
$stmt->execute([
|
||||
@@ -314,19 +314,6 @@ class Core
|
||||
"username" => $username,
|
||||
"host" => $access_host
|
||||
]);
|
||||
} elseif (version_compare($db_root->getAttribute(PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
|
||||
// mysql8 compatibility
|
||||
// create user
|
||||
$stmt = $db_root->prepare("CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password BY :password");
|
||||
$stmt->execute([
|
||||
"password" => $password
|
||||
]);
|
||||
// grant privileges
|
||||
$stmt = $db_root->prepare("GRANT ALL ON `" . $database . "`.* TO :username@:host");
|
||||
$stmt->execute([
|
||||
"username" => $username,
|
||||
"host" => $access_host
|
||||
]);
|
||||
} else {
|
||||
// grant privileges
|
||||
$stmt = $db_root->prepare("GRANT ALL PRIVILEGES ON `" . $database . "`.* TO :username@:host IDENTIFIED BY :password");
|
||||
@@ -378,7 +365,14 @@ class Core
|
||||
|
||||
$mainip = !empty($this->validatedData['serveripv6']) ? $this->validatedData['serveripv6'] : $this->validatedData['serveripv4'];
|
||||
|
||||
$this->updateSetting($upd_stmt, 'admin@' . $this->validatedData['servername'], 'panel', 'adminmail');
|
||||
if ($this->validatedData['use_admin_email_as_sender'] == '1') {
|
||||
$adminmail_value = $this->validatedData['admin_email'];
|
||||
} elseif ($this->validatedData['use_admin_email_as_sender'] == '0' && !empty($this->validatedData['sender_email'])) {
|
||||
$adminmail_value = $this->validatedData['sender_email'];
|
||||
} else {
|
||||
$adminmail_value = 'admin@' . $this->validatedData['servername'];
|
||||
}
|
||||
$this->updateSetting($upd_stmt, $adminmail_value, 'panel', 'adminmail');
|
||||
$this->updateSetting($upd_stmt, $mainip, 'system', 'ipaddress');
|
||||
if ($this->validatedData['use_ssl']) {
|
||||
$this->updateSetting($upd_stmt, 1, 'system', 'use_ssl');
|
||||
@@ -576,7 +570,7 @@ class Core
|
||||
'password' => password_hash($this->validatedData['admin_pass'], PASSWORD_DEFAULT),
|
||||
'adminname' => $this->validatedData['admin_name'],
|
||||
'email' => $this->validatedData['admin_email'],
|
||||
'deflang' => 'en' // TODO: set lanuage
|
||||
'deflang' => 'en' // TODO: set language
|
||||
];
|
||||
$ins_stmt = $db_user->prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_ADMINS . "` SET
|
||||
|
||||
@@ -220,8 +220,11 @@ class PhpHelper
|
||||
if (is_dir($data_dirname)) {
|
||||
$data_dirhandle = opendir($data_dirname);
|
||||
while (false !== ($data_filename = readdir($data_dirhandle))) {
|
||||
if ($data_filename != '.' && $data_filename != '..' && $data_filename != '' && substr($data_filename,
|
||||
-4) == '.php') {
|
||||
if ($data_filename != '.'
|
||||
&& $data_filename != '..'
|
||||
&& $data_filename != ''
|
||||
&& substr($data_filename, -4) == '.php'
|
||||
) {
|
||||
$data_files[] = $data_dirname . $data_filename;
|
||||
}
|
||||
}
|
||||
@@ -415,8 +418,8 @@ class PhpHelper
|
||||
*/
|
||||
public static function recursive_array_search(
|
||||
string $needle,
|
||||
array $haystack,
|
||||
array &$keys = [],
|
||||
array $haystack,
|
||||
array &$keys = [],
|
||||
string $currentKey = ''
|
||||
): bool {
|
||||
foreach ($haystack as $key => $value) {
|
||||
@@ -458,6 +461,10 @@ class PhpHelper
|
||||
'directory_password',
|
||||
'ftp_password',
|
||||
'mysql_password',
|
||||
'mysql_root_pass',
|
||||
'mysql_unprivileged_pass',
|
||||
'admin_pass',
|
||||
'admin_pass_confirm',
|
||||
];
|
||||
if (!empty($global)) {
|
||||
$tmp = $global;
|
||||
@@ -557,4 +564,17 @@ class PhpHelper
|
||||
}
|
||||
return $tab . $str;
|
||||
}
|
||||
|
||||
public static function array_merge_recursive_distinct(array &$array1, array &$array2)
|
||||
{
|
||||
$merged = $array1;
|
||||
foreach ($array2 as $key => &$value) {
|
||||
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {
|
||||
$merged[$key] = self::array_merge_recursive_distinct($merged[$key], $value);
|
||||
} else {
|
||||
$merged[$key] = $value;
|
||||
}
|
||||
}
|
||||
return $merged;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +102,14 @@ class Traffic
|
||||
$years_avail = $sel_stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
// sort users by total traffic
|
||||
usort($users, function ($user_a, $user_b) {
|
||||
if ($user_a['total'] == $user_b['total']) {
|
||||
return 0;
|
||||
}
|
||||
return ($user_a['total'] < $user_b['total']) ? 1 : -1;
|
||||
});
|
||||
|
||||
return [
|
||||
'metrics' => $metrics,
|
||||
'users' => $users,
|
||||
|
||||
@@ -81,7 +81,7 @@ class Domain
|
||||
return lng('domains.aliasdomain') . ' ' . $attributes['fields']['aliasdomain'];
|
||||
}
|
||||
|
||||
public static function domainExternalLinkInfo(array $attributes)
|
||||
public static function domainExternalLinkInfo(array $attributes): string
|
||||
{
|
||||
$result = '';
|
||||
if ($attributes['fields']['parentdomainid'] != 0) {
|
||||
@@ -89,7 +89,11 @@ class Domain
|
||||
}
|
||||
$result .= '<a href="http://' . $attributes['data'] . '" target="_blank">' . $attributes['data'] . '</a>';
|
||||
// check for statistics if parentdomainid==0 to show stats-link for customers
|
||||
if ((int)UI::getCurrentUser()['adminsession'] == 0 && $attributes['fields']['parentdomainid'] == 0 && $attributes['fields']['deactivated'] == 0) {
|
||||
if ((int)UI::getCurrentUser()['adminsession'] == 0
|
||||
&& $attributes['fields']['parentdomainid'] == 0
|
||||
&& $attributes['fields']['deactivated'] == 0
|
||||
&& preg_match('/^https?:\/\/(.*)/i', $attributes['fields']['documentroot']) == false
|
||||
) {
|
||||
$statsapp = Settings::Get('system.traffictool');
|
||||
$result .= ' <a href="http://' . $attributes['data'] . '/' . $statsapp . '" rel="external" target="_blank" title="' . lng('domains.statstics') . '"><i class="fa-solid fa-chart-line text-secondary"></i></a>';
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ class Form
|
||||
{
|
||||
$returnvalue = [];
|
||||
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] == 'select') {
|
||||
if ((!isset($fielddata['select_var']) || !is_array($fielddata['select_var']) || empty($fielddata['select_var'])) && (isset($fielddata['option_options_method']))) {
|
||||
if ((!is_array($fielddata['select_var']) || empty($fielddata['select_var'])) && (isset($fielddata['option_options_method']))) {
|
||||
$returnvalue['select_var'] = call_user_func($fielddata['option_options_method']);
|
||||
}
|
||||
}
|
||||
@@ -236,8 +236,8 @@ class Form
|
||||
if (\Froxlor\Validate\Form::validateFieldDefinition($groupdetails)) {
|
||||
// Prefetch form fields
|
||||
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
|
||||
if (!$only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
|
||||
$groupdetails['fields'][$fieldname] = self::arrayMergePrefix($fielddetails, $fielddetails['type'], self::prefetchFormFieldData($fieldname, $fielddetails));
|
||||
if (!$only_enabledisable || isset($fielddetails['overview_option'])) {
|
||||
$groupdetails['fields'][$fieldname] = array_merge($fielddetails, self::prefetchFormFieldData($fieldname, $fielddetails));
|
||||
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
||||
}
|
||||
}
|
||||
@@ -347,7 +347,7 @@ class Form
|
||||
if (\Froxlor\Validate\Form::validateFieldDefinition($groupdetails)) {
|
||||
// Save fields
|
||||
foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
|
||||
if (!$only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
|
||||
if (!$only_enabledisable || (isset($fielddetails['overview_option']))) {
|
||||
if (isset($changed_fields[$fieldname])) {
|
||||
if (($saved_field = self::saveFormField($fieldname, $fielddetails, self::manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false) {
|
||||
$saved_fields = array_merge($saved_fields, $saved_field);
|
||||
@@ -364,24 +364,7 @@ class Form
|
||||
// Save form
|
||||
return self::saveForm($form, $saved_fields);
|
||||
}
|
||||
}
|
||||
|
||||
private static function arrayMergePrefix($array1, $key_prefix, $array2)
|
||||
{
|
||||
if (is_array($array1) && is_array($array2)) {
|
||||
if ($key_prefix != '') {
|
||||
foreach ($array2 as $key => $value) {
|
||||
$array1[$key_prefix . '_' . $key] = $value;
|
||||
unset($array2[$key]);
|
||||
}
|
||||
unset($array2);
|
||||
return $array1;
|
||||
} else {
|
||||
return array_merge($array1, $array2);
|
||||
}
|
||||
} else {
|
||||
return $array1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getFormFieldData($fieldname, $fielddata, &$input)
|
||||
|
||||
@@ -265,4 +265,10 @@ class Data
|
||||
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
public static function validateFormFieldImage($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
// validation is handled in \Froxlor\Settings\Store::storeSettingImage()
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ class Validate
|
||||
}
|
||||
|
||||
// special case where localhost ip is allowed (mysql-access-hosts for example)
|
||||
if ($allow_localhost && $ip == '127.0.0.1') {
|
||||
if ($allow_localhost && ($ip == '127.0.0.1' || $ip == '::1')) {
|
||||
return $ip . $cidr;
|
||||
}
|
||||
|
||||
|
||||
@@ -1556,7 +1556,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
@@ -2547,6 +2547,7 @@ plugin {
|
||||
</file>
|
||||
</files>
|
||||
<commands index="1">
|
||||
<command><![CDATA[sed -i.bak 's/^!include auth-system.conf.ext/#!include auth-system.conf.ext/' /etc/dovecot/conf.d/10-auth.conf]]></command>
|
||||
<command><![CDATA[service dovecot restart]]></command>
|
||||
</commands>
|
||||
</general>
|
||||
|
||||
@@ -1556,7 +1556,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -1585,7 +1585,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -1541,7 +1541,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -1585,7 +1585,7 @@ noc: root
|
||||
security: root
|
||||
|
||||
# change this to a valid e-mail address you can access
|
||||
root: root@<SERVERNAME>
|
||||
root: <ADMIN_MAIL>
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
|
||||
@@ -59,7 +59,7 @@ return [
|
||||
'label' => lng('login.password'),
|
||||
'type' => 'password',
|
||||
'autocomplete' => 'off',
|
||||
'placeholder' => lng('admin.username_default_msg'),
|
||||
'placeholder' => lng('admin.password_default_msg'),
|
||||
'next_to' => [
|
||||
'new_customer_password_suggestion' => [
|
||||
'next_to_prefix' => lng('customer.generated_pwd') . ':',
|
||||
|
||||
@@ -143,6 +143,18 @@ return [
|
||||
'mandatory' => true,
|
||||
'value' => old('admin_email', null, 'installation'),
|
||||
],
|
||||
'use_admin_email_as_sender' => [
|
||||
'label' => lng('install.admin.use_admin_email_as_sender'),
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
'checked' => old('use_admin_email_as_sender', '1', 'installation'),
|
||||
],
|
||||
'sender_email' => [
|
||||
'label' => lng('serversettings.adminmail.title'),
|
||||
'placeholder' => lng('install.admin.use_autogenerated_email_as_sender'),
|
||||
'type' => 'email',
|
||||
'value' => old('sender_email', null, 'installation'),
|
||||
],
|
||||
]
|
||||
],
|
||||
'step3' => [
|
||||
|
||||
@@ -112,9 +112,14 @@ function vite($basehref, array $filenames): string
|
||||
$assetDirectory = '/templates/' . $matches[1] . '/build/';
|
||||
$viteManifest = dirname(__DIR__) . $assetDirectory . '/manifest.json';
|
||||
$manifest = json_decode(file_get_contents($viteManifest), true);
|
||||
$links[] = $basehref . ltrim($assetDirectory, '/') . $manifest[$filename]['file'];
|
||||
if (!empty($manifest[$filename]['file'])) {
|
||||
$links[] = $basehref . ltrim($assetDirectory, '/') . $manifest[$filename]['file'];
|
||||
} else {
|
||||
// additional asset from config.json that was not prebuilt on release (e.g. custom.css)
|
||||
$links[] = $filename;
|
||||
}
|
||||
} else {
|
||||
$links = $filenames;
|
||||
$links[] = $filename;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
11
lib/init.php
11
lib/init.php
@@ -115,14 +115,15 @@ if (!isset($sql) || !is_array($sql)) {
|
||||
/**
|
||||
* Show nice note if requested domain is "unknown" to froxlor and thus is being lead to its vhost
|
||||
*/
|
||||
if ($_SERVER['SERVER_NAME'] != Settings::Get('system.hostname') &&
|
||||
$req_host = UI::getCookieHost();
|
||||
if ($req_host != Settings::Get('system.hostname') &&
|
||||
Settings::Get('panel.is_configured') == 1 &&
|
||||
!filter_var($_SERVER['SERVER_NAME'], FILTER_VALIDATE_IP) && (
|
||||
!filter_var($req_host, FILTER_VALIDATE_IP) && (
|
||||
empty(Settings::Get('system.froxloraliases')) ||
|
||||
(!empty(Settings::Get('system.froxloraliases')) && !in_array($_SERVER['SERVER_NAME'], array_map('trim', explode(',', Settings::Get('system.froxloraliases')))))
|
||||
(!empty(Settings::Get('system.froxloraliases')) && !in_array($req_host, array_map('trim', explode(',', Settings::Get('system.froxloraliases')))))
|
||||
)) {
|
||||
// not the froxlor system-hostname, show info page for domains not configured in froxlor
|
||||
$redirect_file = FileDir::getUnknownDomainTemplate($_SERVER['SERVER_NAME']);
|
||||
$redirect_file = FileDir::getUnknownDomainTemplate($req_host ?? "non-detectable http-host");
|
||||
header('Location: '.$redirect_file);
|
||||
die();
|
||||
}
|
||||
@@ -224,7 +225,7 @@ if (is_array($_themeoptions) && (!array_key_exists('variants', $_themeoptions) |
|
||||
}
|
||||
|
||||
if (array_key_exists('global', $_themeoptions)) {
|
||||
$_themeoptions['variants'][$themevariant] = array_merge_recursive($_themeoptions['variants'][$themevariant], $_themeoptions['global']);
|
||||
$_themeoptions['variants'][$themevariant] = PhpHelper::array_merge_recursive_distinct($_themeoptions['global'], $_themeoptions['variants'][$themevariant]);
|
||||
}
|
||||
|
||||
// check for custom header-graphic
|
||||
|
||||
@@ -49,6 +49,7 @@ return [
|
||||
'field' => 'domains',
|
||||
'callback' => [PHPConf::class, 'domainList'],
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
],
|
||||
'fpmdesc' => [
|
||||
'label' => lng('admin.phpsettings.fpmdesc'),
|
||||
|
||||
@@ -67,6 +67,7 @@ return [
|
||||
'customer_add' => 'Kunden anlegen',
|
||||
'customer_edit' => 'Kunden bearbeiten',
|
||||
'username_default_msg' => 'Leer lassen für automatische Benutzername-Vergabe',
|
||||
'password_default_msg' => 'Leer lassen für Passwortgenerierung',
|
||||
'domains' => 'Domains',
|
||||
'domain_add' => 'Domain anlegen',
|
||||
'domain_edit' => 'Domain bearbeiten',
|
||||
@@ -1315,6 +1316,7 @@ Vielen Dank, Ihr Administrator',
|
||||
'certificate_reallydelete' => 'Wollen Sie diese Zertifikat wirklich löschen?',
|
||||
'cache_reallydelete' => 'Wollen Sie den Cache wirklich leeren?',
|
||||
'please_enter_otp' => 'Bitte 2FA Code eingeben',
|
||||
'admin_mysqlserver_reallydelete' => 'Wollen Sie wirklich diesen MySQL-Server löschen?',
|
||||
],
|
||||
'serversettings' => [
|
||||
'session_timeout' => [
|
||||
@@ -2252,6 +2254,8 @@ Vielen Dank, Ihr Administrator',
|
||||
'top' => 'Admin Konto',
|
||||
'title' => 'Erstellen des Haupt-Administrators.',
|
||||
'description' => 'Dieser Benutzer erhält alle Berechtigungen zur Anpassungen von Einstellungen und Erstellen/Bearbeiten/Löschen von Resourcen wie Kunden, Domains, etc.',
|
||||
'use_admin_email_as_sender' => 'Verwende die oben angegebene E-Mail-Adresse als Absenderadresse. Wenn die Option deaktiviert ist, geben Sie unten bitte eine Absenderadresse an.',
|
||||
'use_autogenerated_email_as_sender' => 'Leer lassen für Standard: admin@servername',
|
||||
],
|
||||
'system' => [
|
||||
'top' => 'System Setup',
|
||||
@@ -2266,7 +2270,7 @@ Vielen Dank, Ihr Administrator',
|
||||
'install' => [
|
||||
'top' => 'Abschluss',
|
||||
'title' => 'Ein letzter Schritt...',
|
||||
'description' => 'Der untenstehende Befehl lädt, installiert und konfiguriert die benötigten Dienste auf dem System aufgrund der Angaben die während des Installationsprozessen gesammelt wurden.<br><br><span class="text-danger">Führe die gezeigten Befehle als <b>root</b> in der Shell/Konsole des Servers aus.</span>',
|
||||
'description' => 'Der untenstehende Befehl lädt, installiert und konfiguriert die benötigten Dienste auf dem System aufgrund der Angaben die während des Installationsprozessen gesammelt wurden.<br><br><span class="text-danger">Führe die gezeigten Befehle als <b>root</b> in der Shell/Konsole des Servers aus. <b>Beachte bitte</b> das dieser Befehl vorhandene Konfigurationen <b>überschreibt</b> (Sicherungsdateien werden erstellt)!<br>Sollte dies nicht gewünscht sein, wähle <i>Ich werden die Dienste manuell konfigurieren</i> am Ende dieser Seite.</span>',
|
||||
'runcmd' => 'Folgende Befehle ausführen, um die Installation abzuschließen:',
|
||||
'manual_config' => 'Ich werden die Dienste manuell konfigurieren, direkt zum Login umleiten',
|
||||
'waitforconfig' => 'Warte auf Abschluss der Dienstkonfiguration...',
|
||||
|
||||
@@ -68,6 +68,7 @@ return [
|
||||
'customer_add' => 'Create customer',
|
||||
'customer_edit' => 'Edit customer',
|
||||
'username_default_msg' => 'Leave empty for autogenerated value',
|
||||
'password_default_msg' => 'Autogenerated if empty',
|
||||
'domains' => 'Domains',
|
||||
'domain_add' => 'Create domain',
|
||||
'domain_edit' => 'Edit domain',
|
||||
@@ -1430,6 +1431,7 @@ Yours sincerely, your administrator',
|
||||
'certificate_reallydelete' => 'Do you really want to delete this certificate?',
|
||||
'cache_reallydelete' => 'Do you really want to clear the cache?',
|
||||
'please_enter_otp' => 'Please enter 2FA code',
|
||||
'admin_mysqlserver_reallydelete' => 'Do you really want to delete this MySQL-server?',
|
||||
],
|
||||
'redirect_desc' => [
|
||||
'rc_default' => 'default',
|
||||
@@ -2388,6 +2390,8 @@ Yours sincerely, your administrator',
|
||||
'top' => 'Admin user',
|
||||
'title' => 'Let\'s create the main administrator user.',
|
||||
'description' => 'This user will be granted all privileges to adjust settings and add/update/delete resources like customers, domains, etc.',
|
||||
'use_admin_email_as_sender' => 'Use the email address above as sender address. If unchecked, please specify a sender address below.',
|
||||
'use_autogenerated_email_as_sender' => 'Leave empty for default: admin@servername',
|
||||
],
|
||||
'system' => [
|
||||
'top' => 'System setup',
|
||||
@@ -2402,7 +2406,7 @@ Yours sincerely, your administrator',
|
||||
'install' => [
|
||||
'top' => 'Finish setup',
|
||||
'title' => 'One last step...',
|
||||
'description' => 'The command below will download, install and configure required services on your system according to the data you have given in this installation process.<br><br><span class="text-danger">Be sure to run the following command as <b>root</b> on the server\'s shell/terminal.</span>',
|
||||
'description' => 'The command below will download, install and configure required services on your system according to the data you have given in this installation process.<br><br><span class="text-danger">Be sure to run the following command as <b>root</b> on the server\'s shell/terminal and <b>be aware</b> that this command will <b>overwrite</b> any existing configuration for the used services (backups will be created)!.<br>If you do not want to overwrite any configurations, select <i>I will manually configure the services</i> at the bottom of this page!</span>',
|
||||
'runcmd' => 'Run the following command to finish the installation:',
|
||||
'manual_config' => 'I will manually configure the services, just take me to the login',
|
||||
'waitforconfig' => 'Waiting for services to be configured...',
|
||||
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -19,7 +19,7 @@
|
||||
"postcss": "^8.1.14",
|
||||
"resolve-url-loader": "^5.0.0",
|
||||
"sass": "^1.69.3",
|
||||
"vite": "^4.0.0",
|
||||
"vite": "^4.4.12",
|
||||
"vue": "^3.2.37"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1156,9 +1156,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "4.4.11",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz",
|
||||
"integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==",
|
||||
"version": "4.4.12",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.12.tgz",
|
||||
"integrity": "sha512-KtPlUbWfxzGVul8Nut8Gw2Qe8sBzWY+8QVc5SL8iRFnpnrcoCaNlzO40c1R6hPmcdTwIPEDkq0Y9+27a5tVbdQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.18.10",
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"postcss": "^8.1.14",
|
||||
"resolve-url-loader": "^5.0.0",
|
||||
"sass": "^1.69.3",
|
||||
"vite": "^4.0.0",
|
||||
"vite": "^4.4.12",
|
||||
"vue": "^3.2.37"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -8,18 +8,18 @@ export default function () {
|
||||
rules: {
|
||||
'name': {
|
||||
required: function () {
|
||||
return $('#company').val().length === 0 || $('#firstname').val().length > 0;
|
||||
return $('#company').val().trim().length === 0 || $('#firstname').val().trim().length > 0;
|
||||
}
|
||||
},
|
||||
'firstname': {
|
||||
required: function () {
|
||||
return $('#company').val().length === 0 || $('#name').val().length > 0;
|
||||
return $('#company').val().trim().length === 0 || $('#name').val().trim().length > 0;
|
||||
}
|
||||
},
|
||||
'company': {
|
||||
required: function () {
|
||||
return $('#name').val().length === 0
|
||||
&& $('#firstname').val().length === 0;
|
||||
return $('#name').val().trim().length === 0
|
||||
&& $('#firstname').val().trim().length === 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-group-item {
|
||||
background: $white;
|
||||
}
|
||||
|
||||
@include color-mode(dark) {
|
||||
.card, .list-group-item {
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
background-color: $body-tertiary-bg;
|
||||
}
|
||||
|
||||
.form-floating > .form-control::placeholder {
|
||||
color: revert;
|
||||
}
|
||||
|
||||
.form-floating > .form-control:not(:focus)::placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
@include color-mode(dark) {
|
||||
.formfield {
|
||||
border-bottom: $border-color-dark solid 1px;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"global": {
|
||||
"css": [
|
||||
"assets/css/custom.css",
|
||||
"assets/scss/app.scss"
|
||||
"assets/scss/app.scss",
|
||||
"assets/css/custom.css"
|
||||
],
|
||||
"js": [
|
||||
"assets/js/app.js",
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
{% if field.next_to is defined %}
|
||||
<div class="input-group">
|
||||
{% endif %}
|
||||
<input type="{{ field.type }}" {% if field.visible is defined and field.visible == false %} disabled {% endif %} {% if field.type == 'number' and field.min is defined %} min="{{ field.min }}" {% endif %} {% if field.type == 'number' and field.max is defined %} max="{{ field.max }}" {% endif %} {% if field.type != 'number' and field.maxlength is defined %} maxlength="{{ field.maxlength }}" {% endif %} id="{{ id }}" name="{{ id }}" value="{{ field.value|raw }}" class="form-control {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.mandatory is defined and field.mandatory %} required {% endif %} {% if field.readonly is defined and field.readonly %} readonly {% endif %} {% if field.autocomplete is defined %} autocomplete="{{ field.autocomplete }}" {% endif %} {% if field.placeholder is defined %} placeholder="{{ field.placeholder }}" {% endif %} {% if field.type == 'file' and field.accept is defined %} accept="{{ field.accept }}" {% endif %} {% if field.pattern is defined %} pattern="{{ field.pattern }}" {% endif %}/>
|
||||
<input type="{{ field.type }}" {% if (field.visible is defined and field.visible == false) or (field.disabled is defined and field.disabled == true) %} disabled {% endif %} {% if field.type == 'number' and field.min is defined %} min="{{ field.min }}" {% endif %} {% if field.type == 'number' and field.max is defined %} max="{{ field.max }}" {% endif %} {% if field.type != 'number' and field.maxlength is defined %} maxlength="{{ field.maxlength }}" {% endif %} id="{{ id }}" name="{{ id }}" value="{{ field.value|raw }}" class="form-control {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.mandatory is defined and field.mandatory %} required {% endif %} {% if field.readonly is defined and field.readonly %} readonly {% endif %} {% if field.autocomplete is defined %} autocomplete="{{ field.autocomplete }}" {% endif %} {% if field.placeholder is defined %} placeholder="{{ field.placeholder }}" {% endif %} {% if field.type == 'file' and field.accept is defined %} accept="{{ field.accept }}" {% endif %} {% if field.pattern is defined %} pattern="{{ field.pattern }}" {% endif %}/>
|
||||
{% if field.type == 'hidden' and field.display is defined %}
|
||||
<input type="text" readonly class="form-control-plaintext" value="{{ field.display|raw }}">
|
||||
{% endif %}
|
||||
@@ -184,7 +184,7 @@
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% set field = field|merge({'type':'file'}) %}
|
||||
{% set field = field|merge({'type':'file'})|merge({'value':''}) %}
|
||||
{{ _self.input(id, field) }}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
<p>{{ message }}</p>
|
||||
{% if get_config('enable_webupdate') %}
|
||||
<a class='btn d-block btn-outline-warning' href='admin_autoupdate.php?page=overview'>Open updater</a>
|
||||
{% else %}
|
||||
<p>Run the following command in your shell to update:</p>
|
||||
<code>{{ call_static('\\Froxlor\\Froxlor', 'getInstallDir') }}bin/froxlor-cli froxlor:update</code>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
aria-valuemin="0" aria-valuemax="{{ apcuinfo.mem_avail }}">
|
||||
<div class="progress-bar bg-success" style="width: {{ apcuinfo.mem_used_percentage }}%"></div>
|
||||
<small
|
||||
class="justify-content-center d-flex position-absolute w-100 text-dark">{{ apcuinfo.mem_used_percentage }}
|
||||
class="justify-content-center d-flex position-absolute w-100">{{ apcuinfo.mem_used_percentage }}
|
||||
%</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -51,8 +51,16 @@
|
||||
|
||||
<div class="row">
|
||||
{% if userinfo.adminsession == 1 %}
|
||||
<div
|
||||
class="col-12 col-lg-6">
|
||||
<div class="col-12 col-lg-6">
|
||||
|
||||
{% if userinfo.custom_notes|markdown is not empty and userinfo.custom_notes_show == 1 %}
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
{{ userinfo.custom_notes|markdown|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# system infos #}
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
@@ -135,22 +143,9 @@
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if userinfo.custom_notes|markdown is not empty and userinfo.custom_notes_show == 1 %}
|
||||
<div class="card mb-3">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item list-group-item-info d-flex justify-content-between align-items-start">
|
||||
<div class="ms-2 me-auto">
|
||||
{{ userinfo.custom_notes|markdown|raw }}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div
|
||||
class="col-12 col-md-6 col-lg-4">
|
||||
<div class="col-12 col-md-6 col-lg-4">
|
||||
{# account info #}
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
@@ -212,8 +207,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="col-12 col-md-6 col-lg-4">
|
||||
<div class="col-12 col-md-6 col-lg-4">
|
||||
{# customer details #}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
{% if userinfo.adminsession == 1 %}
|
||||
const labelsC = [];
|
||||
const dataValues = [];
|
||||
{% for user in users|sort((a, b) => a.total <=> b.total)|slice(0, 5) %}
|
||||
{% for user in users|slice(0, 5) %}
|
||||
labelsC.push('{{ user.loginname }}');
|
||||
dataValues.push({value: '{{ user.total|default(0) }}', formatted: '{{ user.total|formatBytes }}'});
|
||||
{% endfor %}
|
||||
|
||||
@@ -426,10 +426,10 @@ class MailsTest extends TestCase
|
||||
$this->assertEquals(1, $result['popaccountid']);
|
||||
|
||||
switch (Settings::Get('system.passwordcryptfunc')) {
|
||||
case PASSWORD_ARGON2I:
|
||||
case defined('PASSWORD_ARGON2I') && PASSWORD_ARGON2I:
|
||||
$cpPrefix = '{ARGON2I}';
|
||||
break;
|
||||
case PASSWORD_ARGON2ID:
|
||||
case defined('PASSWORD_ARGON2ID') && PASSWORD_ARGON2ID:
|
||||
$cpPrefix = '{ARGON2ID}';
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user