Skip to content
Snippets Groups Projects
Commit 50b0019e authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

A protection to avoid situation loosing all admin accounts

parent cbd01bae
No related branches found
No related tags found
No related merge requests found
......@@ -262,6 +262,10 @@ class User extends CommonObject
$this->fk_member = $obj->fk_member;
$this->fk_user = $obj->fk_user;
// Protection when module multicompany was set, admin was set to first entity and the module disabled,
// then this admin user must be admin for all entities.
if (empty($conf->multicompany->enabled) && $this->admin && $this->entity == 1) $this->entity = 0;
// Retreive all extrafield for thirdparty
// fetch optionals attributes and labels
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment