diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc
index 17688c3f6470c8a86f624d26f6ce24c2f81d0242..40ece132514c32bb34b116f27ba164e1ca17b31b 100644 (file)
/* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
*/
- $res = FAI::get_all_objects_for_given_base($this->dn,"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))");
+ $res = FAI::get_all_objects_for_given_object($this->dn,"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))");
foreach($res as $obj){
-
- /* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
-
$objects = array();
+ $objects['description'] = "";
$objects['status'] = "FreshLoaded";
$objects['dn'] = $obj['dn'];
$objects = $this->get_object_attributes($objects,$this->subAttributes);
function acl_base_for_current_object($dn)
{
- if($dn == "new"){
+ if($dn == "new" || $dn == ""){
if($this->dn == "new"){
$dn = session::get('CurrentMainBase');
}else{
$c_dn = $this->acl_base_for_current_object($this->SubObjects[$var]['dn']);
$acl = $this->ui->get_permissions($c_dn,"fai/faiVariable");
if(preg_match("/d/",$acl)){
- if($this->SubObjects[$var]['status'] == "edited"){
+ if($this->SubObjects[$var]['status'] != "new"){
$this->SubObjects[$var]['status']= "delete";
}else{
unset($this->SubObjects[$var]);
}else{
$obj = $this->dialog->save();
if(isset($obj['remove'])){
- if($this->SubObjects[$obj['remove']['from']]['status']=="edited"){
+ if($this->SubObjects[$obj['remove']['from']]['status'] != "new"){
$this->SubObjects[$obj['remove']['from']]['status'] = "delete";
- }elseif($this->SubObjects[$obj['remove']['from']]['status']=="new"){
+ }else{
unset($this->SubObjects[$obj['remove']['from']]);
}
$obj['status'] = "new";
$this->SubObjects[$obj['remove']['to']] = $obj;
unset($this->SubObjects[$obj['remove']['to']]['remove']);
}else{
+ $obj['status'] = "edited";
$this->SubObjects[$obj['cn']]=$obj;
}
$this->is_dialog=false;
{
if((isset($_POST['FAIvariable_posted'])) && !preg_match("/freeze/", $this->FAIstate) ){
plugin::save_object();
- foreach($this->attributes as $attrs){
- if(isset($_POST[$attrs])){
- $this->$attrs = $_POST[$attrs];
- }
- }
}
}
*/
if($this->is_new){
$release = $this->parent->parent->fai_release;
- $new_dn= 'cn='.$this->cn.",".get_ou('faivariableou').get_ou('faiou').$release;
+ $new_dn= 'cn='.$this->cn.",".get_ou('faiVariableRDN').get_ou('faiBaseRDN').$release;
$res = faiManagement::check_class_name("FAIvariable",$this->cn,$new_dn);
if(isset($res[$this->cn])){
$message[] = msgPool::duplicated(_("Name"));
* Because we must delete old entries first.
* After deletion, we perform add and modify
*/
- $Objects = array();
- foreach($this->SubObjects as $name => $obj){
- if($obj['status'] == "delete"){
- $Objects[$name] = $obj;
- }
- }
- foreach($this->SubObjects as $name => $obj){
- if($obj['status'] != "delete"){
- $Objects[$name] = $obj;
- }
- }
-
+ $Objects = $this->SubObjects;
foreach($Objects as $name => $obj){
foreach($this->sub64coded as $codeIt){
$tmp = array();
foreach($this->subAttributes as $attrs){
- if(empty($obj[$attrs])){
+ if($obj[$attrs] == ""){
$obj[$attrs] = array();
}
$tmp[$attrs] = $obj[$attrs];
/* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
*/
- $res = FAI::get_all_objects_for_given_base($this->dn,"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))");
+ $res = FAI::get_all_objects_for_given_object($source['dn'],"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))");
foreach($res as $obj){
- /* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
-
$objects = array();
$objects['status'] = "edited";
$objects['dn'] = $obj['dn'];