Code

Updated accountRDN property handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 May 2010 09:10:57 +0000 (09:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 May 2010 09:10:57 +0000 (09:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18349 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_configRegistry.inc
gosa-core/plugins/personal/generic/class_user.inc

index 033782e54de53de60357527967bb706378e6bd2d..d9fcfde6178d04031c78545fbb91e5c7c2ddae39 100644 (file)
@@ -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));
index 90fc8ce100f9e217c03c08daaa481f42d058ec26..b81be284c3904b0ca47389be2da75143c6580ed7 100644 (file)
@@ -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"),