do not allow setting www as CNAME record if domain has automatic www-Alias enabled, fixes #895
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -4,6 +4,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\Api\Commands\Customers;
|
||||
use Froxlor\Api\Commands\DomainZones;
|
||||
use Froxlor\Api\Commands\Domains;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -719,6 +720,31 @@ class DomainZonesTest extends TestCase
|
||||
DomainZones::getLocal($admin_userdata, $data)->add();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @depends testAdminDomainZonesAddCname
|
||||
*/
|
||||
public function testAdminDomainZonesAddCnameInvalidWwwAlias()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
// set domain to www-alias
|
||||
$data = [
|
||||
'domainname' => 'test2.local',
|
||||
'selectserveralias' => '1'
|
||||
];
|
||||
Domains::getLocal($admin_userdata, $data)->update();
|
||||
|
||||
$data = [
|
||||
'domainname' => 'test2.local',
|
||||
'record' => 'www',
|
||||
'type' => 'CNAME',
|
||||
'content' => 'testing.local'
|
||||
];
|
||||
$this->expectExceptionMessage('Cannot set CNAME record for "www" as domain is set to generate a www-alias. Please change settings to either "No alias" or "Wildcard alias"');
|
||||
DomainZones::getLocal($admin_userdata, $data)->add();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @depends testAdminDomainZonesAddCname
|
||||
|
||||
Reference in New Issue
Block a user