From: hickert Date: Wed, 17 Jan 2007 11:48:32 +0000 (+0000) Subject: Added perosnalTitle flag. To be able to insert personalTitle into cn. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a35e4e5d4cd90fa149a86c4e4dee5ea030627347;p=gosa.git Added perosnalTitle flag. To be able to insert personalTitle into cn. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5583 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/FAQ b/FAQ index b797424d3..37138071f 100644 --- 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. + + diff --git a/contrib/gosa.conf b/contrib/gosa.conf index f51846482..ec5b8e238 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -265,6 +265,7 @@ 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}"> diff --git a/plugins/admin/users/tabs_user.inc b/plugins/admin/users/tabs_user.inc index aa0f79221..e5f4c3a81 100644 --- a/plugins/admin/users/tabs_user.inc +++ b/plugins/admin/users/tabs_user.inc @@ -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; diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 971bec209..cdea64d37 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -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"){