index c7da3badbe3eb6ad75544067c77ad6da94b52c6d..2c4a5649b1ee22ebe44782f8c7a6d40da5642d33 100644 (file)
if(isset($this->attrs['gosaUserDefinedFilter'])){
for($i=0; $i< $this->attrs['gosaUserDefinedFilter']['count']; $i++){
$tmp = userFilter::explodeFilterString($this->attrs['gosaUserDefinedFilter'][$i]);
if(isset($this->attrs['gosaUserDefinedFilter'])){
for($i=0; $i< $this->attrs['gosaUserDefinedFilter']['count']; $i++){
$tmp = userFilter::explodeFilterString($this->attrs['gosaUserDefinedFilter'][$i]);
- if(isset($tmp['name'])){
- $this->filters[$tmp['name']]= $tmp;
+ if(isset($tmp['tag'])){
+ $this->filters[$tmp['tag']]= $tmp;
}
}
}
}
}
}
// Get filters and their backends
$queries = array();
foreach(split(",", $filterList) as $data){
// Get filters and their backends
$queries = array();
foreach(split(",", $filterList) as $data){
- list($filter, $backend) = preg_split('/:/', $data);
- $queries[] = array('backend' => $backend, 'filter' => base64_decode($filter));
+ if(!empty($data)){
+ list($filter, $backend) = preg_split('/:/', $data);
+ $queries[] = array('backend' => $backend, 'filter' => base64_decode($filter));
+ }
}
// build up filter entry.
$tmp = array(
'parent' => $parent,
}
// build up filter entry.
$tmp = array(
'parent' => $parent,
- 'name' => $name,
+ 'tag' => $name,
'categories' => $categories,
'description' => base64_decode($description),
'categories' => $categories,
'description' => base64_decode($description),
- 'queries' => $queries,
+ 'query' => $queries,
'flags' => $flags);
return($tmp);
'flags' => $flags);
return($tmp);
$data[$name] = array('data' =>
array(
$filter['parent'],
$data[$name] = array('data' =>
array(
$filter['parent'],
- $filter['name'],
- $filter['description'],
+ $filter['tag'],
+ htmlentities($filter['description'], ENT_COMPAT, 'UTF-8'),
implode(", ",$filter['categories']),
implode(", ",$filter['flags'])));
}
implode(", ",$filter['categories']),
implode(", ",$filter['flags'])));
}
while($attrs = $ldap->fetch()){
for($i=0; $i < $attrs['gosaUserDefinedFilter']['count']; $i++){
$tmp = userFilter::explodeFilterString($attrs['gosaUserDefinedFilter'][$i]);
while($attrs = $ldap->fetch()){
for($i=0; $i < $attrs['gosaUserDefinedFilter']['count']; $i++){
$tmp = userFilter::explodeFilterString($attrs['gosaUserDefinedFilter'][$i]);
- if(!isset($tmp['name'])) continue;
+ if(!isset($tmp['tag'])) continue;
// Remove line breaks from the filter, which may were added for better reading.
// Remove line breaks from the filter, which may were added for better reading.
- foreach($tmp['queries'] as $key => $query){
+ foreach($tmp['query'] as $key => $query){
$c = preg_split('/\n/',$query['filter']);
foreach($c as $cKey => $str) $c[$cKey] = trim($str);
$c = preg_split('/\n/',$query['filter']);
foreach($c as $cKey => $str) $c[$cKey] = trim($str);
- $tmp['queries'][$key]['filter'] = mb_convert_encoding(implode($c),'UTF-8');
+ $tmp['query'][$key]['filter'] = mb_convert_encoding(implode($c),'UTF-8');
}
// The filter is visible if it is shared or if is one of our own creations.
}
// The filter is visible if it is shared or if is one of our own creations.
// Add filter if it matches the category list
if($visible && (count($category) == 0 || array_intersect($category, $tmp['categories']))){
// Add filter if it matches the category list
if($visible && (count($category) == 0 || array_intersect($category, $tmp['categories']))){
- $filter[$tmp['name']] = $tmp;
+ $filter[$tmp['tag']] = $tmp;
}
}
}
}
}
}
foreach($this->filters as $filter){
$tmp = $filter['parent'].";";
$tmp.= implode(',', $filter['categories']).";";
foreach($this->filters as $filter){
$tmp = $filter['parent'].";";
$tmp.= implode(',', $filter['categories']).";";
- $tmp.= $filter['name'].";";
+ $tmp.= $filter['tag'].";";
$tmp.= base64_encode($filter['description']).";";
// Add queries
$tmp.= base64_encode($filter['description']).";";
// Add queries
- foreach($filter['queries'] as $query){
+ foreach($filter['query'] as $query){
$tmp.= base64_encode($query['filter']).":".$query['backend'].",";
}
$tmp = trim($tmp,",").";";
$tmp.= base64_encode($query['filter']).":".$query['backend'].",";
}
$tmp = trim($tmp,",").";";