27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/contact.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/ldap.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/ldap.lib.php';
34$langs->loadLangs(array(
'companies',
'ldap'));
37$action =
GETPOST(
'action',
'aZ09');
42 $socid = $user->socid;
44$result =
restrictedArea($user,
'contact', $id,
'socpeople&societe');
56if ($action ==
'dolibarr2ldap') {
60 $result = $ldap->connectBind();
62 $info =
$object->_load_ldap_info();
63 $dn =
$object->_load_ldap_dn($info);
66 $result = $ldap->update($dn, $info, $user, $olddn);
84$title = (
getDolGlobalString(
'SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses"));
85$help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas';
87llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-societe page-contact-card_ldap');
93$linkback =
'<a href="'.DOL_URL_ROOT.
'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
95dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref',
'');
97print
'<div class="fichecenter">';
99print
'<div class="underbanner clearboth"></div>';
100print
'<table class="border centpercent">';
104 $thirdparty =
new Societe($db);
105 $thirdparty->fetch(
$object->socid);
107 print
'<tr><td class="titlefield">'.$langs->trans(
"ThirdParty").
'</td><td colspan="3">'.$thirdparty->getNomUrl(1).
'</td></tr>';
109 print
'<tr><td class="titlefield">'.$langs->trans(
"ThirdParty").
'</td><td colspan="3">';
110 print $langs->trans(
"ContactNotLinkedToCompany");
115print
'<tr><td class="titlefield">'.$langs->trans(
"UserTitle").
'</td><td colspan="3">';
116print
$object->getCivilityLabel();
120print
'<tr><td>LDAP '.$langs->trans(
"LDAPContactDn").
'</td><td class="valeur" colspan="3">'.
getDolGlobalString(
'LDAP_CONTACT_DN').
"</td></tr>\n";
123print
'<tr><td>LDAP '.$langs->trans(
"LDAPNamingAttribute").
'</td><td class="valeur" colspan="3">'.
getDolGlobalString(
'LDAP_KEY_CONTACTS').
"</td></tr>\n";
126print
'<tr><td>LDAP '.$langs->trans(
"LDAPPrimaryServer").
'</td><td class="valeur" colspan="3">'.
getDolGlobalString(
'LDAP_SERVER_HOST').
"</td></tr>\n";
127print
'<tr><td>LDAP '.$langs->trans(
"LDAPSecondaryServer").
'</td><td class="valeur" colspan="3">'.
getDolGlobalString(
'LDAP_SERVER_HOST_SLAVE').
"</td></tr>\n";
128print
'<tr><td>LDAP '.$langs->trans(
"LDAPServerPort").
'</td><td class="valeur" colspan="3">'.
getDolGlobalString(
'LDAP_SERVER_PORT').
"</td></tr>\n";
140print
'<div class="tabsAction">';
143 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=dolibarr2ldap">'.$langs->trans(
"ForceSynchronize").
'</a>';
157print
'<table width="100%" class="noborder">';
159print
'<tr class="liste_titre">';
160print
'<td>'.$langs->trans(
"LDAPAttributes").
'</td>';
161print
'<td>'.$langs->trans(
"Value").
'</td>';
166$result = $ldap->connectBind();
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)) {
178 if (!is_array($records)) {
179 print
'<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans(
"ErrorFailedToReadLDAP").
'</span></td></tr>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage LDAP features.
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a 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.
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.