|
@@ -1,6 +1,6 @@
|
|
|
<?php
|
|
|
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
|
- * Copyright (C) 2006-2017 Regis Houssin <regis.houssin@inodbox.com>
|
|
|
+ * Copyright (C) 2006-2021 Regis Houssin <regis.houssin@inodbox.com>
|
|
|
*
|
|
|
* 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 '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
|
|
|
|
|
// LDAP DN
|
|
|
-print '<tr><td>LDAP '.$langs->trans("LDAPMemberDn").'</td><td class="valeur">'.$conf->global->LDAP_MEMBER_DN."</td></tr>\n";
|
|
|
+print '<tr><td>LDAP '.$langs->trans("LDAPMemberDn").'</td><td class="valeur">'.getDolGlobalString('LDAP_MEMBER_DN')."</td></tr>\n";
|
|
|
|
|
|
// LDAP Cle
|
|
|
-print '<tr><td>LDAP '.$langs->trans("LDAPNamingAttribute").'</td><td class="valeur">'.$conf->global->LDAP_KEY_MEMBERS."</td></tr>\n";
|
|
|
+print '<tr><td>LDAP '.$langs->trans("LDAPNamingAttribute").'</td><td class="valeur">'.getDolGlobalString('LDAP_KEY_MEMBERS')."</td></tr>\n";
|
|
|
|
|
|
// LDAP Server
|
|
|
-print '<tr><td>LDAP '.$langs->trans("Type").'</td><td class="valeur">'.$conf->global->LDAP_SERVER_TYPE."</td></tr>\n";
|
|
|
-print '<tr><td>LDAP '.$langs->trans("Version").'</td><td class="valeur">'.$conf->global->LDAP_SERVER_PROTOCOLVERSION."</td></tr>\n";
|
|
|
-print '<tr><td>LDAP '.$langs->trans("LDAPPrimaryServer").'</td><td class="valeur">'.$conf->global->LDAP_SERVER_HOST."</td></tr>\n";
|
|
|
-print '<tr><td>LDAP '.$langs->trans("LDAPSecondaryServer").'</td><td class="valeur">'.$conf->global->LDAP_SERVER_HOST_SLAVE."</td></tr>\n";
|
|
|
-print '<tr><td>LDAP '.$langs->trans("LDAPServerPort").'</td><td class="valeur">'.$conf->global->LDAP_SERVER_PORT."</td></tr>\n";
|
|
|
+print '<tr><td>LDAP '.$langs->trans("Type").'</td><td class="valeur">'.getDolGlobalString('LDAP_SERVER_TYPE')."</td></tr>\n";
|
|
|
+print '<tr><td>LDAP '.$langs->trans("Version").'</td><td class="valeur">'.getDolGlobalString('LDAP_SERVER_PROTOCOLVERSION')."</td></tr>\n";
|
|
|
+print '<tr><td>LDAP '.$langs->trans("LDAPPrimaryServer").'</td><td class="valeur">'.getDolGlobalString('LDAP_SERVER_HOST')."</td></tr>\n";
|
|
|
+print '<tr><td>LDAP '.$langs->trans("LDAPSecondaryServer").'</td><td class="valeur">'.getDolGlobalString('LDAP_SERVER_HOST_SLAVE')."</td></tr>\n";
|
|
|
+print '<tr><td>LDAP '.$langs->trans("LDAPServerPort").'</td><td class="valeur">'.getDolGlobalString('LDAP_SERVER_PORT')."</td></tr>\n";
|
|
|
|
|
|
print '</table>';
|
|
|
|
|
@@ -158,13 +158,13 @@ print dol_get_fiche_end();
|
|
|
*/
|
|
|
print '<div class="tabsAction">';
|
|
|
|
|
|
-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 '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a></div>';
|
|
|
}
|
|
|
|
|
|
print "</div>\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 "<br>\n";
|
|
|
}
|
|
|
|