From 76c89aed9bc5cafceecf9bd67537f48752e0b2a5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 28 Sep 2017 19:13:26 +0200 Subject: [PATCH] Fix: add lastname --- htdocs/adherents/class/adherent.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index e70ef9893bc..ceaf13335f3 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1956,9 +1956,12 @@ class Adherent extends CommonObject // Object classes $info["objectclass"]=explode(',',$conf->global->LDAP_MEMBER_OBJECT_CLASS); - $this->fullname=$this->getFullName($langs); - // For avoid ldap error when firstname and lastname is empty - if ($this->morphy == 'mor' && empty($this->fullname)) $this->fullname = $this->societe; + $this->fullname=$this->getFullName($langs); + // For avoid ldap error when firstname and lastname are empty + if ($this->morphy == 'mor' && empty($this->fullname)) { + $this->fullname = $this->societe; + $this->lastname = $this->societe; + } // Member if ($this->fullname && ! empty($conf->global->LDAP_MEMBER_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname;