Fix regression with last PR: change of password was not working.
This commit is contained in:
parent
404ac60226
commit
75ed221fb8
@ -476,21 +476,25 @@ if (empty($reshook)) {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($caneditpassword) // Case we can edit only password
|
||||
{
|
||||
$object->fetch($id);
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$ret = $object->setPassword($user, $_POST["password"]);
|
||||
if ($ret < 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($caneditpassword) // Case we can edit only password
|
||||
{
|
||||
dol_syslog("Not allowed to change fields, only password");
|
||||
|
||||
$object->fetch($id);
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$ret = $object->setPassword($user, GETPOST("password"));
|
||||
if ($ret < 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Change password with a new generated one
|
||||
|
||||
Loading…
Reference in New Issue
Block a user