Fix: limit access setup page of core module to superadmin
This commit is contained in:
parent
f52b7c08df
commit
01dfb476b3
@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT.'/multicompany/multicompany.class.php');
|
|||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin || $user->entity)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$mc = new Multicompany($db);
|
$mc = new Multicompany($db);
|
||||||
@ -88,7 +88,7 @@ else
|
|||||||
{
|
{
|
||||||
print_titre($langs->trans("ListOfEntity"));
|
print_titre($langs->trans("ListOfEntity"));
|
||||||
|
|
||||||
$mc->getEntities();
|
$mc->getEntities(1);
|
||||||
//var_dump($mc->entities);
|
//var_dump($mc->entities);
|
||||||
|
|
||||||
$mc->assign_smarty_values($smarty,$_GET["action"]);
|
$mc->assign_smarty_values($smarty,$_GET["action"]);
|
||||||
|
|||||||
@ -163,7 +163,7 @@ class Multicompany
|
|||||||
/**
|
/**
|
||||||
* \brief List of entities
|
* \brief List of entities
|
||||||
*/
|
*/
|
||||||
function getEntities()
|
function getEntities($details=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ class Multicompany
|
|||||||
|
|
||||||
$this->entities[$i]['label'] = $obj->value;
|
$this->entities[$i]['label'] = $obj->value;
|
||||||
$this->entities[$i]['id'] = $obj->entity;
|
$this->entities[$i]['id'] = $obj->entity;
|
||||||
$this->entities[$i]['details'] = $this->fetch($entity);
|
if ($details) $this->entities[$i]['details'] = $this->fetch($entity);
|
||||||
$this->entities[$i]['active'] = $active;
|
$this->entities[$i]['active'] = $active;
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user