diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 70624983815..db87e514cb5 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2017 Regis Houssin + * Copyright (C) 2006-2021 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 @@ -50,14 +50,14 @@ if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); // Define variables to know what current user can do on users - $canadduser = ($user->admin || $user->rights->user->user->creer); + $canadduser = (!empty($user->admin) || !empty($user->rights->user->user->creer)); // Define variables to know what current user can do on properties of user linked to edited member if ($object->user_id) { // $User is the user who edits, $object->user_id is the id of the related user in the edited member - $caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer) - || (($user->id != $object->user_id) && $user->rights->user->user->creer)); + $caneditfielduser = ((($user->id == $object->user_id) && !empty($user->rights->user->self->creer)) + || (($user->id != $object->user_id) && !empty($user->rights->user->user->creer))); $caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password) - || (($user->id != $object->user_id) && $user->rights->user->user->password)); + || (($user->id != $object->user_id) && !empty($user->rights->user->user->password))); } } @@ -135,17 +135,17 @@ $adht->fetch($object->typeid); print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; // LDAP DN -print 'LDAP '.$langs->trans("LDAPMemberDn").''.$conf->global->LDAP_MEMBER_DN."\n"; +print 'LDAP '.$langs->trans("LDAPMemberDn").''.getDolGlobalString('LDAP_MEMBER_DN')."\n"; // LDAP Cle -print 'LDAP '.$langs->trans("LDAPNamingAttribute").''.$conf->global->LDAP_KEY_MEMBERS."\n"; +print 'LDAP '.$langs->trans("LDAPNamingAttribute").''.getDolGlobalString('LDAP_KEY_MEMBERS')."\n"; // LDAP Server -print 'LDAP '.$langs->trans("Type").''.$conf->global->LDAP_SERVER_TYPE."\n"; -print 'LDAP '.$langs->trans("Version").''.$conf->global->LDAP_SERVER_PROTOCOLVERSION."\n"; -print 'LDAP '.$langs->trans("LDAPPrimaryServer").''.$conf->global->LDAP_SERVER_HOST."\n"; -print 'LDAP '.$langs->trans("LDAPSecondaryServer").''.$conf->global->LDAP_SERVER_HOST_SLAVE."\n"; -print 'LDAP '.$langs->trans("LDAPServerPort").''.$conf->global->LDAP_SERVER_PORT."\n"; +print 'LDAP '.$langs->trans("Type").''.getDolGlobalString('LDAP_SERVER_TYPE')."\n"; +print 'LDAP '.$langs->trans("Version").''.getDolGlobalString('LDAP_SERVER_PROTOCOLVERSION')."\n"; +print 'LDAP '.$langs->trans("LDAPPrimaryServer").''.getDolGlobalString('LDAP_SERVER_HOST')."\n"; +print 'LDAP '.$langs->trans("LDAPSecondaryServer").''.getDolGlobalString('LDAP_SERVER_HOST_SLAVE')."\n"; +print 'LDAP '.$langs->trans("LDAPServerPort").''.getDolGlobalString('LDAP_SERVER_PORT')."\n"; print ''; @@ -158,13 +158,13 @@ print dol_get_fiche_end(); */ print '
'; -if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE != Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { +if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && getDolGlobalString('LDAP_MEMBER_ACTIVE') != Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { print ''; } print "
\n"; -if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE != Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { +if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && getDolGlobalString('LDAP_MEMBER_ACTIVE') != Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { print "
\n"; } diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index e3a01f27731..af28b979225 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -46,13 +46,13 @@ $object->fetch($id); $object->getrights(); // Users/Groups management only in master entity if transverse mode -if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { +if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { accessforbidden(); } $canreadperms = true; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreadperms = ($user->admin || $user->rights->user->group_advance->read); + $canreadperms = (!empty($user->admin) || !empty($user->rights->user->group_advance->read)); } @@ -100,7 +100,7 @@ print dol_get_fiche_head($head, 'ldap', $langs->trans("Group"), -1, 'group'); $linkback = ''.$langs->trans("BackToList").''; -dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); +dol_banner_tab($object, 'id', $linkback, (!empty($user->rights->user->user->lire) || !empty($user->admin))); print '
'; print '
'; @@ -125,15 +125,15 @@ print ''; print "\n"; // LDAP DN -print 'LDAP '.$langs->trans("LDAPGroupDn").''.$conf->global->LDAP_GROUP_DN."\n"; +print 'LDAP '.$langs->trans("LDAPGroupDn").''.getDolGlobalString('LDAP_GROUP_DN')."\n"; // LDAP Cle -print 'LDAP '.$langs->trans("LDAPNamingAttribute").''.$conf->global->LDAP_KEY_GROUPS."\n"; +print 'LDAP '.$langs->trans("LDAPNamingAttribute").''.getDolGlobalString('LDAP_KEY_GROUPS')."\n"; // LDAP Server -print 'LDAP '.$langs->trans("LDAPPrimaryServer").''.$conf->global->LDAP_SERVER_HOST."\n"; -print 'LDAP '.$langs->trans("LDAPSecondaryServer").''.$conf->global->LDAP_SERVER_HOST_SLAVE."\n"; -print 'LDAP '.$langs->trans("LDAPServerPort").''.$conf->global->LDAP_SERVER_PORT."\n"; +print 'LDAP '.$langs->trans("LDAPPrimaryServer").''.getDolGlobalString('LDAP_SERVER_HOST')."\n"; +print 'LDAP '.$langs->trans("LDAPSecondaryServer").''.getDolGlobalString('LDAP_SERVER_HOST_SLAVE')."\n"; +print 'LDAP '.$langs->trans("LDAPServerPort").''.getDolGlobalString('LDAP_SERVER_PORT')."\n"; print "\n"; diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 66199e9b3f6..5e6cf57bfd4 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2017 Regis Houssin + * Copyright (C) 2006-2021 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 @@ -130,17 +130,17 @@ if ($conf->global->LDAP_SERVER_TYPE == "activedirectory") { } // LDAP DN -print 'LDAP '.$langs->trans("LDAPUserDn").''.$conf->global->LDAP_USER_DN."\n"; +print 'LDAP '.$langs->trans("LDAPUserDn").''.getDolGlobalString('LDAP_USER_DN')."\n"; // LDAP Cle -print 'LDAP '.$langs->trans("LDAPNamingAttribute").''.$conf->global->LDAP_KEY_USERS."\n"; +print 'LDAP '.$langs->trans("LDAPNamingAttribute").''.getDolGlobalString('LDAP_KEY_USERS')."\n"; // LDAP Server -print 'LDAP '.$langs->trans("Type").''.$conf->global->LDAP_SERVER_TYPE."\n"; -print 'LDAP '.$langs->trans("Version").''.$conf->global->LDAP_SERVER_PROTOCOLVERSION."\n"; -print 'LDAP '.$langs->trans("LDAPPrimaryServer").''.$conf->global->LDAP_SERVER_HOST."\n"; -print 'LDAP '.$langs->trans("LDAPSecondaryServer").''.$conf->global->LDAP_SERVER_HOST_SLAVE."\n"; -print 'LDAP '.$langs->trans("LDAPServerPort").''.$conf->global->LDAP_SERVER_PORT."\n"; +print 'LDAP '.$langs->trans("Type").''.getDolGlobalString('LDAP_SERVER_TYPE')."\n"; +print 'LDAP '.$langs->trans("Version").''.getDolGlobalString('LDAP_SERVER_PROTOCOLVERSION')."\n"; +print 'LDAP '.$langs->trans("LDAPPrimaryServer").''.getDolGlobalString('LDAP_SERVER_HOST')."\n"; +print 'LDAP '.$langs->trans("LDAPSecondaryServer").''.getDolGlobalString('LDAP_SERVER_HOST_SLAVE')."\n"; +print 'LDAP '.$langs->trans("LDAPServerPort").''.getDolGlobalString('LDAP_SERVER_PORT')."\n"; print '';