summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6170df8)
raw | patch | inline | side by side (parent: 6170df8)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Nov 2008 11:47:39 +0000 (11:47 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Nov 2008 11:47:39 +0000 (11:47 +0000) |
-Keep the structural object class of the source object.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13041 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13041 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/admin/departments/class_countryGeneric.inc b/gosa-core/plugins/admin/departments/class_countryGeneric.inc
index 36790bff4b332790e84d20941526d3ae80281af2..1d51e6fe070315187b1ecd8208e9049839c3b4dd 100644 (file)
{
/* attribute list for save action */
var $attributes = array( "c", "ou", "description");
- var $objectclasses = array("top", "country", "gosaDepartment");
+ var $objectclasses = array("top", "gosaDepartment");
+ var $structuralOC = array("country");
var $type ="c";
var $c ="";
var $orgi_c ="";
diff --git a/gosa-core/plugins/admin/departments/class_dcObject.inc b/gosa-core/plugins/admin/departments/class_dcObject.inc
index 16de04c28bce22ffe8f4e1c726dabc319d7e5ea0..9c24f47376a41795ffe392394cbaf6e37bf25f86 100644 (file)
{
/* attribute list for save action */
var $attributes = array( "dc", "ou", "description");
- var $objectclasses = array("top", "dcObject", "gosaDepartment", "locality");
+ var $objectclasses = array("top", "dcObject", "gosaDepartment");
+ var $structuralOC = array("locality");
var $type = "dc";
var $dc = "";
var $orgi_dc = "";
diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc
index b7d98153095ecf137c496e768ad80d82ae59a3e9..105b479c6b4fecd5710b62bce6cc2920705c5a24 100644 (file)
/* attribute list for save action */
var $attributes= array("ou", "description", "businessCategory", "st", "l", "postalAddress",
"telephoneNumber", "facsimileTelephoneNumber", "gosaUnitTag");
- var $objectclasses= array("top", "gosaDepartment", "organizationalUnit");
- var $initially_was_tagged = false;
+ /* Do not append the structural object classes here, they are added dynamically in the constructor */
+ var $objectclasses= array("top", "gosaDepartment");
+ var $structuralOC = array("organizationalUnit");
+
+ var $initially_was_tagged = false;
var $orig_base = "";
var $orig_ou = "";
function department (&$config, $dn)
{
+ /* Add the default structural obejct class 'locality' if this is a new entry
+ */
+ $ldap = $config->get_ldap_link();
+ $ldap->cd($config->current['BASE']);
+ if($dn == "" || $dn == "new" || !$ldap->dn_exists($dn)){
+ $this->objectclasses = array_merge($this->structuralOC,$this->objectclasses);
+ }else{
+ echo $dn;
+ $ldap->cat($dn, array("structuralObjectClass"));
+ $attrs= $ldap->fetch();
+ if(isset($attrs['structuralObjectClass']['count'])){
+ for($i = 0 ; $i < $attrs['structuralObjectClass']['count'] ; $i++){
+ $this->objectclasses[] = $attrs['structuralObjectClass'][$i];
+ }
+ }else{
+
+ /* Could not detect structural object class for this object, fall back to the default 'locality'
+ */
+ $this->objectclasses = array_merge($this->structuralOC,$this->objectclasses);
+ }
+ }
+ $this->objectclasses = array_unique($this->objectclasses);
plugin::plugin($config, $dn);
$this->is_account= TRUE;
diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc
index 0637be02a0ef01bf45fb7634f148f776ed3dc0ff..a6118c39866d7910e23000106502e931450b339c 100644 (file)
$types['organization']['TITLE'] = _("Organization");
$types['organization']['TPL'] = "organization.tpl";
- /* Organization
+ /* Department
*/
$types['organizationalUnit']['ACL'] = "department";
$types['organizationalUnit']['CLASS'] = "department";
diff --git a/gosa-core/plugins/admin/departments/class_localityGeneric.inc b/gosa-core/plugins/admin/departments/class_localityGeneric.inc
index 3aecf1c19cd7b64cbbb903955870cb7cf65c3750..288902e9f0e1180fccd3250ae7cec409c67cd13e 100644 (file)
{
/* attribute list for save action */
var $attributes = array("l", "description", "ou");
- var $objectclasses = array("top", "locality", "gosaDepartment");
+ var $objectclasses = array("top", "gosaDepartment");
+ var $structuralOC = array("locality");
var $description= "";
var $type = "l";
diff --git a/gosa-core/plugins/admin/departments/class_organizationGeneric.inc b/gosa-core/plugins/admin/departments/class_organizationGeneric.inc
index 5a3e623ba943789b7e4442d3e5d7e3cedfca8c5d..3ed574c082cedd11e6e50784dde0905d2809bd47 100644 (file)
"postOfficeBox","postalCode", "postalAddress","physicalDeliveryOfficeName",
"st","l","teletexTerminalIdentifier");
- var $objectclasses = array("top", "organization", "gosaDepartment");
+ var $objectclasses = array("top", "gosaDepartment");
+ var $structuralOC = array("organization");
/* Attributes
*/