index 141765b4595685ec07351f17f0ee3596d8f7cd59..9fdb2b15de0f1c98dc14f1ceab8470efb0b317e9 100644 (file)
$ldap->cd ($this->dn);
$attrs_to_search = $this->subAttributes;
$attrs_to_search[] = "FAIstate";
- $ldap->search("(&(objectClass=FAIclass)(objectClass=".$this->subClass."))", array("dn"));
+ $ldap->search("(&(objectClass=FAIclass)(objectClass=".$this->subClass."))", $attrs_to_search);
while($object = $ldap->fetch()){
+
+ /* Skip objects, that are tagged as removed */
+ if(isset($object['FAIstate'][0])){
+ if(preg_match("/removed$/",$object['FAIstate'][0])){
+ continue;
+ }
+ }
+
/* Set status for save management */
$objects = array();
$objects['status'] = "FreshLoaded";
if(preg_match("/d/",$acl)){
$once = false;
- if(($this->SubObjects[$entry]['status'] == "edited")||($this->SubObjects[$entry]['status'] == "FreshLoaded")){
+ $status = $this->SubObjects[$entry]['status'];
+ if($status == "edited" || $status == "FreshLoaded"){
$this->SubObjects[$entry]['status']= "delete";
}else{
unset($this->SubObjects[$entry]);
foreach($this->getList(true) as $key => $name){
$dn= $this->acl_base_for_current_object($name['dn']);
- $acl = $this->ui->get_permissions($dn,"fai/faiScriptEntry") ;
+ $acl = $this->ui->get_permissions($dn,"fai/faiHookEntry") ;
$act = "";
+ /* Check if this object is freezed, in this case hide the delete icon */
if($this->FAIstate == "freeze"){
$act .= "<input type='image' src='images/edit.png' name='editscript_%s' title='"._("edit")."' alt='"._("edit")."'>";
}else{
}
}
- $s_acl = $this->ui->get_permissions($dn,"fai/faiScriptEntry","FAIscript") ;
+ /* Check if we are allowed to use the export button for this object */
+ $s_acl = $this->ui->get_permissions($dn,"fai/faiHookEntry","FAIscript") ;
if(($this->SubObjects[$key]['status'] == "new") || ($this->SubObjects[$key]['dn'] == "new") || !preg_match("/r/",$s_acl)){
$down = "";
}else{
</a>";
}
- $divlist->AddEntry(array( array("string"=>$name['name']),
- array("string"=>$down , "attach" => "style='width:20px;'"),
- array("string"=>str_replace("%s",base64_encode($key),$act),
- "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
+ /* Check if we are allowed to view the object */
+ $s_acl = $this->ui->get_permissions($dn,"fai/faiHookEntry","cn") ;
+ if(preg_match("/r/",$s_acl)){
+ $divlist->AddEntry(array( array("string"=>$name['name']),
+ array("string"=>$down , "attach" => "style='width:20px;'"),
+ array("string"=>str_replace("%s",base64_encode($key),$act),
+ "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
+ }
}
$smarty->assign("Entry_divlist",$divlist->DrawList());
/* Divlist creation complete
$tmp = $this->plInfo();
$c_dn = $this->acl_base_for_current_object($this->dn);
- $smarty->assign("sub_object_is_addable", preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiScriptEntry")) && $this->FAIstate!="freeze");
+ $smarty->assign("sub_object_is_addable", preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiHookEntry")) && $this->FAIstate!="freeze");
foreach($tmp['plProvidedAcls'] as $name => $translation){
$smarty->assign($name."ACL",$this->getacl($name));
}