Skip to content
Snippets Groups Projects
Commit 2938e01f authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix a delete must be done after a fetch

parent 49f5ec6b
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,7 @@ if (empty($reshook)) {
if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) {
if ($id <> $user->id) {
$object = new User($db);
$object->id = $id;
$object->fetch($id);
$result = $object->delete();
if ($result < 0) {
$langs->load("errors");
......
......@@ -159,9 +159,9 @@ class User extends CommonObject
/**
* Load a user from database with its id or ref (login)
*
* @param int $id Si defini, id a utiliser pour recherche
* @param string $login Si defini, login a utiliser pour recherche
* @param string $sid Si defini, sid a utiliser pour recherche
* @param int $id If defined, id to used for search
* @param string $login If defined, login to used for search
* @param string $sid If defined, sid to used for search
* @param int $loadpersonalconf 1=also load personal conf of user (in $user->conf->xxx)
* @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup.
* @return int <0 if KO, 0 not found, >0 if OK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment