summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 387ff63)
raw | patch | inline | side by side (parent: 387ff63)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 21 Aug 2009 14:17:27 +0000 (14:17 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 21 Aug 2009 14:17:27 +0000 (14:17 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14107 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_filter.inc | patch | blob | history | |
gosa-core/include/class_filterLDAP.inc | patch | blob | history |
index 0bea6c4a69439e0d332efb044255762bf63b26fa..4a132154ccdc52eed46a0e982dc3dc193604c48e 100644 (file)
var $autocompleter= array();
var $category= "";
var $objectStorage= array();
- var $objectBase= "";
var $base= "";
var $scope= "";
var $query;
}
- function setObjectBase($base) {
- $this->objectBase= $base;
- }
-
-
function setBase($base) {
$this->base= $base;
}
}
$result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes,
- $this->category, $this->objectStorage, $this->objectBase));
+ $this->category, $this->objectStorage));
}
// Make filter
$filter= preg_replace("/\\$$tag/", normalizeLDAP($value), $filter);
- if (isset($config['base']) && isset($config['scope'])
- && isset($config['category']) && isset($config['objectbase']) ) {
+ if (isset($config['base']) && isset($config['scope']) && isset($config['category'])) {
$result= call_user_func(array($backend, 'query'), $config['base'], $config['scope'], $filter, $attributes,
- $config["category"], $config["objectbase"]);
+ $config["category"], $config["objectStorage"]);
} else {
$result= call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes,
- $this->category, $this->objectStorage, $this->objectBase);
+ $this->category, $this->objectStorage);
}
foreach ($result as $entry) {
global $class_mapping;
$result= array();
+ // Introduce maximum number of entries
+ $max= 10;
+
foreach ($this->autocompleters as $tag => $config) {
if(isset($_POST[$tag])){
$result= $this->getCompletitionList($config, $tag, $_POST[$tag]);
+ $result= array_unique($result);
+ asort($result);
echo '<ul>';
foreach ($result as $entry) {
echo '<li>'.$entry.'</li>';
+ if ($max-- == 0) {
+ break;
+ }
}
echo '</ul>';
}
-
}
}
index 3636af9f33a55dff40a2ad7cad6006d1794006f6..5a6701d65540462693a5b681e7b475167d8e2a60 100644 (file)
$bases= array();
// Get list of sub bases to search on
- foreach ($objectStorage as $oc) {
- $oc= preg_replace('/,$/', '', $oc);
- $tmp= split(',', $oc);
- if (count($tmp) == 1) {
- preg_match('/([^=]+)=(.*)$/', $oc, $m);
- if ($flags & GL_SUBSEARCH) {
- $bases[$base][]= $m[1].":dn:=".$m[2];
- } else {
- $bases["$oc,$base"][]= $m[1].":dn:=".$m[2];
- }
- } else {
- // No, there's no \, in pre defined RDN values
- preg_match('/^([^,]+),(.*)$/', $oc, $matches);
- preg_match('/([^=]+)=(.*)$/', $matches[1], $m);
- if ($flags & GL_SUBSEARCH) {
- $bases[$base][]= $m[1].":dn:=".$m[2];
+ if (count($objectStorage) == 0) {
+ $bases[$base]= "";
+ } else {
+ foreach ($objectStorage as $oc) {
+ $oc= preg_replace('/,$/', '', $oc);
+ $tmp= split(',', $oc);
+ if (count($tmp) == 1) {
+ preg_match('/([^=]+)=(.*)$/', $oc, $m);
+ if ($flags & GL_SUBSEARCH) {
+ $bases[$base][]= $m[1].":dn:=".$m[2];
+ } else {
+ $bases["$oc,$base"][]= $m[1].":dn:=".$m[2];
+ }
} else {
- $bases[$matches[2].",$base"][]= $m[1].":dn:=".$m[2];
+ // No, there's no \, in pre defined RDN values
+ preg_match('/^([^,]+),(.*)$/', $oc, $matches);
+ preg_match('/([^=]+)=(.*)$/', $matches[1], $m);
+ if ($flags & GL_SUBSEARCH) {
+ $bases[$base][]= $m[1].":dn:=".$m[2];
+ } else {
+ $bases[$matches[2].",$base"][]= $m[1].":dn:=".$m[2];
+ }
}
}
}
// Switch to new base and search
$ldap->cd($base);
- $dnFilter= "(|";
- foreach ($dnFilters as $df) {
- $dnFilter.= "($df)";
+ if (is_array($dnFilters)){
+ $dnFilter= "(|";
+ foreach ($dnFilters as $df) {
+ $dnFilter.= "($df)";
+ }
+ $dnFilter.= ")";
+ } else {
+ $dnFilter= "";
}
- $dnFilter.= ")";
$ldap->search ("(&$filter$dnFilter)", $attributes);
// Check for size limit exceeded messages for GUI feedback