summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eead41c)
raw | patch | inline | side by side (parent: eead41c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Dec 2009 09:30:54 +0000 (09:30 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Dec 2009 09:30:54 +0000 (09:30 +0000) |
-This tag is forwarded to the selected filter method e.g. filterLDAP and allows to implement special search methods like 'cat', which is required for the ACL listing for example. Else, we wont be able to edit ACLs setting appended the the ldap base object.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14926 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14926 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_filter.inc | patch | blob | history | |
gosa-core/include/class_filterLDAP.inc | patch | blob | history |
index 9b2fed5458381bcf79bba4e76752ac552e2b6042..286725978de42d16a0ae507d2dd0f39f7e2a7513 100644 (file)
$filter= $query['filter'];
$attributes= $query['attribute'];
+ $method = "";
+ if(isset($query['method'])) $method = $query['method'];
+
// Generate final filter
foreach ($this->elements as $tag => $element) {
if (!isset($element['set']) || !isset($element['unset'])) {
}
}
- $result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, $this->category, $this->objectStorage));
+ $result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, $this->category,$method, $this->objectStorage));
+ $result = call_user_func(array($backend, 'unifyResults'), $result);
}
return ($result);
index 7697462049580281c7976e3314516cdeafd5e74f..d49463ae6aee9331b47e6b512224ac53ae1e599f 100644 (file)
class filterLDAP {
- static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "")
+ static function query($base, $scope, $filter, $attributes, $category, $method,$objectStorage= "")
{
$config= session::global_get('config');
$ldap= $config->get_ldap_link(TRUE);
$flag= ($scope == "sub")?GL_SUBSEARCH:0;
- $result= filterLDAP::get_list($base, $filter, $attributes, $category, $objectStorage, $flag | GL_SIZELIMIT);
+ $result= filterLDAP::get_list($base, $filter, $attributes, $category, $objectStorage,$method, $flag | GL_SIZELIMIT);
return $result;
}
+
+ static function unifyResults($results)
+ {
+ $res = array();
+ foreach($results as $entry){
+ if(!isset($res[$entry['dn']])){
+ $res[$entry['dn']] = $entry;
+ }
+ }
+ return(array_values($res));
+ }
+
- static function get_list($base, $filter, $attributes, $category, $objectStorage, $flags= GL_SUBSEARCH)
+ static function get_list($base, $filter, $attributes, $category, $objectStorage, $method, $flags= GL_SUBSEARCH)
{
$ui= session::global_get('ui');
$config= session::global_get('config');
if (!is_array($objectStorage)) {
$objectStorage= array($objectStorage);
}
- $method= (empty($objectStorage) && !($flags & GL_SUBSEARCH))?"ls":"search";
+ if(empty($method)){
+ $method= (empty($objectStorage) && !($flags & GL_SUBSEARCH))?"ls":"search";
+ }
// Initialize search bases
$bases= array();