forked from Wavyzz/dolibarr
Move api counter at a better place
This commit is contained in:
@@ -191,14 +191,6 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
throw new RestException(401, $genericmessageerroruser);
|
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
|
// User seems valid
|
||||||
$fuser->getrights();
|
$fuser->getrights();
|
||||||
|
|
||||||
|
|||||||
@@ -305,6 +305,14 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
|
|||||||
$moduleobject = $reg[1];
|
$moduleobject = $reg[1];
|
||||||
if ($moduleobject == 'explorer') { // If we call page to explore details of a service
|
if ($moduleobject == 'explorer') { // If we call page to explore details of a service
|
||||||
$moduleobject = $regbis[2];
|
$moduleobject = $regbis[2];
|
||||||
|
} else {
|
||||||
|
// TODO
|
||||||
|
// Increase counter of API access
|
||||||
|
if (getDolGlobalString('API_COUNTER_ENABLED')) {
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
dolibarr_set_const($db, 'API_COUNTER_COUNT', getDolGlobalInt('API_COUNTER_COUNT') + 1);
|
||||||
|
//var_dump('eeee');exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$moduleobject = strtolower($moduleobject);
|
$moduleobject = strtolower($moduleobject);
|
||||||
|
|||||||
Reference in New Issue
Block a user