when not using awstats, disable awstats-related settings; add minor tweaks to unit-tests
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -34,7 +34,7 @@ return array(
|
|||||||
2 => $lng['admin']['webalizer']['veryquiet']
|
2 => $lng['admin']['webalizer']['veryquiet']
|
||||||
),
|
),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 0
|
||||||
),
|
),
|
||||||
'system_awstats_enabled' => array(
|
'system_awstats_enabled' => array(
|
||||||
'label' => $lng['serversettings']['awstats_enabled'],
|
'label' => $lng['serversettings']['awstats_enabled'],
|
||||||
@@ -51,7 +51,8 @@ return array(
|
|||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/usr/bin/',
|
'default' => '/usr/bin/',
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField',
|
||||||
|
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||||
),
|
),
|
||||||
'system_awstats_awstatspath' => array(
|
'system_awstats_awstatspath' => array(
|
||||||
'label' => $lng['serversettings']['awstats_awstatspath'],
|
'label' => $lng['serversettings']['awstats_awstatspath'],
|
||||||
@@ -60,7 +61,8 @@ return array(
|
|||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/usr/bin/',
|
'default' => '/usr/bin/',
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField',
|
||||||
|
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||||
),
|
),
|
||||||
'system_awstats_conf' => array(
|
'system_awstats_conf' => array(
|
||||||
'label' => $lng['serversettings']['awstats_conf'],
|
'label' => $lng['serversettings']['awstats_conf'],
|
||||||
@@ -69,7 +71,8 @@ return array(
|
|||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/etc/awstats/',
|
'default' => '/etc/awstats/',
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField',
|
||||||
|
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||||
),
|
),
|
||||||
'system_awstats_icons' => array(
|
'system_awstats_icons' => array(
|
||||||
'label' => $lng['serversettings']['awstats_icons'],
|
'label' => $lng['serversettings']['awstats_icons'],
|
||||||
@@ -78,7 +81,8 @@ return array(
|
|||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/usr/share/awstats/icon/',
|
'default' => '/usr/share/awstats/icon/',
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField',
|
||||||
|
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||||
),
|
),
|
||||||
'system_awstats_logformat' => array(
|
'system_awstats_logformat' => array(
|
||||||
'label' => $lng['serversettings']['awstats']['logformat'],
|
'label' => $lng['serversettings']['awstats']['logformat'],
|
||||||
@@ -86,7 +90,8 @@ return array(
|
|||||||
'varname' => 'awstats_logformat',
|
'varname' => 'awstats_logformat',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '1',
|
'default' => '1',
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField',
|
||||||
|
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -61,12 +61,17 @@ class CustomersTest extends TestCase
|
|||||||
$this->assertEquals(15, $result['subdomains']);
|
$this->assertEquals(15, $result['subdomains']);
|
||||||
$this->assertEquals('secret', $result['custom_notes']);
|
$this->assertEquals('secret', $result['custom_notes']);
|
||||||
|
|
||||||
// validate that the std-subdomain has been added
|
$stdsubdomain = $result['standardsubdomain'] ?? false;
|
||||||
$json_result = SubDomains::getLocal($admin_userdata, array(
|
if (! $stdsubdomain) {
|
||||||
'id' => $result['standardsubdomain']
|
$this->fail('No standardsubdomain where there should be one');
|
||||||
))->get();
|
} else {
|
||||||
$result = json_decode($json_result, true)['data'];
|
// validate that the std-subdomain has been added
|
||||||
$this->assertEquals('test1.dev.froxlor.org', $result['domain']);
|
$json_result = SubDomains::getLocal($admin_userdata, array(
|
||||||
|
'id' => $result['standardsubdomain']
|
||||||
|
))->get();
|
||||||
|
$result = json_decode($json_result, true)['data'];
|
||||||
|
$this->assertEquals('test1.dev.froxlor.org', $result['domain']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAdminCustomersAddEmptyMail()
|
public function testAdminCustomersAddEmptyMail()
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class DomainsTest extends TestCase
|
|||||||
$result = json_decode($json_result, true)['data'];
|
$result = json_decode($json_result, true)['data'];
|
||||||
$this->assertEquals($customer_userdata['documentroot'] . 'test.local/', $result['documentroot']);
|
$this->assertEquals($customer_userdata['documentroot'] . 'test.local/', $result['documentroot']);
|
||||||
$this->assertTrue(in_array('TLSv1.3', explode(",", $result['ssl_protocols'])));
|
$this->assertTrue(in_array('TLSv1.3', explode(",", $result['ssl_protocols'])));
|
||||||
|
$this->assertEquals('0', $result['isemaildomain']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user