summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dd6315f)
raw | patch | inline | side by side (parent: dd6315f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 13 Jul 2006 06:00:14 +0000 (06:00 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 13 Jul 2006 06:00:14 +0000 (06:00 +0000) |
The tagging method was called twice.
-The first call was ok.
-But the second call failed.
Because we have checked the objectClasses for gosaAdministrativeUnitTag, and the objectClasses wasn't present in this->attrs anymore
because cleanup from last save() call removed all objectClasses and so, $this->gosaUnitTag was set to "" to generate a new one.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4134 594d385d-05f5-0310-b6e9-bd551577e9d8
-The first call was ok.
-But the second call failed.
Because we have checked the objectClasses for gosaAdministrativeUnitTag, and the objectClasses wasn't present in this->attrs anymore
because cleanup from last save() call removed all objectClasses and so, $this->gosaUnitTag was set to "" to generate a new one.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4134 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/departments/class_departmentGeneric.inc | patch | blob | history |
diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc
index 56476efcbf6138529ccc373e26cec58b12aee72d..525e9d2457fd5a2da41bc832b9675cfe72b052fc 100644 (file)
var $attributes= array("ou", "description", "businessCategory", "st", "l", "postalAddress",
"telephoneNumber", "facsimileTelephoneNumber", "gosaUnitTag");
var $objectclasses= array("top", "gosaDepartment", "organizationalUnit");
+ var $initially_was_tagged = false;
function department ($config, $dn)
{
/* Is administrational Unit? */
if ($dn != "new" && in_array_ics('gosaAdministrativeUnit', $this->attrs['objectClass'])){
$this->is_administrational_unit= true;
+ $this->initially_was_tagged = true;
}
}
/* Add tag objects if needed */
if ($this->is_administrational_unit){
- if(!in_array_ics("gosaAdministrativeUnit",$this->objectclasses)){
+
+ /* If this wasn't tagged before add oc an reset unit tag */
+ if(!$this->initially_was_tagged){
$this->objectclasses[]= "gosaAdministrativeUnit";
$this->gosaUnitTag= "";
+
+ /* It seams that this method is called twice,
+ set this to true. to avoid adding this oc twice */
+ $this->initially_was_tagged = true;
}
if ($this->gosaUnitTag == ""){
if(!$has_unit_tag && isset($this->attrs['gosaUnitTag'])){
$this->attrs['gosaUnitTag']= array();
}
+ $this->gosaUnitTag = "";
}
/* Write back to ldap */