Merge pull request #23616 from fmarcet/14.0

FIX: API access for deactivated users
This commit is contained in:
Laurent Destailleur 2023-01-18 19:37:35 +01:00 committed by GitHub
commit f1718d0116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -147,6 +148,9 @@ class DolibarrApiAccess implements iAuthenticate
if ($result <= 0) {
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
}
if ($fuser->statut == 0) {
throw new RestException(503, 'Error when fetching user. This user has been locked or disabled');
}
$fuser->getrights();