summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 78a6813)
raw | patch | inline | side by side (parent: 78a6813)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Jan 2010 10:53:34 +0000 (10:53 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Jan 2010 10:53:34 +0000 (10:53 +0000) |
-Filter out invalid target bases
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15193 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15193 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_baseSelectDialog.inc | patch | blob | history |
diff --git a/gosa-core/include/class_baseSelectDialog.inc b/gosa-core/include/class_baseSelectDialog.inc
index a4fbf387aa53b9e7785b0982081bdf41c28f235d..017b7da76ee97eb5c664b0eb44af616333e87a25 100644 (file)
$this->config = $config;
$this->ui = get_userinfo();
$this->allowedBases = $onlyAllowThisBases;
+ session::set('filterBaseSelect_WhiteList', &$this->allowedBases);
# // Build filter
# if (session::global_is_set(get_class($this)."_filter")){
return($action);
}
}
+
+class filterBaseSelect extends filterLDAP
+{
+ static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "")
+ {
+ $res= filterLDAP::query($base, $scope, $filter, $attributes, $category, $objectStorage);
+ return(filterBaseSelect::filterEntries($res));
+ }
+
+ static function filterEntries($res)
+ {
+ if(!session::is_set('filterBaseSelect_WhiteList')) return $res;
+ $list = session::get('filterBaseSelect_WhiteList');
+ foreach($res as $key => $entry){
+ if(!isset($list[$entry['dn']])) unset($res[$key]);
+ }
+ return(array_values($res));
+ }
+}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>