mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +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 ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) {
|
||||||
if ($id <> $user->id) {
|
if ($id <> $user->id) {
|
||||||
$object = new User($db);
|
$object = new User($db);
|
||||||
$object->id = $id;
|
$object->fetch($id);
|
||||||
$result = $object->delete();
|
$result = $object->delete();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|||||||
@@ -159,9 +159,9 @@ class User extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Load a user from database with its id or ref (login)
|
* Load a user from database with its id or ref (login)
|
||||||
*
|
*
|
||||||
* @param int $id Si defini, id a utiliser pour recherche
|
* @param int $id If defined, id to used for search
|
||||||
* @param string $login Si defini, login a utiliser pour recherche
|
* @param string $login If defined, login to used for search
|
||||||
* @param string $sid Si defini, sid a utiliser pour recherche
|
* @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 $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.
|
* @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
|
* @return int <0 if KO, 0 not found, >0 if OK
|
||||||
|
|||||||
Reference in New Issue
Block a user