Skip to content

Commit

Permalink
Merge pull request #7749 from hregis/develop_member
Browse files Browse the repository at this point in the history
Fix: move some check in multicompany module
  • Loading branch information
eldy committed Nov 2, 2017
2 parents 15272f6 + 19f1cd7 commit 4d02984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
15 changes: 2 additions & 13 deletions htdocs/user/group/perms.php
Expand Up @@ -38,11 +38,6 @@
$module=GETPOST('module', 'alpha');
$rights=GETPOST('rights', 'int');

// Users/Groups management only in master entity if transverse mode
if (! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
{
accessforbidden();
}

// Defini si peux lire les permissions
$canreadperms=($user->admin || $user->rights->user->user->lire);
Expand All @@ -64,16 +59,10 @@
$object->getrights();

$entity=$conf->entity;
if (! empty($conf->multicompany->enabled))
{
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
$entity=(GETPOST('entity','int') ? GETPOST('entity','int') : $conf->entity);
else
$entity=(! empty($object->entity) ? $object->entity : $conf->entity);
}

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('groupcard','globalcard'));
$contextpage=array('groupcard','globalcard');
$hookmanager->initHooks($contextpage);


/**
Expand Down
10 changes: 2 additions & 8 deletions htdocs/user/perms.php
Expand Up @@ -71,16 +71,10 @@
$object->getrights();

$entity=$conf->entity;
if (! empty($conf->multicompany->enabled))
{
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
$entity=(GETPOST('entity','int') ? GETPOST('entity','int') : $conf->entity);
else
$entity=(! empty($object->entity) ? $object->entity : $conf->entity);
}

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('usercard','globalcard'));
$contextpage=array('usercard','globalcard');
$hookmanager->initHooks($contextpage);


/**
Expand Down

0 comments on commit 4d02984

Please sign in to comment.