Simplify code
This commit is contained in:
parent
043d11d785
commit
b8bd27009e
@ -112,18 +112,16 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We must check entity
|
// We must check entity
|
||||||
if ($passok)
|
if ($passok && ! empty($conf->multicompany->enabled)) // We must check entity
|
||||||
{
|
{
|
||||||
global $mc;
|
global $mc;
|
||||||
|
|
||||||
if (!isset($mc)) {
|
if (! isset($mc)) $conf->multicompany->enabled = false; // Global not available, disable $conf->multicompany->enabled for safety
|
||||||
//Global not available, disable $conf->multicompany->enabled for safety
|
else
|
||||||
$conf->multicompany->enabled = false;
|
{
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($conf->multicompany->enabled)) {
|
|
||||||
$ret = $mc->checkRight($obj->rowid, $entitytotest);
|
$ret = $mc->checkRight($obj->rowid, $entitytotest);
|
||||||
if ($ret < 0) {
|
if ($ret < 0)
|
||||||
|
{
|
||||||
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko entity '" . $entitytotest . "' not allowed for user '" . $obj->rowid . "'");
|
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko entity '" . $entitytotest . "' not allowed for user '" . $obj->rowid . "'");
|
||||||
$login = ''; // force authentication failure
|
$login = ''; // force authentication failure
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user