26require
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/ldap.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/ldap.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
34$langs->loadLangs(array(
"companies",
"members",
"ldap",
"admin"));
37$ref =
GETPOST(
'ref',
'alphanohtml');
38$action =
GETPOST(
'action',
'aZ09');
42if ($user->socid > 0) {
43 $socid = $user->socid;
49if ($id > 0 || !empty($ref)) {
51 $result = $object->fetch($id, $ref);
54 $canadduser = (!empty($user->admin) || $user->hasRight(
'user',
'user',
'creer'));
56 if ($object->user_id) {
58 $caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
59 || (($user->id != $object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
60 $caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight(
'user',
'self',
'password'))
61 || (($user->id != $object->user_id) && $user->hasRight(
'user',
'user',
'password')));
66$canaddmember = $user->hasRight(
'adherent',
'creer');
69 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
73$result =
restrictedArea($user,
'adherent', $object->id,
'',
'',
'socid',
'rowid', 0);
80if ($action ==
'dolibarr2ldap') {
82 $result = $ldap->connect_bind();
85 $info = $object->_load_ldap_info();
86 $dn = $object->_load_ldap_dn($info);
89 $result = $ldap->update($dn, $info, $user, $olddn);
105$form =
new Form($db);
107llxHeader(
'', $langs->trans(
"Member"),
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder');
113$linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
117print
'<div class="fichecenter">';
119print
'<div class="underbanner clearboth"></div>';
120print
'<table class="border centpercent tableforfield">';
123print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.$object->login.
' </td></tr>';
126if (!empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) {
127 print
'<tr><td>'.$langs->trans(
"LDAPFieldPasswordNotCrypted").
'</td>';
128 print
'<td class="valeur">'.$object->pass.
'</td>';
133$adht->fetch($object->typeid);
136print
'<tr><td>'.$langs->trans(
"Type").
'</td><td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
139print
'<tr><td>LDAP '.$langs->trans(
"LDAPMemberDn").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_MEMBER_DN').
"</td></tr>\n";
142print
'<tr><td>LDAP '.$langs->trans(
"LDAPNamingAttribute").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_KEY_MEMBERS').
"</td></tr>\n";
145print
'<tr><td>LDAP '.$langs->trans(
"Type").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_TYPE').
"</td></tr>\n";
146print
'<tr><td>LDAP '.$langs->trans(
"Version").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_PROTOCOLVERSION').
"</td></tr>\n";
147print
'<tr><td>LDAP '.$langs->trans(
"LDAPPrimaryServer").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_HOST').
"</td></tr>\n";
148print
'<tr><td>LDAP '.$langs->trans(
"LDAPSecondaryServer").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_HOST_SLAVE').
"</td></tr>\n";
149print
'<tr><td>LDAP '.$langs->trans(
"LDAPServerPort").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_PORT').
"</td></tr>\n";
160print
'<div class="tabsAction">';
163 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=dolibarr2ldap">'.$langs->trans(
"ForceSynchronize").
'</a></div>';
177print
'<table width="100%" class="noborder">';
179print
'<tr class="liste_titre">';
180print
'<td>'.$langs->trans(
"LDAPAttributes").
'</td>';
181print
'<td>'.$langs->trans(
"Value").
'</td>';
186$result = $ldap->connect_bind();
188 $info = $object->_load_ldap_info();
189 $dn = $object->_load_ldap_dn($info, 1);
190 $search =
"(".$object->_load_ldap_dn($info, 2).
")";
193 $langs->load(
"errors");
194 print
'<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"Member")).
'</span></td></tr>';
196 $records = $ldap->getAttribute($dn, $search);
201 if (((!is_numeric($records)) || $records != 0) && (!isset($records[
'count']) || $records[
'count'] > 0)) {
202 if (!is_array($records)) {
203 print
'<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans(
"ErrorFailedToReadLDAP").
'</span></td></tr>';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage members of a foundation.
Class to manage members type.
Class to manage LDAP features.
const SYNCHRO_LDAP_TO_DOLIBARR
Ldap to Dolibarr synchronization.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
show_ldap_content($result, $level, $count, $var, $hide=0, $subcount=0)
Show a LDAP array into an HTML output array.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object informations.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.