25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ldap.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/ldap.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
33 $langs->loadLangs(array(
"companies",
"members",
"ldap",
"admin"));
36 $action =
GETPOST(
'action',
'aZ09');
40 if ($user->socid > 0) {
41 $socid = $user->socid;
45 $result = $object->fetch($rowid);
56 if ($action ==
'dolibarr2ldap') {
58 $result = $ldap->connect_bind();
61 $info = $object->_load_ldap_info();
62 $dn = $object->_load_ldap_dn($info);
65 $result = $ldap->update($dn, $info, $user, $olddn);
81 $form =
new Form($db);
83 llxHeader(
'', $langs->trans(
"Member"),
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
89 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
93 print '<div class="fichecenter">';
95 print '<div class="underbanner clearboth"></div>';
96 print '<table class="border centpercent tableforfield">';
99 print '<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.$object->login.
' </td></tr>';
102 if (!empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) {
103 print '<tr><td>'.$langs->trans(
"LDAPFieldPasswordNotCrypted").
'</td>';
104 print '<td class="valeur">'.$object->pass.
'</td>';
109 $adht->fetch($object->typeid);
112 print '<tr><td>'.$langs->trans(
"Type").
'</td><td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
115 print '<tr><td>LDAP '.$langs->trans(
"LDAPMemberDn").
'</td><td class="valeur">'.$conf->global->LDAP_MEMBER_DN.
"</td></tr>\n";
118 print '<tr><td>LDAP '.$langs->trans(
"LDAPNamingAttribute").
'</td><td class="valeur">'.$conf->global->LDAP_KEY_MEMBERS.
"</td></tr>\n";
121 print '<tr><td>LDAP '.$langs->trans(
"Type").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_TYPE.
"</td></tr>\n";
122 print '<tr><td>LDAP '.$langs->trans(
"Version").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_PROTOCOLVERSION.
"</td></tr>\n";
123 print '<tr><td>LDAP '.$langs->trans(
"LDAPPrimaryServer").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_HOST.
"</td></tr>\n";
124 print '<tr><td>LDAP '.$langs->trans(
"LDAPSecondaryServer").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_HOST_SLAVE.
"</td></tr>\n";
125 print '<tr><td>LDAP '.$langs->trans(
"LDAPServerPort").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_PORT.
"</td></tr>\n";
137 print '<div class="tabsAction">';
139 if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE !=
'ldap2dolibarr') {
140 print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=dolibarr2ldap">'.$langs->trans(
"ForceSynchronize").
'</a></div>';
145 if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE !=
'ldap2dolibarr')
print "<br>\n";
152 print '<table width="100%" class="noborder">';
154 print
'<tr class="liste_titre">';
155 print
'<td>'.$langs->trans(
"LDAPAttributes").
'</td>';
156 print
'<td>'.$langs->trans(
"Value").
'</td>';
161 $result = $ldap->connect_bind();
163 $info = $object->_load_ldap_info();
164 $dn = $object->_load_ldap_dn($info, 1);
165 $search =
"(".$object->_load_ldap_dn($info, 2).
")";
168 $langs->load(
"errors");
169 print
'<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"Member")).
'</font></td></tr>';
171 $records = $ldap->getAttribute($dn, $search);
176 if (((!is_numeric($records)) || $records != 0) && (!isset($records[
'count']) || $records[
'count'] > 0)) {
177 if (!is_array($records)) {
178 print
'<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans(
"ErrorFailedToReadLDAP").
'</font></td></tr>';
183 print
'<tr class="oddeven"><td colspan="2">'.$langs->trans(
"LDAPRecordNotFound").
' (dn='.$dn.
' - search='.$search.
')</td></tr>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object informations.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
show_ldap_content($result, $level, $count, $var, $hide=0, $subcount=0)
Show a LDAP array into an HTML output array.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
Class to manage members of a foundation.
Class to manage members type.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
Class to manage LDAP features.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.