Code

Added perosnalTitle flag. To be able to insert personalTitle into cn.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Jan 2007 11:48:32 +0000 (11:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Jan 2007 11:48:32 +0000 (11:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5583 594d385d-05f5-0310-b6e9-bd551577e9d8

FAQ
contrib/gosa.conf
plugins/admin/users/tabs_user.inc
plugins/personal/generic/class_user.inc

diff --git a/FAQ b/FAQ
index b797424d3bcd2cf7114dc5763a50047c21181fc6..37138071f7e4121c0c89ee79ae68bbad124b8ff6 100644 (file)
--- a/FAQ
+++ b/FAQ
@@ -354,3 +354,12 @@ Q: Is there a way to let GOsa automatically fill missing fields in the network
 A: Sure. You can specify the "autoconf" option and provide the contributed
    script "net-resolver.sh" in your gosa.conf. If this is configured, you're
    getting an additional button in each network dialog.
+
+
+Q: Is there a way to add the personalTitle attribute the the users dn?
+
+A: Just add this line into the location section of your gosa.conf.
+   <location name=...
+       include_personal_title="true"
+   ...>
+
index f5184648252bba3c84995747028f1ddf3459048e..ec5b8e238192933f68bd139a283aadc1019ce90d 100644 (file)
                        hash="{CRYPT}"
                        dnmode="{DNMODE}"
                        server="{LDAPHOST}"
+                       include_personal_title="false"
                        enable_snapshot="false"
                        snapshot_base="ou=snapshots,{LDAPBASE}"
                        config="ou=gosa,ou=configs,ou=systems,{LDAPBASE}">
index aa0f792211713cb51afebc0648182983af5467ff..e5f4c3a816202cade24ce41cbb0312b43f3d551c 100644 (file)
@@ -89,8 +89,17 @@ class usertabs extends tabs
     /* Check for new 'dn', in order to propagate the
        'dn' to all plugins */
     $baseobject= $this->by_object['user'];
+
+    /* Assemble cn */
+    $pt= "";
+    if(isset($this->config->current['INCLUDE_PERSONAL_TITLE']) && preg_match("/true/i",$this->config->current['INCLUDE_PERSONAL_TITLE'])){
+      if(!empty($baseobject->personalTitle)){
+        $pt = $baseobject->personalTitle." ";
+      }
+    }
+    
     if ($this->dn == 'new'){
-      $baseobject->cn= $baseobject->givenName." ".$baseobject->sn;
+      $baseobject->cn= $pt.$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;
@@ -104,7 +113,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;
       }
       
@@ -124,7 +133,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 971bec20953d3c26495cee3d705d2b5634afc4b8..cdea64d379cc08d6c6479b0ab6daa8729d20da97 100644 (file)
@@ -1042,8 +1042,13 @@ class user extends plugin
     /* Call common method to give check the hook */
     $message= plugin::check();
 
-    /* Assemble cn */
-    $this->cn= $this->givenName." ".$this->sn;
+    $pt= "";
+    if(isset($this->config->current['INCLUDE_PERSONAL_TITLE']) && preg_match("/true/i",$this->config->current['INCLUDE_PERSONAL_TITLE'])){
+      if(!empty($this->personalTitle)){
+        $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"){