From 18057bd682416dc1b209fb1b119d2256c291915b Mon Sep 17 00:00:00 2001 From: cajus Date: Sun, 25 Jun 2006 09:21:46 +0000 Subject: [PATCH] * Made progress message have fixed dn's in output * Fixed copy/move for departments including commata git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3876 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_plugin.inc | 14 +++++++------- .../admin/departments/class_departmentGeneric.inc | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 23fa324ca..3e7725a5e 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -667,7 +667,7 @@ class plugin { /* Rename dn in possible object groups */ $ldap= $this->config->get_ldap_link(); - $ldap->search('(&(objectClass=gosaGroupOfNames)(member='.$src_dn.'))', + $ldap->search('(&(objectClass=gosaGroupOfNames)(member='.@LDAP::fix($src_dn).'))', array('cn')); while ($attrs= $ldap->fetch()){ $og= new ogroup($this->config, $ldap->getDN()); @@ -679,7 +679,7 @@ class plugin $ldap->cat($dst_dn); $attrs= $ldap->fetch(); if (count($attrs)){ - trigger_error("Trying to overwrite $dst_dn, which already exists.", + trigger_error("Trying to overwrite ".@LDAP::fix($dst_dn).", which already exists.", E_USER_WARNING); return (FALSE); } @@ -687,7 +687,7 @@ class plugin $ldap->cat($src_dn); $attrs= $ldap->fetch(); if (!count($attrs)){ - trigger_error("Trying to move $src_dn, which does not seem to exist.", + trigger_error("Trying to move ".@LDAP::fix($src_dn).", which does not seem to exist.", E_USER_WARNING); return (FALSE); } @@ -701,7 +701,7 @@ class plugin $r=ldap_bind($ds,$this->config->current['ADMIN'], $this->config->current['PASSWORD']); error_reporting (0); - $sr=ldap_read($ds, $ldap->fix($src_dn), "objectClass=*"); + $sr=ldap_read($ds, @LDAP::fix($src_dn), "objectClass=*"); /* Fill data from LDAP */ $new= array(); @@ -729,14 +729,14 @@ class plugin /* Adapt naming attribute */ $dst_name= preg_replace("/^([^=]+)=.*$/", "\\1", $dst_dn); $dst_val = preg_replace("/^[^=]+=([^,+]+).*,.*$/", "\\1", $dst_dn); - $new[$dst_name]= $dst_val; + $new[$dst_name]= @LDAP::fix($dst_val); /* Check if this is a department. * If it is a dep. && there is a , override in his ou * change \2C to , again, else this entry can't be saved ... */ - if((isset($new['ou'])) &&( preg_match("/\\\\2C/",$new['ou']))){ - $new['ou'] = preg_replace("/\\\\2C/",",",$new['ou']); + if((isset($new['ou'])) &&( preg_match("/\\,/",$new['ou']))){ + $new['ou'] = preg_replace("/\\\\,/",",",$new['ou']); } /* Save copy */ diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index ed1216cdf..17efca80a 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -440,7 +440,7 @@ class department extends plugin echo "".$smarty->fetch(get_template_path('headers.tpl')); echo ""; - echo "

".sprintf(_("Moving '%s' to '%s'"),"".$src_dn."","".$dst_dn."")."

"; + echo "

".sprintf(_("Moving '%s' to '%s'"),"".@LDAP::fix($src_dn)."","".@LDAP::fix($dst_dn)."")."

"; /* Check if the destination entry exists */ @@ -449,9 +449,9 @@ class department extends plugin /* Check if destination exists - abort */ $ldap->cat($dst_dn, array('dn')); if ($ldap->fetch()){ - trigger_error("Recursive_move $dst_dn already exists.", + trigger_error("Recursive_move ".@LDAP::fix($dst_dn)." already exists.", E_USER_WARNING); - echo sprintf("Recursive_move: '%s' already exists", $dst_dn)."
"; + echo sprintf("Recursive_move: '%s' already exists", @LDAP::fix($dst_dn))."
"; return (FALSE); } @@ -476,10 +476,10 @@ class department extends plugin $dst= preg_replace("/".str_replace("\\","\\\\",$src_dn)."$/", "$dst_dn", $object); $dst= str_replace($src_dn,$dst_dn,$object); - echo ""._("Object").": $src
"; + echo ""._("Object").": ".@LDAP::fix($src)."
"; if (!$this->copy($src, $dst)){ - echo "
".sprintf(_("FAILED to copy %s, aborting operation"),$src)."
"; + echo "
".sprintf(_("FAILED to copy %s, aborting operation"),@LDAP::fix($src))."
"; return (FALSE); } -- 2.30.2