diff --git a/contrib/openldap/core-fd-conf.schema b/contrib/openldap/core-fd-conf.schema index d35e9e1f8a1eca088a2e02088ec8e4d3fcd6a0db..2b6939272dd8f7d5ae249d55f0d32cfdc463ea5c 100644 --- a/contrib/openldap/core-fd-conf.schema +++ b/contrib/openldap/core-fd-conf.schema @@ -392,6 +392,12 @@ attributetype ( 1.3.6.1.4.1.38414.8.18.6 NAME 'fdAclTabOnObjects' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) +attributetype ( 1.3.6.1.4.1.38414.8.18.7 NAME 'fdDepartmentCategories' + DESC 'FusionDirectory - available categories for departments' + EQUALITY caseExactIA5Match + SUBSTR caseExactIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + # Plugins attributetype ( 1.3.6.1.4.1.38414.8.19.1 NAME 'fdOGroupRDN' @@ -566,7 +572,7 @@ objectclass ( 1.3.6.1.4.1.38414.8.2.1 NAME 'fusionDirectoryConf' fdDisplayErrors $ fdLdapMaxQueryTime $ fdLdapStats $ fdDebugLevel $ fdEnableSnapshots $ fdSnapshotBase $ fdTabHook $ fdShells $ fdDisplayHookOutput $ - fdAclTabOnObjects $ + fdAclTabOnObjects $ fdDepartmentCategories $ fdRfc2307bis $ fdCopyPaste $ fdSnapshotURI $ fdSnapshotAdminDn $ fdSnapshotAdminPassword $ fdPersonalTitleInDN $ fdAccountRDN $ fdSslCaCertPath $ fdSslKeyPath $ fdSslCertPath $ diff --git a/plugins/admin/departments/class_department.inc b/plugins/admin/departments/class_department.inc index 52c64854c70e78a6b639688ae89846069e7360d3..a7d6d9fa3adb1ed3a9748f4e99091b87b54cda7f 100644 --- a/plugins/admin/departments/class_department.inc +++ b/plugins/admin/departments/class_department.inc @@ -73,7 +73,7 @@ class department extends simplePlugin _('Description'), sprintf(_('Short description of this %s'), $name), 'description', TRUE ), - new StringAttribute( + new SelectAttribute( _('Category'), sprintf(_('Category of this %s'), $name), 'businessCategory', FALSE ), @@ -141,6 +141,15 @@ class department extends simplePlugin parent::__construct($config, $dn, $object); + $categoriesList = $this->config->get_cfg_value('DepartmentCategories', array()); + + /* Insert current value to possibilities */ + $businessCategory = $this->attributesAccess['businessCategory']->getValue(); + if (($businessCategory != "") && !in_array($businessCategory, $categoriesList)) { + $categoriesList[] = $businessCategory; + } + $this->attributesAccess['businessCategory']->setChoices($categoriesList); + $this->attributesAccess[$this->getNamingAttr()]->setUnique(TRUE); } diff --git a/plugins/config/class_configInLdap.inc b/plugins/config/class_configInLdap.inc index e59cf87e8d5cb13b2004ca565587d920050c97ca..f46e1c8809aac472994355a0112efc411175ece4 100644 --- a/plugins/config/class_configInLdap.inc +++ b/plugins/config/class_configInLdap.inc @@ -444,6 +444,13 @@ class configInLdap extends simplePlugin _('For very specific ACL rights setting where you might need to give right on a single object.'), 'fdAclTabOnObjects' ), + new SetAttribute( + new StringAttribute ( + _('Available department categories'), _('Available categories in the departments dropdown'), + 'fdDepartmentCategories', FALSE + ), + array() + ), ) ), );