Skip to content

Commit

Permalink
Fix: add function for switch to another entity
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Apr 1, 2011
1 parent 2548c1d commit 6c2b1f5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions htdocs/main.inc.php
Expand Up @@ -752,6 +752,23 @@ function analyse_sql_and_script(&$var,$get)

$heightforframes=48;

// Switch to another entity
if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY))
{
if (GETPOST('action') == 'switchentity' && $user->admin && ! $user->entity)
{
require_once("../class/actions_multicompany.class.php");

$mc = new ActionsMulticompany($db);

if($mc->switchEntity(GETPOST('entity_id')) > 0)
{
Header("Location: ".DOL_URL_ROOT.'/');
exit;
}
}
}


// Functions

Expand Down

0 comments on commit 6c2b1f5

Please sign in to comment.