Skip to content

Commit

Permalink
Fix init of environment for a dedicated entity in API
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 19, 2017
1 parent 8da7f78 commit d7113a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/api/class/api_access.class.php
Expand Up @@ -118,7 +118,7 @@ public function __isAllowed()
$stored_key = $obj->api_key;
$userentity = $obj->entity;

if (! defined("DOLENTITY") && $conf->entity != $obj->entity) // If API was not forced with HTTP_DOLENTITY, and user is on another entity, so we reset entity to entity of user
if (! defined("DOLENTITY") && $conf->entity != ($obj->entity?$obj->entity:1)) // If API was not forced with HTTP_DOLENTITY, and user is on another entity, so we reset entity to entity of user
{
$conf->entity = ($obj->entity?$obj->entity:1);
// We must also reload global conf to get params from the entity
Expand Down

0 comments on commit d7113a3

Please sign in to comment.