2
0
forked from Wavyzz/dolibarr

Fix not initialized variables

This commit is contained in:
Laurent Destailleur
2016-05-08 12:32:18 +02:00
parent 5cf8612c58
commit 7c3c8f70be
5 changed files with 17 additions and 232 deletions

View File

@@ -70,6 +70,7 @@ class DolibarrApiAccess implements iAuthenticate
{
global $db;
$login = '';
$stored_key = '';
$userClass = Defaults::$userIdentifierClass;
@@ -95,11 +96,15 @@ class DolibarrApiAccess implements iAuthenticate
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
}
if ( $stored_key != $_GET['api_key']) {
if ($stored_key != $_GET['api_key']) {
$userClass::setCacheIdentifier($_GET['api_key']);
return false;
}
if (! $login)
{
throw new RestException(503, 'Error when searching logn user fro mapi key');
}
$fuser = new User($db);
if(! $fuser->fetch('',$login)) {
throw new RestException(503, 'Error when fetching user :'.$fuser->error);