mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
FIX: API access for deactivated users
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user