From 69b429914f40a63397604168bbfd59adac02d5e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Apr 2012 19:03:14 +0200 Subject: [PATCH] Fix: Firstname/Lastname lost Conflicts: htdocs/admin/tools/update.php --- htdocs/adherents/fiche.php | 4 ++-- htdocs/admin/tools/update.php | 4 +--- htdocs/user/class/user.class.php | 16 +++++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index c7d2c2b162d..cd15b82eb42 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -160,7 +160,7 @@ if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->rights->user { // Creation user $nuser = new User($db); - $result=$nuser->create_from_member($object,GETPOST('login','alpha')); + $result=$nuser->create_from_member($object,GETPOST('login')); if ($result < 0) { @@ -181,7 +181,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights { // Creation user $company = new Societe($db); - $result=$company->create_from_member($object,GETPOST('companyname','alpha')); + $result=$company->create_from_member($object,GETPOST('companyname')); if ($result < 0) { diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 7e56a51f426..14167134209 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -33,9 +33,7 @@ if ($_GET["msg"]) $message='
'.$_GET["msg"].'
'; $urldolibarr='http://www.dolibarr.org/downloads/'; -//$urldolibarrmodules='http://www.dolibarr.org/downloads/cat_view/65-modulesaddon'; $urldolibarrmodules='http://www.dolistore.com/'; -//$urldolibarrthemes='http://www.dolibarr.org/'; $urldolibarrthemes='http://www.dolistore.com/'; $dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT); $dolibarrroot=preg_replace('/([^\\/]+)$/i','',$dolibarrroot); @@ -141,4 +139,4 @@ print $langs->trans("SetupIsReadyForUse").'
'; print ''; llxFooter(); -?> \ No newline at end of file +?> diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index bc367203775..e34e750d9d6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -938,12 +938,12 @@ class User extends CommonObject // Positionne parametres $this->admin = 0; - $this->nom = $member->nom; - $this->prenom = $member->prenom; + $this->lastname = $member->lastname; + $this->firstname = $member->firstname; $this->email = $member->email; $this->pass = $member->pass; - if (empty($login)) $login=strtolower(substr($member->prenom, 0, 4)) . strtolower(substr($member->nom, 0, 4)); + if (empty($login)) $login=strtolower(substr($member->firstname, 0, 4)) . strtolower(substr($member->lastname, 0, 4)); $this->login = $login; $this->db->begin(); @@ -1047,8 +1047,8 @@ class User extends CommonObject dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); // Clean parameters - $this->nom = trim($this->nom); // TODO deprecated - $this->prenom = trim($this->prenom); // TODO deprecated + $this->nom = trim($this->nom); // deprecated + $this->prenom = trim($this->prenom); // deprecated $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); $this->login = trim($this->login); @@ -1142,8 +1142,10 @@ class User extends CommonObject if ($result >= 0) { - $adh->prenom=$this->firstname; - $adh->nom=$this->lastname; + $adh->prenom=$this->firstname; // deprecated + $adh->nom=$this->lastname; // deprecated + $adh->firstname=$this->firstname; + $adh->lastname=$this->lastname; $adh->login=$this->login; $adh->pass=$this->pass; $adh->societe=(empty($adh->societe) && $this->societe_id ? $this->societe_id : $adh->societe);