fix Domains.update() if called as admin/reseller without change_serversettings privileges, thx to rseffner
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -1223,7 +1223,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
||||
$writeaccesslog = $result['writeaccesslog'];
|
||||
$writeerrorlog = $result['writeerrorlog'];
|
||||
$documentroot = $result['documentroot'];
|
||||
|
||||
$ssl_protocols = $p_ssl_protocols;
|
||||
$override_tls = $result['override_tls'];
|
||||
}
|
||||
|
||||
|
||||
@@ -135,6 +135,28 @@ class DomainsTest extends TestCase
|
||||
$this->assertEquals(2, $result['subcanemaildomain']);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @depends testAdminDomainsAdd
|
||||
*/
|
||||
public function testResellerDomainsUpdate()
|
||||
{
|
||||
global $admin_userdata;
|
||||
// get reseller
|
||||
$json_result = Admins::getLocal($admin_userdata, array(
|
||||
'loginname' => 'reseller'
|
||||
))->get();
|
||||
$reseller_userdata = json_decode($json_result, true)['data'];
|
||||
$reseller_userdata['adminsession'] = 1;
|
||||
$data = [
|
||||
'domainname' => 'test2.local',
|
||||
'ssl_protocols' => 'TLSv1'
|
||||
];
|
||||
$json_result = Domains::getLocal($reseller_userdata, $data)->update();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEmpty($result['ssl_protocols']);
|
||||
}
|
||||
|
||||
public function testAdminDomainsAddSysHostname()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
@@ -246,7 +246,7 @@ class IpsAndPortsTest extends TestCase
|
||||
'ip' => '123.123.123.123'
|
||||
];
|
||||
$this->expectExceptionMessage("You cannot change the last system IP, either create another new IP/Port combination for the system IP or change the system IP.");
|
||||
$json_result = IpsAndPorts::getLocal($admin_userdata, $data)->update();
|
||||
IpsAndPorts::getLocal($admin_userdata, $data)->update();
|
||||
}
|
||||
|
||||
public function testResellerIpsAndPortsEditNoDuplicate()
|
||||
|
||||
Reference in New Issue
Block a user