Skip to content

Commit

Permalink
Fix compatibility with multicompany
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 2, 2017
1 parent 0dd8db9 commit 8ccc57e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/lib/security.lib.php
Expand Up @@ -102,7 +102,7 @@ function dol_hash($chain,$type=0)
* @param User $user User to check
* @param string $features Features to check (it must be module name. Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...)
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional)
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany modume. Param not used if objectid is null (optional).
* @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
Expand Down Expand Up @@ -345,7 +345,7 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
* @param User $user User to check
* @param array $featuresarray Features/modules to check. Example: ('user','service')
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional)
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany modume. Param not used if objectid is null (optional).
* @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expensereport/document.php
Expand Up @@ -46,7 +46,7 @@

// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'expensereport', $id, '');
$result = restrictedArea($user, 'expensereport', $id, 'expensereport');


// Get parameters
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expensereport/info.php
Expand Up @@ -33,7 +33,7 @@
// Security check
$id = GETPOST('id','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'expensereport', $id, '');
$result = restrictedArea($user, 'expensereport', $id, 'expensereport');


/*
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expensereport/note.php
Expand Up @@ -42,7 +42,7 @@
// Security check
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'expensereport',$id,'');
$result=restrictedArea($user,'expensereport',$id,'expensereport');


$object = new ExpenseReport($db);
Expand Down

0 comments on commit 8ccc57e

Please sign in to comment.