index cce5f48cae679dd4efae6d7e1cfa8bd618e2361b..3a9e38d75856c25e3fa1bb45c3019d840dfa3fc5 100644 (file)
}
}
- // Sort elements for element length to allow proper replacing later on
- function strlenSort($a, $b) {
- if (strlen($a['tag']) == strlen($b['tag'])) {
- return 0;
- }
- return (strlen($a['tag']) < strlen($b['tag']) ? -1 : 1);
- }
uasort($this->elements, 'strlenSort');
$this->elements= array_reverse($this->elements);
}
+ function getObjectBase($dn)
+ {
+ global $config;
+ $base= "";
+
+ // Try every object storage
+ $storage= $this->objectStorage;
+ if (!is_array($storage)){
+ $storage= array($storage);
+ }
+ foreach ($storage as $location) {
+ $pattern= "/^[^,]+,".preg_quote($location, '/')."/i";
+ $base= preg_replace($pattern, '', $dn);
+ }
+
+ /* Set to base, if we're not on a correct subtree */
+ if (!isset($config->idepartments[$base])){
+ $base= $config->current['BASE'];
+ }
+
+ return $base;
+ }
+
+
}
+// Sort elements for element length to allow proper replacing later on
+function strlenSort($a, $b) {
+ if (strlen($a['tag']) == strlen($b['tag'])) {
+ return 0;
+ }
+ return (strlen($a['tag']) < strlen($b['tag']) ? -1 : 1);
+}
+
?>