Code

Include personal title in cn/dn
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Nov 2006 10:30:42 +0000 (10:30 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Nov 2006 10:30:42 +0000 (10:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5226 594d385d-05f5-0310-b6e9-bd551577e9d8

Changelog
plugins/admin/users/tabs_user.inc
plugins/personal/generic/class_user.inc

index 171baf41134874a5a67ae8bf3bb3df3e1ef01e57..88712e935a9a6c1e2789d51e59118fb05098719c 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -2,7 +2,7 @@ GOsa2 changelog
 ===============
 
 * gosa 2.5.7
-  -
+  - Include personal title in DN
 
 * gosa 2.5.6
   - Copy & paste implemented into FAI
index c37ce5cba052fd2d927210113a7697ba80abcdaa..6822ab713c1d4c68fde29754ccc2f3e945594e17 100644 (file)
@@ -84,8 +84,14 @@ class usertabs extends tabs
     /* Check for new 'dn', in order to propagate the
        'dn' to all plugins */
     $baseobject= $this->by_object['user'];
+    if ($baseobject->personalTitle == ""){
+      $pt= "";
+    } else {
+      $pt= $baseobject->personalTitle." ";
+    }
+
     if ($this->dn == 'new'){
-      $baseobject->cn= $baseobject->givenName." ".$baseobject->sn;
+      $baseobject->cn= $tp.$baseobject->givenName." ".$baseobject->sn;
       $this->by_object['user']= $baseobject;
       if (isset($this->config->current['DNMODE']) && $this->config->current['DNMODE'] == "uid"){
         $this->dn= 'uid='.$baseobject->uid.','.get_people_ou().$baseobject->base;
@@ -99,7 +105,7 @@ class usertabs extends tabs
       if (isset($this->config->current['DNMODE']) && $this->config->current['DNMODE'] == "uid"){
         $new_dn= 'uid='.$baseobject->uid.','.get_people_ou().$baseobject->base;
       } else {
-        $new_dn= "cn=".$baseobject->givenName." ".$baseobject->sn.','.
+        $new_dn= "cn=".$pt.$baseobject->givenName." ".$baseobject->sn.','.
           get_people_ou().$baseobject->base;
       }
       
@@ -119,7 +125,7 @@ class usertabs extends tabs
       if ($this->dn != $new_dn){
 
         /* Write entry on new 'dn' */
-        $baseobject->cn= $baseobject->givenName." ".$baseobject->sn;
+        $baseobject->cn= $pt.$baseobject->givenName." ".$baseobject->sn;
         $baseobject->move($this->dn, $new_dn);
         $this->by_object['user']= $baseobject;
 
index 93fd5f77d10709fbf7e0e098b5d6aeb542e9f0b7..46ecbc77d434db966131cb7fe6910dbc588d2228 100644 (file)
@@ -993,7 +993,12 @@ class user extends plugin
     $message= plugin::check();
 
     /* Assemble cn */
-    $this->cn= $this->givenName." ".$this->sn;
+    if ($this->personalTitle == ""){
+      $pt= "";
+    } else {
+      $pt= $this->personalTitle." ";
+    }
+    $this->cn= $pt.$this->givenName." ".$this->sn;
 
     /* Permissions for that base? */
     if (isset($this->config->current['DNMODE']) && $this->config->current['DNMODE'] == "uid"){