From 2072164c836c4825c3c879ee7f60feed100c0d1b Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 8 Jan 2007 10:45:10 +0000 Subject: [PATCH] Added configuration flag flag. include_personal_title="true/false" This flag specifies if we add the personalTitle attribute to the users dn git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5478 594d385d-05f5-0310-b6e9-bd551577e9d8 --- FAQ | 8 ++++++++ contrib/gosa.conf | 1 + plugins/admin/users/tabs_user.inc | 11 +++++++---- plugins/personal/generic/class_user.inc | 10 ++++++---- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/FAQ b/FAQ index 697f75363..89cdfd27a 100644 --- a/FAQ +++ b/FAQ @@ -345,3 +345,11 @@ Q: New implementations of OpenLDAP seem to require {sasl} instead of {kerberos} A: You can set "krbsasl" to "true" in your gosa.conf's main section. + +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 e7ac47267..75f3d725d 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -261,6 +261,7 @@ hash="{CRYPT}" dnmode="{DNMODE}" server="{LDAPHOST}" + include_personal_title="false" 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 b8cb962bf..9466dfb52 100644 --- a/plugins/admin/users/tabs_user.inc +++ b/plugins/admin/users/tabs_user.inc @@ -84,10 +84,13 @@ 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." "; + + /* 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'){ diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 1b14539b8..c24f100f0 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -998,11 +998,13 @@ class user extends plugin $message= plugin::check(); /* Assemble cn */ - if ($this->personalTitle == ""){ - $pt= ""; - } else { - $pt= $this->personalTitle." "; + $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? */ -- 2.30.2