diff --git a/actions/admin/settings/110.accounts.php b/actions/admin/settings/110.accounts.php index 71628dec..8eaee480 100644 --- a/actions/admin/settings/110.accounts.php +++ b/actions/admin/settings/110.accounts.php @@ -205,9 +205,21 @@ return array( 'default' => false, 'cronmodule' => 'froxlor/backup', 'save_method' => 'storeSettingField' - ) + ), + 'system_createstdsubdom_default' => array( + 'label' => $lng['serversettings']['createstdsubdom_default'], + 'settinggroup' => 'system', + 'varname' => 'createstdsubdom_default', + 'type' => 'option', + 'default' => '1', + 'option_mode' => 'one', + 'option_options' => array( + '0' => $lng['panel']['no'], + '1' => $lng['panel']['yes'] + ), + 'save_method' => 'storeSettingField' + ), ) ) ) ); - diff --git a/install/froxlor.sql b/install/froxlor.sql index 80260d1d..0df87d0d 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -678,6 +678,7 @@ opcache.interned_strings_buffer'), ('system', 'include_default_vhostconf', '0'), ('system', 'soaemail', ''), ('system', 'domaindefaultalias', '0'), + ('system', 'createstdsubdom_default', '1'), ('api', 'enabled', '0'), ('2fa', 'enabled', '1'), ('panel', 'decimal_places', '4'), @@ -720,7 +721,7 @@ opcache.interned_strings_buffer'), ('panel', 'logo_overridetheme', '0'), ('panel', 'logo_overridecustom', '0'), ('panel', 'version', '0.10.27'), - ('panel', 'db_version', '202107200'); + ('panel', 'db_version', '202107210'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index 049569c3..b94e5add 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -875,3 +875,10 @@ if (\Froxlor\Froxlor::isDatabaseVersion('202107070')) { lastStepStatus(0); \Froxlor\Froxlor::updateToDbVersion('202107200'); } + +if (\Froxlor\Froxlor::isDatabaseVersion('202107200')) { + showUpdateStep("Adding settings to define default value of 'create std-subdomain' when creating a customer", true); + Settings::AddNew("system.createstdsubdom_default", '1'); + lastStepStatus(0); + \Froxlor\Froxlor::updateToDbVersion('202107210'); +} diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index dd3855f5..29f0ddeb 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -308,7 +308,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource * @param bool $mysqls_ul * optional, whether customer should have unlimited mysql-databases, default 0 (false) * @param bool $createstdsubdomain - * optional, whether to create a standard-subdomain ([loginname].froxlor-hostname.tld), default 0 (false) + * optional, whether to create a standard-subdomain ([loginname].froxlor-hostname.tld), default [system.createstdsubdom_default] * @param bool $phpenabled * optional, whether to allow usage of PHP, default 0 (false) * @param array $allowed_phpconfigs @@ -352,7 +352,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $gender = (int) $this->getParam('gender', true, 0); $custom_notes = $this->getParam('custom_notes', true, ''); $custom_notes_show = $this->getBoolParam('custom_notes_show', true, 0); - $createstdsubdomain = $this->getBoolParam('createstdsubdomain', true, 0); + $createstdsubdomain = $this->getBoolParam('createstdsubdomain', true, Settings::Get('system.createstdsubdom_default')); $password = $this->getParam('new_customer_password', true, ''); $sendpassword = $this->getBoolParam('sendpassword', true, 0); $store_defaultindex = $this->getBoolParam('store_defaultindex', true, 0); diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 240935aa..ebfd295f 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -10,7 +10,7 @@ final class Froxlor const VERSION = '0.10.27'; // Database version (YYYYMMDDC where C is a daily counter) - const DBVERSION = '202107200'; + const DBVERSION = '202107210'; // Distribution branding-tag (used for Debian etc.) const BRANDING = ''; diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 51f4b062..3fe58af5 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -37,7 +37,7 @@ return array( ) ), 'value' => array( - '1' + \Froxlor\Settings::Get('system.createstdsubdom_default') ) ), 'store_defaultindex' => array( diff --git a/lng/english.lng.php b/lng/english.lng.php index 49867ef4..330f8b14 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2127,3 +2127,4 @@ $lng['serversettings']['logo_overridetheme']['title'] = 'Overwrites logo defined $lng['serversettings']['logo_overridetheme']['description'] = 'This needs to be set to "true" if you intend to use your uploaded logo; alternatively you can still use the theme-based "logo_custom.png" and "logo_custom_login.png" possibility.'; $lng['serversettings']['logo_overridecustom']['title'] = 'Overwrite custom logo (logo_custom.png and logo_custom_login.png) defined in theme by "Logo Image" (Header and Login, see below)'; $lng['serversettings']['logo_overridecustom']['description'] = 'Set this to "true" if you want to ignore theme-specific custom logos for header and login and use "Logo Image"'; +$lng['serversettings']['createstdsubdom_default']['title'] = 'Preselected value for "'.$lng['admin']['stdsubdomain_add'].'" when creating a customer'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 02335bb5..c7e75603 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1773,3 +1773,4 @@ $lng['serversettings']['logo_overridetheme']['title'] = 'Überschreibe Theme-Log $lng['serversettings']['logo_overridetheme']['description'] = 'Ist die Nutzung eines hochgeladenen Logos gewünscht, muss diese Einstellung auf "Ja" gesetzt werden. Alternativ kann weiterhin das Theme-basierte Überschreiben via "logo_custom.png" und "logo_custom_login.png" genutzt werden.'; $lng['serversettings']['logo_overridecustom']['title'] = 'Überschreibe benutzerdefinierte Theme-Logos (logo_custom.png und logo_custom_login.png) mit "Logo Bold" (Header und Login, siehe unten)'; $lng['serversettings']['logo_overridecustom']['description'] = 'Ist diese Einstellung aktiv, werden benutzerdefinierte Logos im Theme-Ordner mit dem "Logo Bild" ersetzt'; +$lng['serversettings']['createstdsubdom_default']['title'] = 'Standardwert für "'.$lng['admin']['stdsubdomain_add'].'" bei Erstellung eines Kunden';