diff --git a/plugins/admin/fai/class_faiProfileEntry.inc b/plugins/admin/fai/class_faiProfileEntry.inc
index b38614e3b19389a00b23c6b0b10415c273c0a2c4..15df8d19078226cdc825c2de22fc650d6ddd6f16 100644 (file)
plugin::plugin ($config, $dn);
/* Search only in fai tree */
- $base = $_SESSION['faifilter']['base'];
+ $base = "ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
/* Create array with categories to be able to sort different types of objects */
$categories = array("FAIscript","FAItemplate","FAIhook","FAIvariable","FAIpartitionTable","FAIpackage");
$ldap->cd($base);
$ldap->search("(| (objectClass=FAIscript)(objectClass=FAItemplate)(objectClass=FAIhook)(objectClass=FAIvariable)
(objectClass=FAIpartitionTable)(objectClass=FAIpackage))",array("*"));
+
+ $sort=array();
while($attrs = $ldap->fetch()){
/* Only use objects which have cn set */
}
}
}
-
+ $tmp = array();
ksort($sort);
foreach($sort as $name){
$tmp[$name] =$this->FAIAllclasses[$name];
/* If no search filter is set, create one */
if (!is_global("SUBfaifilter")){
$SUBfaifilter= array("base" => "ou=fai,ou=configs,ou=systems,".$base, "Sregex" => "*");
- $SUBfaifilter['SShowTemplates'] = false;
- $SUBfaifilter['SShowScripts'] = false;
- $SUBfaifilter['SShowHooks'] = false;
- $SUBfaifilter['SShowVariables'] = false;
- $SUBfaifilter['SShowPackages'] = false;
- $SUBfaifilter['SShowPartitions']= false;
+ $SUBfaifilter['SShowTemplates'] = true;
+ $SUBfaifilter['SShowScripts'] = true;
+ $SUBfaifilter['SShowHooks'] = true;
+ $SUBfaifilter['SShowVariables'] = true;
+ $SUBfaifilter['SShowPackages'] = true;
+ $SUBfaifilter['SShowPartitions']= true;
register_global("SUBfaifilter", $SUBfaifilter);
}
}
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Fill templating stuff */
$smarty = get_smarty();
$display = "";
$objTypes['FAItemplate'] = "<image src='images/fai_template.png' title='"._("Template bundle")."' alt=''> ";
$objTypes['FAIscript'] = "<image src='images/fai_script.png' title='"._("Script bundle")."' alt=''> ";
$objTypes['FAIvariable'] = "<image src='images/fai_variable.png' title='"._("Variable bundle")."' alt=''> ";
- $objTypes['FAIpackages'] = "<image src='images/fai_packages.png' title='"._("Package bundle")."' alt=''> ";
+ $objTypes['FAIpackage'] = "<image src='images/fai_packages.png' title='"._("Package bundle")."' alt=''> ";
$objTypes['FAIpartitionTable'] = "<image src='images/fai_partitionTable.png' title='"._("Partition table")."' alt=''> ";
- /* assign basic attributes */
+ /* Magic quotes GPC, escapes every ' " \, to solve some security risks
+ * If we post the escaped strings they will be escaped again
+ */
foreach($this->attributes as $attrs){
- $smarty->assign($attrs,stripslashes($this->$attrs));
+ if(get_magic_quotes_gpc()){
+ $smarty->assign($attrs,stripslashes($this->$attrs));
+ }else{
+ $smarty->assign($attrs,($this->$attrs));
+ }
}
/* Assign all filter attributes to smarty */
/* Create a divlist to display all available class names with the depending object types */
$divlist = new divlist("ProfileEntry");
$divlist->SetSummary(_("This list displays all assigned class names for this profile."));
- $divlist->SetEntriesPerPage(20);
+ $divlist->SetEntriesPerPage(0);
$divlist->SetHeader(array(array("string"=>"Class name"),
- array("string"=>"Objects")));
+ array("string"=>"Objects","attach"=>"style='border-right:0px;'")));
/* Action button allows us to delete an entry */
$action = "<input type='hidden' name='ON_PAGE_%KEY%' value='1'>
$fi = str_replace("*",".*",$SUBfaifilter['Sregex']);
- $abort = false;
+ $abort = true;
if(!preg_match("/".$fi."/",$usedClass)){
- $abort = true;
+ $abort = false;
}
- if(($SUBfaifilter['SShowScripts'])&&(!in_array('FAIscript',$classes['objects']))){
- $abort = true;
+ if((isset($classes['objects']['FAIscript']))&&($SUBfaifilter['SShowScripts'])){
+ $abort = false;
}
- if(($SUBfaifilter['SShowTemplates'])&&(!in_array('FAItemplate',$classes['objects']))){
- $abort = true;
+ if((isset($classes['objects']['FAItemplate']))&&($SUBfaifilter['SShowTemplates'])){
+ $abort = false;
}
- if(($SUBfaifilter['SShowHooks'])&&(!in_array('FAIhook',$classes['objects']))){
- $abort = true;
+ if((isset($classes['objects']['FAIhook']))&&($SUBfaifilter['SShowHooks'])){
+ $abort = false;
}
- if(($SUBfaifilter['SShowVariables'])&&(!in_array('FAIvariable',$classes['objects']))){
- $abort = true;
+ if((isset($classes['objects']['FAIvariable']))&&($SUBfaifilter['SShowVariables'])){
+ $abort = false;
}
- if(($SUBfaifilter['SShowPartitions'])&&(!in_array('FAIpartitionTable',$classes['objects']))){
- $abort = true;
+ if((isset($classes['objects']['FAIpartitionTable']))&&($SUBfaifilter['SShowPartitions'])){
+ $abort = false;
}
- if(($SUBfaifilter['SShowPackages'])&&(!in_array('FAIpackages',$classes['objects']))){
- $abort = true;
+ if((isset($classes['objects']['FAIpackage']))&&($SUBfaifilter['SShowPackages'])){
+ $abort = false;
}
if(!$abort){
/* Append to list */
$field1 = array("string"=> preg_replace("/%KEY%/",$usedClass,$action_check).$usedClass,"attach"=>"");
- $field2 = array("string"=> $str,"attach"=>"");
+ $field2 = array("string"=> $str,"attach"=>"style='border-right:0px;'");
$divlist->AddEntry(array($field1,$field2));
}
}