Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117698640
D10.1774880882.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D10.1774880882.diff
View Options
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -1594,6 +1594,12 @@
return $valid;
}
+ /**
+ * Lists the valid domains given a primary domain name space.
+ *
+ * Includes the parent domain and any alias or child domains.
+ * Considers domains that point to the same base dn to be child domains.
+ */
private function _get_valid_domains($my_primary_domain = null)
{
$my_primary_domain = $my_primary_domain !== null
@@ -1604,10 +1610,11 @@
$conf = Conf::get_instance();
$all_domains = $auth->list_domains();
$all_domains = $all_domains['list'];
+ $all_basedns = Array();
$dna = $conf->get('domain_name_attribute');
+ $dra = $conf->get('domain_rootdn_attribute');
- Log::trace("__get_valid_domains( " . $my_primary_domain . ")");
- Log::trace("\$all_domains includes: " . var_export($all_domains, TRUE) . " (must include domain for \$my_primary_domain)");
+ Log::trace("_get_valid_domains(" . $my_primary_domain . ")");
$valid_domains = $my_primary_domain ? array($my_primary_domain) : array();
foreach ($all_domains as $domain_id => $domain_attrs) {
@@ -1618,9 +1625,27 @@
if (in_array($my_primary_domain, $domain_attrs[$dna])) {
$valid_domains = array_merge($valid_domains, $domain_attrs[$dna]);
}
+
+ if (array_key_exists($dra, $domain_attrs)) {
+ if (array_key_exists($domain_attrs[$dra], $all_basedns)) {
+ $all_basedns[$domain_attrs[$dra]] = array_merge($all_basedns[$domain_attrs[$dra]], $domain_attrs[$dna]);
+ } else {
+ $all_basedns[$domain_attrs[$dra]] = $domain_attrs[$dna];
+ }
+ }
}
- return array_unique($valid_domains);
+ foreach ($all_basedns as $base_dn => $domains) {
+ if (in_array($my_primary_domain, $domains)) {
+ $valid_domains = array_merge($valid_domains, $domains);
+ }
+ }
+
+ $result = array_unique($valid_domains);
+
+ Log::trace("_get_valid_domains result: " . var_export($result, TRUE));
+
+ return array_unique($result);
}
private function _validate_email_address_in_any_of_my_domains($mail_address)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 30, 2:28 PM (3 d, 11 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18813585
Default Alt Text
D10.1774880882.diff (2 KB)
Attached To
Mode
D10: Compare the configured base DNs of domains that are visible as to be able to associate child domain name spaces with parent domain name spaces.
Attached
Detach File
Event Timeline