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';
43$langs->loadLangs(array(
'companies',
'ldap',
'users',
'admin'));
46$action =
GETPOST(
'action',
'aZ09');
49if ($user->socid > 0) {
50 $socid = $user->socid;
62$permissiontoread =
true;
64 $permissiontoread = (!empty($user->admin) || $user->hasRight(
'user',
'group_advance',
'read'));
72if ($action ==
'dolibarr2ldap') {
74 $result = $ldap->connectBind();
77 $info =
$object->_load_ldap_info();
80 if (empty($info[
getDolGlobalString(
'LDAP_GROUP_FIELD_GROUPID')]) && in_array(
'posixGroup', $info[
'objectclass'])) {
81 $info[
'gidNumber'] = $ldap->getNextGroupGid(
'LDAP_KEY_GROUPS');
84 $dn =
$object->_load_ldap_dn($info);
87 $result = $ldap->update($dn, $info, $user, $olddn);
102$form =
new Form($db);
104$title =
$object->name.
" - ".$langs->trans(
'LDAP');
106llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-user page-group_ldap');
112$linkback =
'<a href="'.DOL_URL_ROOT.
'/user/group/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
114dol_banner_tab($object,
'id', $linkback, ($user->hasRight(
'user',
'user',
'lire') || !empty($user->admin)));
116print
'<div class="fichecenter">';
117print
'<div class="underbanner clearboth"></div>';
119print
'<table class="border centpercent tableforfield">';
122if (isModEnabled(
'multicompany')) {
123 print
'<tr><td class="titlefield">'.$langs->trans(
"Name").
'</td>';
124 print
'<td class="valeur">'.$object->name;
126 print
img_picto($langs->trans(
"GlobalGroup"),
'redstar');
128 print
"</td></tr>\n";
132print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
133print
'<td class="valeur sensiblehtmlcontent">';
139print
'<tr><td>LDAP '.$langs->trans(
"LDAPGroupDn").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_GROUP_DN').
"</td></tr>\n";
142print
'<tr><td>LDAP '.$langs->trans(
"LDAPNamingAttribute").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_KEY_GROUPS').
"</td></tr>\n";
145print
'<tr><td>LDAP '.$langs->trans(
"LDAPPrimaryServer").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_HOST').
"</td></tr>\n";
146print
'<tr><td>LDAP '.$langs->trans(
"LDAPSecondaryServer").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_HOST_SLAVE').
"</td></tr>\n";
147print
'<tr><td>LDAP '.$langs->trans(
"LDAPServerPort").
'</td><td class="valeur">'.
getDolGlobalString(
'LDAP_SERVER_PORT').
"</td></tr>\n";
159print
'<div class="tabsAction">';
161if (
getDolGlobalInt(
'LDAP_SYNCHRO_ACTIVE') === Ldap::SYNCHRO_DOLIBARR_TO_LDAP) {
162 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=dolibarr2ldap">'.$langs->trans(
"ForceSynchronize").
'</a>';
167if (
getDolGlobalInt(
'LDAP_SYNCHRO_ACTIVE') === Ldap::SYNCHRO_DOLIBARR_TO_LDAP) {
176print
'<table class="noborder centpercent">';
178print
'<tr class="liste_titre">';
179print
'<td>'.$langs->trans(
"LDAPAttributes").
'</td>';
180print
'<td>'.$langs->trans(
"Value").
'</td>';
185$result = $ldap->connectBind();
187 $info =
$object->_load_ldap_info();
188 $dn =
$object->_load_ldap_dn($info, 1);
189 $search =
"(".$object->_load_ldap_dn($info, 2).
")";
191 $records = $ldap->getAttribute($dn, $search);
196 if (((!is_numeric($records)) || $records != 0) && (!isset($records[
'count']) || $records[
'count'] > 0)) {
197 if (!is_array($records)) {
198 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 user groups.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0, $allowscript=0, $allowstyle=0)
Clean a string to keep only desirable HTML tags.
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.
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 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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.