25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/contact.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/ldap.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ldap.lib.php';
32 $langs->loadLangs(array(
'companies',
'ldap'));
33 $langs->load(
"admin");
35 $action =
GETPOST(
'action',
'aZ09');
39 if ($user->socid) $socid = $user->socid;
40 $result =
restrictedArea($user,
'contact', $id,
'socpeople&societe');
45 $object->fetch($id, $user);
53 if ($action ==
'dolibarr2ldap')
58 $result = $ldap->connect_bind();
60 $info = $object->_load_ldap_info();
61 $dn = $object->_load_ldap_dn($info);
64 $result = $ldap->update($dn, $info, $user, $olddn);
81 $form =
new Form($db);
83 $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses"));
85 llxHeader(
'', $title,
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
91 $linkback =
'<a href="'.DOL_URL_ROOT.
'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
95 print '<div class="fichecenter">';
97 print '<div class="underbanner clearboth"></div>';
98 print '<table class="border centpercent">';
101 if ($object->socid > 0)
103 $thirdparty =
new Societe($db);
104 $thirdparty->fetch($object->socid);
106 print '<tr><td class="titlefield">'.$langs->trans(
"ThirdParty").
'</td><td colspan="3">'.$thirdparty->getNomUrl(1).
'</td></tr>';
108 print '<tr><td class="titlefield">'.$langs->trans(
"ThirdParty").
'</td><td colspan="3">';
109 print $langs->trans(
"ContactNotLinkedToCompany");
114 print '<tr><td class="titlefield">'.$langs->trans(
"UserTitle").
'</td><td colspan="3">';
115 print $object->getCivilityLabel();
119 print '<tr><td>LDAP '.$langs->trans(
"LDAPContactDn").
'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_CONTACT_DN.
"</td></tr>\n";
122 print '<tr><td>LDAP '.$langs->trans(
"LDAPNamingAttribute").
'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_KEY_CONTACTS.
"</td></tr>\n";
125 print '<tr><td>LDAP '.$langs->trans(
"LDAPPrimaryServer").
'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_HOST.
"</td></tr>\n";
126 print '<tr><td>LDAP '.$langs->trans(
"LDAPSecondaryServer").
'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_HOST_SLAVE.
"</td></tr>\n";
127 print '<tr><td>LDAP '.$langs->trans(
"LDAPServerPort").
'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_PORT.
"</td></tr>\n";
140 print '<div class="tabsAction">';
142 if (!empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE !=
'ldap2dolibarr')
144 print '<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=dolibarr2ldap">'.$langs->trans(
"ForceSynchronize").
'</a>';
149 if (!empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE !=
'ldap2dolibarr')
print "<br>\n";
156 print '<table width="100%" class="noborder">';
158 print
'<tr class="liste_titre">';
159 print
'<td>'.$langs->trans(
"LDAPAttributes").
'</td>';
160 print
'<td>'.$langs->trans(
"Value").
'</td>';
165 $result = $ldap->connect_bind();
168 $info = $object->_load_ldap_info();
169 $dn = $object->_load_ldap_dn($info, 1);
170 $search =
"(".$object->_load_ldap_dn($info, 2).
")";
172 $records = $ldap->getAttribute($dn, $search);
177 if (((!is_numeric($records)) || $records != 0) && (!isset($records[
'count']) || $records[
'count'] > 0))
179 if (!is_array($records))
181 print
'<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans(
"ErrorFailedToReadLDAP").
'</font></td></tr>';
186 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.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage third parties objects (customers, suppliers, prospects...)
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.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
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_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.