Fix: beware with merges in conflict !!

This commit is contained in:
Regis Houssin 2016-03-17 09:22:12 +01:00
parent 1ded08abef
commit d2d38f58bf
2 changed files with 202 additions and 224 deletions

View File

@ -3,7 +3,7 @@
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk> * Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com> * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
@ -375,20 +375,6 @@ if (empty($reshook)) {
$error ++; $error ++;
} }
if (!empty($conf->multicompany->enabled)) {
if (!empty($_POST["superadmin"])) {
$object->entity = 0;
} else {
if ($conf->multicompany->transverse_mode) {
$object->entity = 1; // all users in master entity
} else {
$object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]);
}
}
} else {
$object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]);
}
if (GETPOST('deletephoto')) { if (GETPOST('deletephoto')) {
$object->photo = ''; $object->photo = '';
} }
@ -412,7 +398,7 @@ if (empty($reshook)) {
} }
if (!$error && isset($_POST['contactid'])) { if (!$error && isset($_POST['contactid'])) {
$contactid = GETPOST('contactid'); $contactid = GETPOST('contactid', 'int');
if ($contactid > 0) { if ($contactid > 0) {
$contact = new Contact($db); $contact = new Contact($db);
@ -420,7 +406,7 @@ if (empty($reshook)) {
$sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql = "UPDATE ".MAIN_DB_PREFIX."user";
$sql .= " SET fk_socpeople=".$db->escape($contactid); $sql .= " SET fk_socpeople=".$db->escape($contactid);
if ($contact->socid) { if (!empty($contact->socid)) {
$sql .= ", fk_soc=".$db->escape($contact->socid); $sql .= ", fk_soc=".$db->escape($contact->socid);
} }
$sql .= " WHERE rowid=".$object->id; $sql .= " WHERE rowid=".$object->id;
@ -429,7 +415,7 @@ if (empty($reshook)) {
$sql .= " SET fk_socpeople=NULL, fk_soc=NULL"; $sql .= " SET fk_socpeople=NULL, fk_soc=NULL";
$sql .= " WHERE rowid=".$object->id; $sql .= " WHERE rowid=".$object->id;
} }
dol_syslog("fiche::update", LOG_DEBUG); dol_syslog("usercard::update", LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if (!$resql) { if (!$resql) {
$error ++; $error ++;
@ -502,14 +488,6 @@ if (empty($reshook)) {
} }
} }
} }
}
$object->oldcopy = clone $object;
$ret=$object->setPassword($user,$_POST["password"]);
if ($ret < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
} }
} }

View File

@ -4,7 +4,7 @@
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk> * Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com> * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
@ -1272,7 +1272,7 @@ class User extends CommonObject
$nbrowsaffected+=$this->db->affected_rows($resql); $nbrowsaffected+=$this->db->affected_rows($resql);
// Update password // Update password
if ($this->pass) if (!empty($this->pass))
{ {
if ($this->pass != $this->pass_indatabase && $this->pass != $this->pass_indatabase_crypted) if ($this->pass != $this->pass_indatabase && $this->pass != $this->pass_indatabase_crypted)
{ {