edit ACL method after generate domain

This commit is contained in:
Guillaume ARNOUX 2024-01-22 19:08:16 +01:00
parent 18e455fece
commit 6c57b49f0d

View file

@ -183,7 +183,43 @@ class Server_Manager_Mailcow extends Server_Manager
]
];
$result2 = $this->_makeRequest('POST', 'add/domain-admin', $domainAdminData);
if (! str_contains($result2, 'success')) {
if (str_contains($result2, 'success')) {
$domainAclData = [
'json' => [
"items" => [
"adm_" . str_replace(".", "", $a->getDomain())
],
"attr" => [
"da_acl" => [
"quarantine",
"login_as",
"sogo_access",
"app_passwds",
"bcc_maps",
"filters",
"spam_policy",
"protocol_access",
"smtp_ip_access",
]
]
]
];
$result3 = $this->_makeRequest('POST', 'edit/da-acl', $domainAclData);
if (!str_contains($result3, 'success')) {
$placeholders = [':action:' => 'edit ACL', ':type:' => 'Mailcow'];
throw new Server_Exception('Failed to :action: on the :type: server, check the error logs for further details', $placeholders);
}
}
else {
$placeholders = [':action:' => __trans('create domain'), ':type:' => 'Mailcow'];
throw new Server_Exception('Failed to :action: on the :type: server, check the error logs for further details', $placeholders);