new setting to select default value of 'allow api access' for new customers; fixes #1087

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-02-03 14:16:37 +01:00
parent ee8385467b
commit 7686effc8c
8 changed files with 27 additions and 4 deletions

View File

@@ -298,7 +298,7 @@ class Customers extends ApiCommand implements ResourceEntity
$fax = $this->getParam('fax', true, '');
$customernumber = $this->getParam('customernumber', true, '');
$def_language = $this->getParam('def_language', true, Settings::Get('panel.standardlanguage'));
$api_allowed = $this->getBoolParam('api_allowed', true, Settings::Get('api.enabled'));
$api_allowed = $this->getBoolParam('api_allowed', true, (Settings::Get('api.enabled') && Settings::Get('api.customer_default')));
$gender = (int)$this->getParam('gender', true, 0);
$custom_notes = $this->getParam('custom_notes', true, '');
$custom_notes_show = $this->getBoolParam('custom_notes_show', true, 0);

View File

@@ -34,7 +34,7 @@ final class Froxlor
const VERSION = '2.0.10';
// Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202301180';
const DBVERSION = '202302030';
// Distribution branding-tag (used for Debian etc.)
const BRANDING = '';

View File

@@ -87,7 +87,7 @@ return [
'desc' => lng('usersettings.api_allowed.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => Settings::Get('api.enabled') == '1',
'checked' => Settings::Get('api.enabled') == '1' && Settings::Get('api.customer_default'),
'visible' => Settings::Get('api.enabled') == '1'
]
]