NEW add possibility to hide LDAP tab for non admin
This commit is contained in:
parent
8d3ad9ddc8
commit
feea6246c2
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2010-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
@ -42,7 +42,8 @@ function contact_prepare_head(Contact $object)
|
|||||||
$head[$tab][2] = 'card';
|
$head[$tab][2] = 'card';
|
||||||
$tab++;
|
$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");
|
$langs->load("ldap");
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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';
|
$head[$h][2] = 'general';
|
||||||
$h++;
|
$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");
|
$langs->load("ldap");
|
||||||
|
|
||||||
@ -124,7 +126,8 @@ function member_type_prepare_head(AdherentType $object)
|
|||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$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");
|
$langs->load("ldap");
|
||||||
|
|
||||||
|
|||||||
@ -50,13 +50,14 @@ function user_prepare_head($object)
|
|||||||
$head[$h][2] = 'user';
|
$head[$h][2] = 'user';
|
||||||
$h++;
|
$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");
|
$langs->load("ldap");
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("LDAPCard");
|
$head[$h][1] = $langs->trans("LDAPCard");
|
||||||
$head[$h][2] = 'ldap';
|
$head[$h][2] = 'ldap';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id;
|
$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';
|
$head[$h][2] = 'group';
|
||||||
$h++;
|
$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");
|
$langs->load("ldap");
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("LDAPCard");
|
$head[$h][1] = $langs->trans("LDAPCard");
|
||||||
$head[$h][2] = 'ldap';
|
$head[$h][2] = 'ldap';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($canreadperms)
|
if ($canreadperms)
|
||||||
|
|||||||
@ -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';
|
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->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->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->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';
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php';
|
||||||
|
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$mode = GETPOST('mode','alpha');
|
$mode = GETPOST('mode','alpha');
|
||||||
$confirm = GETPOST('confirm','alpha');
|
$confirm = GETPOST('confirm','alpha');
|
||||||
$subaction = GETPOST('subaction','alpha');
|
$subaction = GETPOST('subaction','alpha');
|
||||||
$group = GETPOST("group","int",3);
|
$group = GETPOST("group","int",3);
|
||||||
$cancel = GETPOST('cancel','alpha');
|
$cancel = GETPOST('cancel','alpha');
|
||||||
|
|
||||||
// Users/Groups management only in master entity if transverse mode
|
// 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)
|
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);
|
$object->fetch($id);
|
||||||
if ($action == 'addgroup') {
|
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') {
|
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) {
|
if ($result > 0) {
|
||||||
|
|||||||
@ -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/lib/usergroups.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.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
|
// Defini si peux lire/modifier utilisateurs et permisssions
|
||||||
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
||||||
|
|||||||
@ -26,9 +26,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
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)
|
if (! $user->rights->user->user->lire && ! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user