Fix: Try a fix to allow trigger for changing password
This commit is contained in:
parent
98ce8210ee
commit
2c4618d2f6
@ -1221,7 +1221,9 @@ class User extends CommonObject
|
|||||||
// Mise a jour
|
// Mise a jour
|
||||||
if (! $changelater)
|
if (! $changelater)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
if (! is_object($this->oldcopy)) $this->oldcopy=dol_clone($this);
|
||||||
|
|
||||||
|
$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";
|
||||||
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
||||||
@ -1239,7 +1241,7 @@ class User extends CommonObject
|
|||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
if ($this->db->affected_rows($result))
|
if ($this->db->affected_rows($result))
|
||||||
{
|
{
|
||||||
$this->pass=$password;
|
$this->pass=$password;
|
||||||
$this->pass_indatabase=$password;
|
$this->pass_indatabase=$password;
|
||||||
|
|||||||
@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user