27require
'../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/ldap.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/ldap.lib.php';
35$langs->loadLangs(array(
'companies',
'ldap',
'users',
'admin'));
38$action =
GETPOST(
'action',
'aZ09');
41if ($user->socid > 0) {
42 $socid = $user->socid;
46$object->fetch($id,
'',
true);
50if (isModEnabled(
'multicompany') && $conf->entity > 1 && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
55if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
56 $canreadperms = (!empty($user->admin) || !empty($user->rights->user->group_advance->read));
64if ($action ==
'dolibarr2ldap') {
66 $result = $ldap->connect_bind();
69 $info = $object->_load_ldap_info();
72 if (empty($info[
getDolGlobalString(
'LDAP_GROUP_FIELD_GROUPID')]) && in_array(
'posixGroup', $info[
'objectclass'])) {
73 $info[
'gidNumber'] = $ldap->getNextGroupGid(
'LDAP_KEY_GROUPS');
76 $dn = $object->_load_ldap_dn($info);
79 $result = $ldap->update($dn, $info, $user, $olddn);
96$title = $object->name.
" - ".$langs->trans(
'LDAP');
104$linkback =
'<a href="'.DOL_URL_ROOT.
'/user/group/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
106dol_banner_tab($object,
'id', $linkback, (!empty($user->rights->user->user->lire) || !empty($user->admin)));
108print
'<div class="fichecenter">';
109print
'<div class="underbanner clearboth"></div>';
111print
'<table class="border centpercent tableforfield">';
114if (!empty($conf->mutlicompany->enabled)) {
115 print
'<tr><td class="titlefield">'.$langs->trans(
"Name").
'</td>';
116 print
'<td class="valeur">'.$object->name;
117 if (!$object->entity) {
118 print
img_picto($langs->trans(
"GlobalGroup"),
'redstar');
120 print
"</td></tr>\n";
124print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
125print
'<td class="valeur sensiblehtmlcontent">';
131print
'<tr><td>LDAP '.$langs->trans(
"LDAPGroupDn").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_GROUP_DN').
"</td></tr>\n";
134print
'<tr><td>LDAP '.$langs->trans(
"LDAPNamingAttribute").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_KEY_GROUPS').
"</td></tr>\n";
137print
'<tr><td>LDAP '.$langs->trans(
"LDAPPrimaryServer").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_HOST').
"</td></tr>\n";
138print
'<tr><td>LDAP '.$langs->trans(
"LDAPSecondaryServer").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_HOST_SLAVE').
"</td></tr>\n";
139print
'<tr><td>LDAP '.$langs->trans(
"LDAPServerPort").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_PORT').
"</td></tr>\n";
151print
'<div class="tabsAction">';
154 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=dolibarr2ldap">'.$langs->trans(
"ForceSynchronize").
'</a>';
168print
'<table class="noborder centpercent">';
170print
'<tr class="liste_titre">';
171print
'<td>'.$langs->trans(
"LDAPAttributes").
'</td>';
172print
'<td>'.$langs->trans(
"Value").
'</td>';
177$result = $ldap->connect_bind();
179 $info = $object->_load_ldap_info();
180 $dn = $object->_load_ldap_dn($info, 1);
181 $search =
"(".$object->_load_ldap_dn($info, 2).
")";
183 $records = $ldap->getAttribute($dn, $search);
188 if (((!is_numeric($records)) || $records != 0) && (!isset($records[
'count']) || $records[
'count'] > 0)) {
189 if (!is_array($records)) {
190 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 LDAP features.
const SYNCHRO_DOLIBARR_TO_LDAP
Dolibarr to Ldap synchronization.
Class to manage user groups.
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.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0)
Clean a string to keep only desirable HTML tags.
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.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
group_prepare_head($object)
Prepare array with list of tabs.