Merge pull request #7749 from hregis/develop_member

Fix: move some check in multicompany module
This commit is contained in:
Laurent Destailleur 2017-11-02 13:52:36 +01:00 committed by GitHub
commit 4d02984ae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 21 deletions

View File

@ -38,11 +38,6 @@ $confirm=GETPOST('confirm', 'alpha');
$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);
@ -64,16 +59,10 @@ $object->fetch($id);
$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);
/**

View File

@ -71,16 +71,10 @@ $object->fetch($id, '', '', 1);
$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);
/**