From 599213321dc69ae86f2951df82d6d0c93e8cfc9d Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 11 May 2010 09:10:57 +0000 Subject: [PATCH] Updated accountRDN property handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18349 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_configRegistry.inc | 5 +++++ .../plugins/personal/generic/class_user.inc | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc index 033782e54..d9fcfde61 100644 --- a/gosa-core/include/class_configRegistry.inc +++ b/gosa-core/include/class_configRegistry.inc @@ -247,6 +247,11 @@ class gosaProperty return(in_array($value,array('true','false',''))); } + static function isString($message,$class,$name,$value, $type) + { + return(TRUE); + } + static function isInteger($message,$class,$name,$value, $type) { return(is_numeric($value) && !preg_match("/[^0-9]/", $value)); diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc index 90fc8ce10..b81be284c 100644 --- a/gosa-core/plugins/personal/generic/class_user.inc +++ b/gosa-core/plugins/personal/generic/class_user.inc @@ -1241,7 +1241,7 @@ class user extends plugin function update_new_dn() { // Alternative way to handle DN - $pattern= $this->config->get_cfg_value("core","accountRDN"); + $pattern= $this->config->get_cfg_value("user","accountRDN"); if ($pattern != "") { $rdn= $this->create_initial_rdn($pattern); $attribute= preg_replace('/=.*$/', '', $rdn); @@ -1687,6 +1687,22 @@ class user extends plugin "plCategory" => array("users" => array("description" => _("Users"), "objectClass" => "gosaAccount")), + + "plProperties" => array( + array( + "name" => "accountRDN", + "type" => "string", + "default" => "", + "description" => sprintf( + _("The 'accountRDN' option tells GOsa to use a placeholder pattern for generating account RDNs. A pattern can include attribute names prefaced by a % and normal text: %s. This will generate a RDN consisting of cn=.... filled with surname and given name of the edited account. This option disables the use of accountPrimaryAttribute and personalTitleInDn."), + "accountRDN=\"cn=%sn %givenName\""), + "check" => "gosaProperty::isString", + "migrate" => "", + "group" => "plugin", + "mandatory" => FALSE + ) + + ), "plProvidedAcls" => array( "sn" => _("Surname"), -- 2.30.2