summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be0e522)
raw | patch | inline | side by side (parent: be0e522)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 23 Jun 2006 14:54:18 +0000 (14:54 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 23 Jun 2006 14:54:18 +0000 (14:54 +0000) |
use departments without commata inside.
Please use smaller commits. I can't follow this ones which
exchange hundreds of lines.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3874 594d385d-05f5-0310-b6e9-bd551577e9d8
Please use smaller commits. I can't follow this ones which
exchange hundreds of lines.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3874 594d385d-05f5-0310-b6e9-bd551577e9d8
index 006631879985df05849eb920db8de34b735f8c13..23fa324cabd8b83b8e481602d16f12d0a4877965 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
/* Adapt naming attribute */
$dst_name= preg_replace("/^([^=]+)=.*$/", "\\1", $dst_dn);
$dst_val = preg_replace("/^[^=]+=([^,+]+).*,.*$/", "\\1", $dst_dn);
- $new[$dst_name]= str_replace("\\","", ldap::fix($dst_val));
+ $new[$dst_name]= $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']);
+ }
/* Save copy */
$ldap->connect();
$ldap->cd($this->config->current['BASE']);
+
$ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $dst_dn));
/* FAIvariable=.../..., cn=..
}
$ldap->cd($dst_dn);
$ldap->add($new);
-
+
if ($ldap->error != "Success"){
trigger_error("Trying to save $dst_dn failed.",
E_USER_WARNING);
diff --git a/include/class_tabs.inc b/include/class_tabs.inc
index 6a9959e1ac9198736ab9ec1739c2e51beefb278b..e0e8dbe422b0bf555c7fe25940a04bdf3b5aa0bf 100644 (file)
--- a/include/class_tabs.inc
+++ b/include/class_tabs.inc
} else {
$obj->remove_from_parent();
}
- $this->by_object[$key]= $obj;
}
return (0);
}
diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc
index 8a2528b275edbe523cfd858d1a697e5281c9286d..c508b614e36e58bf38aaf886ef284381c48e5d72 100644 (file)
var $MustBeMoved = "";
var $MoveDestination = "";
var $MoveSource = "";
+ var $MoveOu = "";
/* attribute list for save action */
var $attributes = array("ou", "description", "businessCategory", "st",
/* Save to LDAP */
- function save($skipSave = false)
+ function save()
{
$ldap= $this->config->get_ldap_link();
$this->gosaUnitTag= "";
}
- if(!$skipSave){
- plugin::save();
- }
+ plugin::save();
/* Remove tag information if needed */
if (!$this->is_administrational_unit){
}
}
- if(!$skipSave){
- /* Write back to ldap */
- $ldap= $this->config->get_ldap_link();
- $ldap->cat($this->dn, array('dn'));
- $a= $ldap->fetch();
- $ldap->cd($this->dn);
-
- if (count($a)){
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- $this->handle_post_events('modify');
- } else {
- $ldap->add($this->attrs);
- $this->handle_post_events('add');
- }
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cat($this->dn, array('dn'));
+ $a= $ldap->fetch();
+ $ldap->cd($this->dn);
+
+ if (count($a)){
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ $this->handle_post_events('modify');
+ } else {
+ $ldap->add($this->attrs);
+ $this->handle_post_events('add');
+ }
+
+ show_ldap_error($ldap->get_error(), _("Saving department failed"));
- show_ldap_error($ldap->get_error(), _("Saving department failed"));
- }
/* The parameter forces only to set must_be_tagged, and don't touch any objects
This will be done later */
$this->tag_objects(true);
diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc
index 5185e3e7b9b4b0018f9dcaf249c265fc224f665e..dbfcab0b4ad7a6797c2b7799ede3d4ab4b4a02e4 100644 (file)
/* Save current changes */
if(!$this->AfterSaveProcedure){
- $this->deptabs->save();
+ $this->deptabs->save(true);
}
/* Check if we have to tag this department */
diff --git a/plugins/admin/departments/tabs_department.inc b/plugins/admin/departments/tabs_department.inc
index b966f7e9d30e083597c259f8f6ab827024d236ff..deccb02c48f732e3ffea8468f18590d76b0d116e 100644 (file)
$this->by_object['department']->MustBeMoved = true;
$this->by_object['department']->MoveDestination = $new_dn;
$this->by_object['department']->MoveSource = $this->dn;
+ $this->by_object['department']->MoveOu = $ou;
+ $this->dn = $this->dn;
+ $baseobject->dn = $this->dn;
$this->by_object['department']->ou = $baseobject->attrs['ou'][0];
- $ret = tabs::save(TRUE);
- $this->by_object['department']->save(true);
- return($ret);
+ $this->by_object['department'] = $baseobject;
+ return(tabs::save(TRUE));
}
}else{
- $this->dn = $new_dn;
- $baseobject->dn = $this->dn;
- $ret = tabs::save(TRUE);
- $baseobject->save(true);
+ $this->dn= $new_dn;
+ $baseobject->dn= $this->dn;
$this->by_object['department']= $baseobject;
- return($ret);
+ return(tabs::save(TRUE));
}
}
}