From cf344ac4c2f9e507aa1a53e90b297ee990d6e080 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 30 Mar 2010 15:01:21 +0000 Subject: [PATCH] Updated class selection for fai profiles git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17407 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/fai/classSelect/class_classSelect.inc | 14 +++++++------- .../fai/classSelect/class_filterFAIClass.inc | 9 ++++++++- .../fai/classSelect/selectClass-filter.xml | 2 +- .../admin/fai/classSelect/selectClass-list.tpl | 17 +---------------- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/classSelect/class_classSelect.inc b/gosa-plugins/fai/admin/fai/classSelect/class_classSelect.inc index 3db10bc47..518193c76 100644 --- a/gosa-plugins/fai/admin/fai/classSelect/class_classSelect.inc +++ b/gosa-plugins/fai/admin/fai/classSelect/class_classSelect.inc @@ -52,19 +52,19 @@ class classSelect extends management static function filterProperties($row, $classes) { /* Create different picture for each object type */ - $objTypes['FAIhook'] = " "; - $objTypes['FAItemplate'] = " "; - $objTypes['FAIscript'] = " "; - $objTypes['FAIvariable'] = " "; - $objTypes['FAIpackageList'] = " "; - $objTypes['FAIpartitionTable'] = " "; + $objTypes['FAIhook'] = image('plugins/fai/images/fai_hook.png'); + $objTypes['FAItemplate'] = image('plugins/fai/images/fai_template.png'); + $objTypes['FAIscript'] = image('plugins/fai/images/fai_script.png'); + $objTypes['FAIvariable'] = image('plugins/fai/images/fai_variable.png'); + $objTypes['FAIpackageList'] = image('plugins/fai/images/fai_packages.png'); + $objTypes['FAIpartitionTable'] = image('plugins/fai/images/fai_partitionTable.png'); $str = ""; foreach($objTypes as $class => $img){ if(in_array($class, $classes)){ $str .= $img; }else{ - $str .= " "; + $str .= image('images/empty.png'); } } return($str); diff --git a/gosa-plugins/fai/admin/fai/classSelect/class_filterFAIClass.inc b/gosa-plugins/fai/admin/fai/classSelect/class_filterFAIClass.inc index 66c88a47c..2659b3f6f 100644 --- a/gosa-plugins/fai/admin/fai/classSelect/class_filterFAIClass.inc +++ b/gosa-plugins/fai/admin/fai/classSelect/class_filterFAIClass.inc @@ -33,7 +33,14 @@ class filterFAIClass { $attrs = $ldap->fetch(); /* Only use objects which have cn set */ - if(isset($attrs['cn'][0]) && preg_match("/".preg_quote($filter,'/')."/i", $attrs['cn'][0])){ + $name = preg_replace("/[\*\.]/","",$filter); + if(empty($name)){ + $regex = '.*'; + }else{ + $regex = preg_quote($name,'/'); + } + + if(isset($attrs['cn'][0]) && preg_match("/".$regex."/i", $attrs['cn'][0])){ foreach($categories as $cat => $acl){ if(in_array($cat,$attrs['objectClass'])){ $acl = $ui->get_permissions($attrs['dn'],"fai/".$acl); diff --git a/gosa-plugins/fai/admin/fai/classSelect/selectClass-filter.xml b/gosa-plugins/fai/admin/fai/classSelect/selectClass-filter.xml index 27d4ef7db..eba1954b4 100644 --- a/gosa-plugins/fai/admin/fai/classSelect/selectClass-filter.xml +++ b/gosa-plugins/fai/admin/fai/classSelect/selectClass-filter.xml @@ -21,7 +21,7 @@ FAIClass - (cn=$) + $ cn diff --git a/gosa-plugins/fai/admin/fai/classSelect/selectClass-list.tpl b/gosa-plugins/fai/admin/fai/classSelect/selectClass-list.tpl index a7576d1b3..db1c678e7 100644 --- a/gosa-plugins/fai/admin/fai/classSelect/selectClass-list.tpl +++ b/gosa-plugins/fai/admin/fai/classSelect/selectClass-list.tpl @@ -9,24 +9,9 @@ - - - - - @@ -44,4 +29,4 @@ - \ No newline at end of file + -- 2.30.2
- {$ROOT} - - {$BACK} - - {$HOME} - {$RELOAD} {t}Base{/t} - {$BASE} - - {$ACTIONS} - {$FILTER}