Go to the documentation of this file.
25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/class/ldap.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ldap.lib.php';
33 $langs->loadLangs(array(
"admin",
"members",
"ldap"));
36 $action =
GETPOST(
'action',
'aZ09');
45 $hookmanager->initHooks(array(
'membertypeldapcard',
'globalcard'));
52 $parameters = array();
53 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
58 if (empty($reshook)) {
59 if ($action ==
'dolibarr2ldap') {
61 $result = $ldap->connect_bind();
64 $object->listMembersForMemberType(
'', 1);
66 $info = $object->_load_ldap_info();
67 $dn = $object->_load_ldap_dn($info);
70 $result = $ldap->update($dn, $info, $user, $olddn);
93 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
97 print
'<div class="fichecenter">';
98 print
'<div class="underbanner clearboth"></div>';
100 print
'<table class="border centpercent">';
103 print
'<tr><td>LDAP '.$langs->trans(
"LDAPMemberTypeDn").
'</td><td class="valeur">'.$conf->global->LDAP_MEMBER_TYPE_DN.
"</td></tr>\n";
106 print
'<tr><td>LDAP '.$langs->trans(
"LDAPNamingAttribute").
'</td><td class="valeur">'.$conf->global->LDAP_KEY_MEMBERS_TYPES.
"</td></tr>\n";
109 print
'<tr><td>LDAP '.$langs->trans(
"Type").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_TYPE.
"</td></tr>\n";
110 print
'<tr><td>LDAP '.$langs->trans(
"Version").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_PROTOCOLVERSION.
"</td></tr>\n";
111 print
'<tr><td>LDAP '.$langs->trans(
"LDAPPrimaryServer").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_HOST.
"</td></tr>\n";
112 print
'<tr><td>LDAP '.$langs->trans(
"LDAPSecondaryServer").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_HOST_SLAVE.
"</td></tr>\n";
113 print
'<tr><td>LDAP '.$langs->trans(
"LDAPServerPort").
'</td><td class="valeur">'.$conf->global->LDAP_SERVER_PORT.
"</td></tr>\n";
125 print
'<div class="tabsAction">';
128 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=dolibarr2ldap">'.$langs->trans(
"ForceSynchronize").
'</a>';
142 print
'<table width="100%" class="noborder">';
144 print
'<tr class="liste_titre">';
145 print
'<td>'.$langs->trans(
"LDAPAttributes").
'</td>';
146 print
'<td>'.$langs->trans(
"Value").
'</td>';
151 $result = $ldap->connect_bind();
153 $info = $object->_load_ldap_info();
154 $dn = $object->_load_ldap_dn($info, 1);
155 $search =
"(".$object->_load_ldap_dn($info, 2).
")";
157 $records = $ldap->getAttribute($dn, $search);
162 if (((!is_numeric($records)) || $records != 0) && (!isset($records[
'count']) || $records[
'count'] > 0)) {
163 if (!is_array($records)) {
164 print
'<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans(
"ErrorFailedToReadLDAP").
'</span></td></tr>';
Class to manage LDAP features.
Class to manage members type.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
restrictedArea($user, $features, $objectid=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.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
member_type_prepare_head(AdherentType $object)
Return array head with list of tabs to view object informations.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
const SYNCHRO_DOLIBARR_TO_LDAP
Dolibarr to Ldap synchronization.
show_ldap_content($result, $level, $count, $var, $hide=0, $subcount=0)
Show a LDAP array into an HTML output array.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.