Page MenuHomePhorge

D907.1775312823.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D907.1775312823.diff

diff --git a/lib/api/kolab_api_service_domain.php b/lib/api/kolab_api_service_domain.php
--- a/lib/api/kolab_api_service_domain.php
+++ b/lib/api/kolab_api_service_domain.php
@@ -174,7 +174,7 @@
$attributes = $this->parse_input_attributes('domain', $postdata, $postdata['type_id']);
- $this->_mod_domain_attrs(null, $attributes);
+ $this->_mod_domain_attrs(null, $attributes, $postdata['id']);
$result = $auth->domain_edit($postdata['id'], $attributes, $postdata['type_id']);
@@ -278,7 +278,7 @@
/**
* Modify hosted domain attributes
*/
- protected function _mod_domain_attrs($domain, &$attributes)
+ protected function _mod_domain_attrs($domain, &$attributes, $olddn = null)
{
// Generate attributes (aci, inetdomainbasedn) for hosted domains
$conf = Conf::get_instance();
@@ -328,8 +328,31 @@
. 'ldap:///cn=kolab-admin,' . $mgmt_root_dn . '");)'
);
- $attributes['aci'] = $aci;
- $attributes['inetdomainbasedn'] = $domain_root_dn;
+ // Preserve important old aci and inetdomainbasedn attributes of the
+ // management and hosted domain.
+ if (!empty($olddn)) {
+ $auth = Auth::get_instance();
+ $info = $auth->domain_info($olddn);
+ if (!empty($info)) {
+ $oldattributes = reset($info);
+ if (!empty($oldattributes['inetdomainbasedn'])
+ && $oldattributes['inetdomainbasedn'] == $hosted_root_dn
+ || "dc=".implode(",dc=",explode(".",$domain)) == $mgmt_root_dn
+ ) {
+ $aci = $oldattributes['aci'];
+ if (!empty($oldattributes['inetdomainbasedn'])) {
+ $domain_root_dn = $oldattributes['inetdomainbasedn'];
+ } else {
+ $domain_root_dn = null;
+ }
+ }
+ }
+ }
+
+ $attributes['aci'] = $aci;
+ if (!empty($domain_root_dn)) {
+ $attributes['inetdomainbasedn'] = $domain_root_dn;
+ }
$this->is_hosted = true;
}

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 2:27 PM (17 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18829933
Default Alt Text
D907.1775312823.diff (2 KB)

Event Timeline