Fix: Try a fix to allow trigger for changing password

This commit is contained in:
Laurent Destailleur 2011-11-02 18:05:01 +01:00
parent 98ce8210ee
commit 2c4618d2f6
2 changed files with 6 additions and 2 deletions

View File

@ -1221,6 +1221,8 @@ class User extends CommonObject
// Mise a jour // Mise a jour
if (! $changelater) if (! $changelater)
{ {
if (! is_object($this->oldcopy)) $this->oldcopy=dol_clone($this);
$sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql = "UPDATE ".MAIN_DB_PREFIX."user";
$sql.= " SET pass_crypted = '".$this->db->escape($password_crypted)."',"; $sql.= " SET pass_crypted = '".$this->db->escape($password_crypted)."',";
$sql.= " pass_temp = null"; $sql.= " pass_temp = null";

View File

@ -362,6 +362,8 @@ if ($action == 'update' && ! $_POST["cancel"])
$edituser = new User($db); $edituser = new User($db);
$edituser->fetch($_GET["id"]); $edituser->fetch($_GET["id"]);
$edituser->oldcopy=dol_clone($edituser);
$ret=$edituser->setPassword($user,$_POST["password"]); $ret=$edituser->setPassword($user,$_POST["password"]);
if ($ret < 0) if ($ret < 0)
{ {