mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Fix a delete must be done after a fetch
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user