mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Code comment
This commit is contained in:
parent
78ebffe4f1
commit
8bfda8d4ee
|
|
@ -80,25 +80,25 @@ class DolibarrApiAccess implements iAuthenticate
|
|||
{
|
||||
dol_syslog($key.' - '.$val);
|
||||
}*/
|
||||
|
||||
|
||||
// api key can be provided in url with parameter api_key=xxx or ni header with header DOLAPIKEY:xxx
|
||||
$api_key = '';
|
||||
if (isset($_GET['api_key']))
|
||||
if (isset($_GET['api_key']))
|
||||
{
|
||||
// TODO Add option to disable use of api key on url. Return errors if used.
|
||||
$api_key = $_GET['api_key']; // For backward compatibility
|
||||
}
|
||||
if (isset($_GET['DOLAPIKEY']))
|
||||
if (isset($_GET['DOLAPIKEY']))
|
||||
{
|
||||
// TODO Add option to disable use of api key on url. Return errors if used.
|
||||
$api_key = $_GET['DOLAPIKEY']; // With GET method
|
||||
}
|
||||
if (isset($_SERVER['HTTP_DOLAPIKEY']))
|
||||
if (isset($_SERVER['HTTP_DOLAPIKEY'])) // Param DOLAPIKEY in header can be read with HTTP_DOLAPIKEY
|
||||
{
|
||||
$api_key = $_SERVER['HTTP_DOLAPIKEY']; // With header method (recommanded)
|
||||
}
|
||||
|
||||
if ($api_key)
|
||||
|
||||
if ($api_key)
|
||||
{
|
||||
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
||||
$sql.= " u.tms as date_modification, u.entity";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user