Skip to content

Commit

Permalink
FIX #7806
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 25, 2017
1 parent 38c770f commit 4cbcf51
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions htdocs/user/class/api_users.class.php
Expand Up @@ -286,6 +286,7 @@ function delete($id) {
* @return array Array of cleaned object properties
*/
function _cleanObjectDatas($object) {
global $conf;

$object = parent::_cleanObjectDatas($object);

Expand All @@ -298,10 +299,16 @@ function _cleanObjectDatas($object) {
unset($object->total_localtax1);
unset($object->total_localtax2);
unset($object->total_ttc);
unset($object->libelle_incoterms);
unset($object->location_incoterms);

unset($object->fk_delivery_address);
unset($object->fk_incoterms);
unset($object->all_permissions_are_loaded);
unset($object->shipping_method_id);
unset($object->nb_rights);
unset($object->search_sid);
unset($object->ldap_sid);

// List of properties never returned by API, whatever are permissions
unset($object->pass);
Expand All @@ -310,6 +317,19 @@ function _cleanObjectDatas($object) {
unset($object->pass_temp);
unset($object->api_key);
unset($object->clicktodial_password);
unset($object->openid);


$canreadsalary = ((! empty($conf->salaries->enabled) && ! empty(DolibarrApiAccess::$user->rights->salaries->read))
|| (! empty($conf->hrm->enabled) && ! empty(DolibarrApiAccess::$user->rights->hrm->employee->read)));

if (! $canreadsalary)
{
unset($object->salary);
unset($object->salaryextra);
unset($object->thm);
unset($object->tjm);
}

return $object;
}
Expand Down

0 comments on commit 4cbcf51

Please sign in to comment.