X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-plugins%2Ffai%2Fadmin%2Ffai%2Fclass_faiProfileEntry.inc;h=652b36052540a3590076686481e3a7fa2372c9d1;hb=ff3ef83f8dcb54659807a39f8513486b5c0badb0;hp=fe8b7fd4f53449b2cad48adb50cb1621f88caf16;hpb=19de1e745f0112f89e3c380bf0458ad49852dfba;p=gosa.git diff --git a/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc b/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc index fe8b7fd4f..652b36052 100644 --- a/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc @@ -11,17 +11,11 @@ class faiProfileEntry extends plugin var $FAIAllclasses = array(); var $ui; - function faiProfileEntry (&$config, $dn= NULL,$used=array(),$objects=false) + function faiProfileEntry (&$config, $dn= NULL,$used=array(),$base) { plugin::plugin ($config, $dn); /* Search only in fai tree */ - $base = get_ou('faiou').session::get('CurrentMainBase'); - $faifilter = session::get('faifilter'); - if($faifilter['branch']!="main"){ - $base = $faifilter['branch']; - } - $this->ui = get_userinfo(); $filter = "(|(objectClass=FAIscript)(objectClass=FAItemplate)(objectClass=FAIhook)". @@ -35,7 +29,7 @@ class faiProfileEntry extends plugin "FAIhook" => "faiHook", "FAIvariable" => "faiVariable", "FAIpartitionTable" => "faiPartitionTable", - "FAIpackageList" => "faiPackageList"); + "FAIpackageList" => "faiPackage"); /* Read out all objects from fai tree */ $ldap= $this->config->get_ldap_link(); @@ -81,7 +75,7 @@ class faiProfileEntry extends plugin /* If no search filter is set, create one */ if (!session::is_set("SUBfaifilter")){ - $SUBfaifilter= array("base" => get_ou('faiou').session::get('CurrentMainBase'), "Sregex" => "*"); + $SUBfaifilter= array("base" => get_ou('faiBaseRDN').session::get('CurrentMainBase'), "Sregex" => "*"); $SUBfaifilter['SShowTemplates'] = true; $SUBfaifilter['SShowScripts'] = true; $SUBfaifilter['SShowHooks'] = true; @@ -94,8 +88,8 @@ class faiProfileEntry extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); /* Fill templating stuff */ $smarty = get_smarty(); @@ -103,6 +97,11 @@ class faiProfileEntry extends plugin $SUBfaifilter = session::get('SUBfaifilter'); + /* Get alphabet selection */ + if(isset($_GET['search'])){ + $SUBfaifilter['Sregex'] = strtolower($_GET['search'])."*"; + } + /* If someone used the apply button, update searchfilter */ if(isset($_POST['Sregex'])){ foreach($SUBfaifilter as $key => $val){ @@ -136,12 +135,12 @@ class faiProfileEntry extends plugin } /* Create different picture for each object type */ - $objTypes['FAIhook'] = " "; - $objTypes['FAItemplate'] = " "; - $objTypes['FAIscript'] = " "; - $objTypes['FAIvariable'] = " "; - $objTypes['FAIpackageList'] = " "; - $objTypes['FAIpartitionTable'] = " "; + $objTypes['FAIhook'] = " "; + $objTypes['FAItemplate'] = " "; + $objTypes['FAIscript'] = " "; + $objTypes['FAIvariable'] = " "; + $objTypes['FAIpackageList'] = " "; + $objTypes['FAIpartitionTable'] = " "; /* Magic quotes GPC, escapes every ' " \, to solve some security risks * If we post the escaped strings they will be escaped again @@ -190,7 +189,7 @@ class faiProfileEntry extends plugin $fi = str_replace("*",".*",$SUBfaifilter['Sregex']); $abort = true; - if(!preg_match("/".$fi."/",$usedClass)){ + if(!preg_match("/^".$fi."/i",$usedClass)){ $abort = false; continue; } @@ -236,10 +235,10 @@ class faiProfileEntry extends plugin $smarty->assign("faihead" , ""); $smarty->assign("failist" , $divlist->DrawList()); $smarty->assign("infoimage" , get_template_path('images/info_small.png')); - $smarty->assign("launchimage" , get_template_path('images/small_filter.png')); + $smarty->assign("launchimage" , get_template_path('images/lists/action.png')); $smarty->assign("alphabet" , generate_alphabet()); $smarty->assign("apply" , apply_filter(TRUE)); - $smarty->assign("search_image" , get_template_path('images/search.png')); + $smarty->assign("search_image" , get_template_path('images/lists/search.png')); $display.= $smarty->fetch(get_template_path('faiProfileEntry.tpl', TRUE)); return($display);