mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-08 01:53:03 +01:00
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into new-api-rest-tokens
This commit is contained in:
@@ -196,7 +196,7 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
}
|
||||
|
||||
// Check if user status is enabled
|
||||
if ($fuser->statut != $fuser::STATUS_ENABLED) {
|
||||
if ($fuser->status != $fuser::STATUS_ENABLED) {
|
||||
// Status is disabled
|
||||
dol_syslog("functions_isallowed::check_user_api_key Authentication KO for '".$login."': The user has been disabled", LOG_NOTICE);
|
||||
sleep(1); // Anti brute force protection. Must be same delay when user and password are not valid.
|
||||
@@ -219,6 +219,14 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
throw new RestException(401, $genericmessageerroruser);
|
||||
}
|
||||
|
||||
// TODO
|
||||
// Increase counter of API access
|
||||
if (getDolGlobalString('API_COUNTER_ENABLED')) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
dolibarr_set_const($this->db, 'API_COUNTER_COUNT', getDolGlobalInt('API_COUNTER_COUNT') + 1);
|
||||
//var_dump('eeee');exit;
|
||||
}
|
||||
|
||||
// User seems valid
|
||||
$fuser->loadRights('', 0, $stored_key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user