summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82913e5)
raw | patch | inline | side by side (parent: 82913e5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 15 Mar 2010 16:44:05 +0000 (16:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 15 Mar 2010 16:44:05 +0000 (16:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16541 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/systems/admin/systems/class_filterOPSIHOSTS.inc | patch | blob | history | |
gosa-plugins/systems/admin/systems/system-filter.xml | patch | blob | history |
diff --git a/gosa-plugins/systems/admin/systems/class_filterOPSIHOSTS.inc b/gosa-plugins/systems/admin/systems/class_filterOPSIHOSTS.inc
index 767fe0cfd63bdd04c49b229751b7abaaa343424b..d8e47a892dae0ae10d6a1330e7fe1380e3c15a78 100644 (file)
// Append opsi stuff ...
global $config;
$ui = get_userinfo();
+ $entries = array();
- echo $filter;
- if(preg_match("/NETBOOT/", $filter) &&
- class_available('opsi') &&
- $base == $config->current['BASE']){
+
- // Get filter regex ...
- $regex = "";
- if(preg_match("/\(cn=[^\)\$]*\)/", $filter)){
- $regex = trim(preg_replace("/^.*\(cn=([^\)\$]*)\).*$/","\\1", $filter),"* ");
- }
+ if(class_available('opsi') && $base == $config->current['BASE']){
+ $attr = $value = "";
+ if(preg_match("/=/", $filter)) {
+ list($fAttr,$fValue) = preg_split("/=/", $filter);
+ }
+
// Check ACLs and opsi handle
$opsi_acl = $ui->get_permissions($base,"opsi/opsiProperties");
$opsi = new opsi($config);
msg_dialog::display(_("Error"),msgPool::siError($opsi->get_error()),ERROR_DIALOG);
}else{
foreach($opsi_clients as $entry){
- if(empty($regex) || preg_match('/'.preg_quote($regex,'/').'/i',$entry['cn'][0])){
+
+ if(empty($fAttr) || preg_match("/{$fValue}/i",$entry[$fAttr][0])){
$entry['objectClass'] = array("FAKE_OC_OpsiHost");
$item = array('count' => count($entry));
foreach($entry as $name => $value){
diff --git a/gosa-plugins/systems/admin/systems/system-filter.xml b/gosa-plugins/systems/admin/systems/system-filter.xml
index 380c57ab9ec4e38b089e40877d333d80b3b43242..1f24590bccd6b25aedcb2e35ce8fcb8fa0341e06 100644 (file)
</query>
<query>
<backend>OPSIHOSTS</backend>
- <filter>$</filter>
+ <filter>cn=$</filter>
</query>
<autocomplete>
<attribute>cn</attribute>