From eb95badd465c90337498c036530cb09198743e7b Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 24 Mar 2006 11:54:30 +0000 Subject: [PATCH] Fixed FAI copy routine git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2905 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 07797798f..3809d8543 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -403,14 +403,14 @@ class LDAP{ if($is_first){ echo "

". - sprintf(_("Creating duplicate of %s in %s"),"
".$sourcedn."
","
".$destinationdn."
")."

"; + sprintf(_("Creating copy of %s"),"".$sourcedn."").""; }else{ if(preg_match("/^ou=/",$sourcedn)){ - echo "

"._("Processing")." : ".preg_replace("/,.*$/","",$destinationdn)."

"; + echo "

"._("Processing")." $destinationdn

"; }else{ $tmp = split(",",$sourcedn); - echo "Current object : "; + echo " "._("Object").": "; for($i = 0; $i < ($depth -1 ) ; $i ++) { echo preg_replace("/^.*=/","",$tmp[$i])." "; } @@ -422,7 +422,7 @@ class LDAP{ $deststr = substr($deststr,0,96)."..."; } - echo "".$deststr."
"; + echo $deststr."
"; } } @@ -449,7 +449,7 @@ class LDAP{ /* Error while fetching object / attribute abort*/ if((!$attr) || (count($attr)) ==0) { - echo "error while fetching source dn .."; + echo _("Error while fetching source dn - aborted!"); return; } @@ -462,7 +462,8 @@ class LDAP{ /* If is first entry, append FAIbranch to department entry */ if($is_first){ - $attr= $this->fetch($this->cat($destinationdn)); + $this->cat($destinationdn); + $attr= $this->fetch(); /* Filter unneeded informations */ foreach($attr as $key => $value){ @@ -484,14 +485,13 @@ class LDAP{ $this->modify($attr); } }else{ - /* If this is no department */ - foreach($attr as $key => $value){ - if(in_array($key ,array("FAItemplateFile","FAIscript"))){ - $sr= ldap_read($this->cid, $this->fix($sourcedn), "(objectClass=FAIclass)", array($key)); + /* If this is no department */ + foreach($attr as $key => $value){ + if(in_array($key ,array("FAItemplateFile","FAIscript", "gotoLogonScript", "gosaApplicationIcon"))){ + $sr= ldap_read($this->cid, $this->fix($sourcedn), "$key=*", array($key)); $ei= ldap_first_entry($this->cid, $sr); - $tmp = (@ldap_get_values_len($this->cid, $ei,$key)); - if(is_array($tmp)){ + if ($tmp= @ldap_get_values_len($this->cid, $ei,$key)){ $attr[$key] = $tmp; } } @@ -518,7 +518,8 @@ class LDAP{ /* Add entry */ $this->cd($destinationdn); - $a = $this->fetch($this->cat($destinationdn)); + $this->cat($destinationdn); + $a = $this->fetch(); if(!count($a)){ $this->add($attr); } -- 2.30.2