summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 868bf91)
raw | patch | inline | side by side (parent: 868bf91)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 25 Jun 2006 09:21:46 +0000 (09:21 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 25 Jun 2006 09:21:46 +0000 (09:21 +0000) |
* Fixed copy/move for departments including commata
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3876 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3876 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_plugin.inc | patch | blob | history | |
plugins/admin/departments/class_departmentGeneric.inc | patch | blob | history |
index 23fa324cabd8b83b8e481602d16f12d0a4877965..3e7725a5eaf48ab38d58d7a7368964c23bfbeb0e 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
{
/* 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());
$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);
}
$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);
}
$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();
/* 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 ed1216cdf019388fbdbee7ffea12a2793fa8a2f5..17efca80a22263730935585e70e710f3ee97ada6 100644 (file)
echo "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
echo "<body style='background-image:none;margin:3px;color:black'>";
- echo "<h3>".sprintf(_("Moving '%s' to '%s'"),"<i>".$src_dn."</i>","<i>".$dst_dn."</i>")."</h3>";
+ echo "<h3>".sprintf(_("Moving '%s' to '%s'"),"<i>".@LDAP::fix($src_dn)."</i>","<i>".@LDAP::fix($dst_dn)."</i>")."</h3>";
/* Check if the destination entry exists */
/* 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)."<br>";
+ echo sprintf("Recursive_move: '%s' already exists", @LDAP::fix($dst_dn))."<br>";
return (FALSE);
}
$dst= preg_replace("/".str_replace("\\","\\\\",$src_dn)."$/", "$dst_dn", $object);
$dst= str_replace($src_dn,$dst_dn,$object);
- echo "<b>"._("Object").":</b> $src<br>";
+ echo "<b>"._("Object").":</b> ".@LDAP::fix($src)."<br>";
if (!$this->copy($src, $dst)){
- echo "<font color='#FF0000'><br>".sprintf(_("FAILED to copy %s, aborting operation"),$src)."</font>";
+ echo "<font color='#FF0000'><br>".sprintf(_("FAILED to copy %s, aborting operation"),@LDAP::fix($src))."</font>";
return (FALSE);
}