diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index f951439f0c5..f1d721b62e6 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2017 Regis Houssin * Copyright (C) 2015 Frederic France * Copyright (C) 2015 Raphaël Doursenaud * @@ -42,7 +42,8 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'card'; $tab++; - if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE)) + if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE)) + && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin))) { $langs->load("ldap"); @@ -94,7 +95,7 @@ function contact_prepare_head(Contact $object) } $head[$tab][2] = 'agenda'; $tab++; - + // Log /* $head[$tab][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 7e5e5e0c604..4da1ed91fae 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -1,7 +1,8 @@ - * Copyright (C) 2015-2016 Alexandre Spangaro - * Copyright (C) 2015 Raphaël Doursenaud +/* Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,7 +42,8 @@ function member_prepare_head(Adherent $object) $head[$h][2] = 'general'; $h++; - if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) + if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) + && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin))) { $langs->load("ldap"); @@ -124,7 +126,8 @@ function member_type_prepare_head(AdherentType $object) $head[$h][2] = 'card'; $h++; - if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) + if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) + && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin))) { $langs->load("ldap"); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index f39e6ecd628..04bfa5666e2 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -50,13 +50,14 @@ function user_prepare_head($object) $head[$h][2] = 'user'; $h++; - if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) + if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) + && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin))) { $langs->load("ldap"); - $head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id; - $head[$h][1] = $langs->trans("LDAPCard"); - $head[$h][2] = 'ldap'; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id; + $head[$h][1] = $langs->trans("LDAPCard"); + $head[$h][2] = 'ldap'; + $h++; } $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; @@ -210,13 +211,14 @@ function group_prepare_head($object) $head[$h][2] = 'group'; $h++; - if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) + if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) + && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin))) { $langs->load("ldap"); - $head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id; - $head[$h][1] = $langs->trans("LDAPCard"); - $head[$h][2] = 'ldap'; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id; + $head[$h][1] = $langs->trans("LDAPCard"); + $head[$h][2] = 'ldap'; + $h++; } if ($canreadperms) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 40fa4db7a37..958ea2184ad 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -45,17 +45,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php'); if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'; $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); $mode = GETPOST('mode','alpha'); -$confirm = GETPOST('confirm','alpha'); +$confirm = GETPOST('confirm','alpha'); $subaction = GETPOST('subaction','alpha'); $group = GETPOST("group","int",3); -$cancel = GETPOST('cancel','alpha'); +$cancel = GETPOST('cancel','alpha'); // Users/Groups management only in master entity if transverse mode if (($action == 'create' || $action == 'adduserldap') && ! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) @@ -289,10 +288,10 @@ if (empty($reshook)) { $object->fetch($id); if ($action == 'addgroup') { - $object->SetInGroup($group, (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? GETPOST('entity', 'int') : $editgroup->entity)); + $result = $object->SetInGroup($group, (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? GETPOST('entity', 'int') : $editgroup->entity)); } if ($action == 'removegroup') { - $object->RemoveFromGroup($group, (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? GETPOST('entity', 'int') : $editgroup->entity)); + $result = $object->RemoveFromGroup($group, (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? GETPOST('entity', 'int') : $editgroup->entity)); } if ($result > 0) { diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 678bd9f0ec2..a54c29ca8d7 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -29,7 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if(! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php'); // Defini si peux lire/modifier utilisateurs et permisssions $canreadperms=($user->admin || $user->rights->user->user->lire); diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 47b8bb4879e..91fe86517c6 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -26,9 +26,6 @@ */ require '../main.inc.php'; -if (! empty($conf->multicompany->enabled)) - dol_include_once('/multicompany/class/actions_multicompany.class.php', 'ActionsMulticompany'); - if (! $user->rights->user->user->lire && ! $user->admin) accessforbidden();