Merge pull request #9045 from hregis/8.0_multicompany
Fix: check if multicompany object exists
This commit is contained in:
commit
67a831ad5f
@ -88,7 +88,7 @@ $user = new User($db);
|
|||||||
$user->fetch(5);
|
$user->fetch(5);
|
||||||
$user->getrights();
|
$user->getrights();
|
||||||
|
|
||||||
if (! empty($conf->multicompany->enabled) && ! empty($conf->stripeconnect->enabled)) {
|
if (! empty($conf->multicompany->enabled) && ! empty($conf->stripeconnect->enabled) && is_object($mc)) {
|
||||||
$sql = "SELECT entity";
|
$sql = "SELECT entity";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."oauth_token";
|
$sql.= " FROM ".MAIN_DB_PREFIX."oauth_token";
|
||||||
$sql.= " WHERE service = '".$db->escape($service)."' and tokenstring = '%".$db->escape($event->account)."%'";
|
$sql.= " WHERE service = '".$db->escape($service)."' and tokenstring = '%".$db->escape($event->account)."%'";
|
||||||
@ -102,10 +102,12 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->stripeconnect->enabl
|
|||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$key=$obj->entity;
|
$key=$obj->entity;
|
||||||
}
|
}
|
||||||
else {$key=1;
|
else {
|
||||||
|
$key=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {$key=1;
|
else {
|
||||||
|
$key=1;
|
||||||
}
|
}
|
||||||
$ret=$mc->switchEntity($key);
|
$ret=$mc->switchEntity($key);
|
||||||
if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
|
if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user