Fix: Message d'erreur plus parlant lorsque l'utilisateur ne peut etre effacé
This commit is contained in:
parent
e8046c2186
commit
832c7cc4c0
@ -633,7 +633,6 @@ class User
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
dolibarr_print_error($this->db);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,11 +111,18 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes")
|
|||||||
{
|
{
|
||||||
$edituser = new User($db, $_GET["id"]);
|
$edituser = new User($db, $_GET["id"]);
|
||||||
$edituser->id=$_GET["id"];
|
$edituser->id=$_GET["id"];
|
||||||
$edituser->delete();
|
$result = $edituser->delete();
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$message='<div class="error">'.$langs->trans("UserCannotBeDelete").'</div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Header("Location: index.php");
|
Header("Location: index.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Action ajout user
|
// Action ajout user
|
||||||
if ($_POST["action"] == 'add' && $canadduser)
|
if ($_POST["action"] == 'add' && $canadduser)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user