add new setting to preselect system distribution to ease configuration

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-04-30 14:01:49 +02:00
parent 14c86d3d21
commit e768d834c1
6 changed files with 44 additions and 2 deletions

View File

@@ -43,6 +43,11 @@ if ($userinfo['change_serversettings'] == '1') {
// get distro from URL param
$distribution = Request::get('distribution');
// check for possible setting
if (empty($distribution)) {
$distribution = Settings::Get('system.distribution') ?? "";
}
$distributions_select = [];
$services = [];
@@ -53,6 +58,11 @@ if ($userinfo['change_serversettings'] == '1') {
Response::dynamicError("Unknown distribution");
}
// update setting if different
if ($distribution != Settings::Get('system.distribution')) {
Settings::Set('system.distribution', $distribution);
}
// create configparser object
$configfiles = new ConfigParser($config_dir . '/' . $distribution . ".xml");