Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
abb5047979
@ -245,6 +245,7 @@ print '</form>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@ -49,7 +49,7 @@ if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$error=0;
|
||||
$db->begin();
|
||||
|
||||
|
||||
if (! dolibarr_set_const($db, 'LDAP_USER_DN',GETPOST("user"),'chaine',0,'',$conf->entity)) $error++;
|
||||
if (! dolibarr_set_const($db, 'LDAP_USER_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++;
|
||||
if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION',GETPOST("filterconnection"),'chaine',0,'',$conf->entity)) $error++;
|
||||
@ -249,7 +249,7 @@ print '</tr>';
|
||||
|
||||
// Description
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldDescription").'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Note").'</td><td>';
|
||||
print '<input size="25" type="text" name="fielddescription" value="'.$conf->global->LDAP_FIELD_DESCRIPTION.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
|
||||
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_DESCRIPTION"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_DESCRIPTION)?' checked="checked"':'')."></td>";
|
||||
@ -287,10 +287,19 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
|
||||
show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass);
|
||||
}
|
||||
elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr')
|
||||
{
|
||||
$butlabel=$langs->trans("LDAPTestSearch");
|
||||
$testlabel='testsearchuser';
|
||||
$key=$conf->global->LDAP_KEY_USERS;
|
||||
$dn=$conf->global->LDAP_USER_DN;
|
||||
$objectclass=$conf->global->LDAP_USER_OBJECT_CLASS;
|
||||
show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass);
|
||||
}
|
||||
|
||||
if (function_exists("ldap_connect"))
|
||||
{
|
||||
if ($_GET["action"] == 'testuser')
|
||||
if ($action == 'testuser')
|
||||
{
|
||||
// Creation objet
|
||||
$object=new User($db);
|
||||
@ -339,6 +348,84 @@ if (function_exists("ldap_connect"))
|
||||
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'testsearchuser')
|
||||
{
|
||||
// Creation objet
|
||||
$object=new User($db);
|
||||
$object->initAsSpecimen();
|
||||
|
||||
// TODO Mutualize code following with other ldap_xxxx.php pages
|
||||
|
||||
// Test synchro
|
||||
$ldap=new Ldap();
|
||||
$result=$ldap->connect_bind();
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$required_fields = array(
|
||||
$conf->global->LDAP_KEY_USERS,
|
||||
$conf->global->LDAP_FIELD_FULLNAME,
|
||||
$conf->global->LDAP_FIELD_NAME,
|
||||
$conf->global->LDAP_FIELD_FIRSTNAME,
|
||||
$conf->global->LDAP_FIELD_LOGIN,
|
||||
$conf->global->LDAP_FIELD_LOGIN_SAMBA,
|
||||
$conf->global->LDAP_FIELD_PASSWORD,
|
||||
$conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
|
||||
$conf->global->LDAP_FIELD_PHONE,
|
||||
$conf->global->LDAP_FIELD_FAX,
|
||||
$conf->global->LDAP_FIELD_MOBILE,
|
||||
$conf->global->LDAP_FIELD_MAIL,
|
||||
$conf->global->LDAP_FIELD_SID);
|
||||
|
||||
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
||||
$required_fields=array_unique(array_values(array_filter($required_fields, "dol_validElement")));
|
||||
|
||||
// Get from LDAP database an array of results
|
||||
$ldapusers = $ldap->getRecords('*', $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, $required_fields, 1);
|
||||
//$ldapusers = $ldap->getRecords('*', $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, '', 1);
|
||||
|
||||
if (is_array($ldapusers))
|
||||
{
|
||||
$liste=array();
|
||||
foreach ($ldapusers as $key => $ldapuser)
|
||||
{
|
||||
// Define the label string for this user
|
||||
$label='';
|
||||
foreach ($required_fields as $value)
|
||||
{
|
||||
if ($value)
|
||||
{
|
||||
$label.=$value."=".$ldapuser[$value]." ";
|
||||
}
|
||||
}
|
||||
$liste[$key] = $label;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$ldap->error.'</div>';
|
||||
}
|
||||
|
||||
print "<br>\n";
|
||||
print "LDAP search for user:<br>\n";
|
||||
print "search: *<br>\n";
|
||||
print "userDN: ".$conf->global->LDAP_USER_DN."<br>\n";
|
||||
print "useridentifier: ".$conf->global->LDAP_KEY_USERS."<br>\n";
|
||||
print "required_fields: ".join(',',$required_fields)."<br>\n";
|
||||
print "=> ".count($liste)." records<br>\n";
|
||||
print "\n<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto('','error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
@ -169,7 +169,7 @@ class Ldap
|
||||
if ($this->serverType == "activedirectory")
|
||||
{
|
||||
$result=$this->setReferrals();
|
||||
dol_syslog("Ldap::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser,LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser,LOG_DEBUG);
|
||||
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
|
||||
if ($this->result)
|
||||
{
|
||||
@ -187,7 +187,7 @@ class Ldap
|
||||
// Try in auth mode
|
||||
if ($this->searchUser && $this->searchPassword)
|
||||
{
|
||||
dol_syslog("Ldap::connect_bind try bindauth on ".$host." user=".$this->searchUser,LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser,LOG_DEBUG);
|
||||
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
|
||||
if ($this->result)
|
||||
{
|
||||
@ -203,7 +203,7 @@ class Ldap
|
||||
// Try in anonymous
|
||||
if (! $this->bind)
|
||||
{
|
||||
dol_syslog("Ldap::connect_bind try bind on ".$host,LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::connect_bind try bind on ".$host,LOG_DEBUG);
|
||||
$result=$this->bind();
|
||||
if ($result)
|
||||
{
|
||||
@ -225,13 +225,13 @@ class Ldap
|
||||
if ($connected)
|
||||
{
|
||||
$return=$connected;
|
||||
dol_syslog("Ldap::connect_bind return=".$return, LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::connect_bind return=".$return, LOG_DEBUG);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error='Failed to connect to LDAP'.($this->error?': '.$this->error:'');
|
||||
$return=-1;
|
||||
dol_syslog("Ldap::connect_bind return=".$return.' - '.$this->error, LOG_WARNING);
|
||||
dol_syslog(get_class($this)."::connect_bind return=".$return.' - '.$this->error, LOG_WARNING);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@ -419,7 +419,7 @@ class Ldap
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog("Ldap::modify dn=".$dn." info=".join(',',$info));
|
||||
dol_syslog(get_class($this)."::modify dn=".$dn." info=".join(',',$info));
|
||||
|
||||
// Check parameters
|
||||
if (! $this->connection)
|
||||
@ -447,13 +447,13 @@ class Ldap
|
||||
|
||||
if ($result)
|
||||
{
|
||||
dol_syslog("Ldap::modify successfull", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::modify successfull", LOG_DEBUG);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=@ldap_error($this->connection);
|
||||
dol_syslog("Ldap::modify failed: ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::modify failed: ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -472,7 +472,7 @@ class Ldap
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog("Ldap::update dn=".$dn." olddn=".$olddn);
|
||||
dol_syslog(get_class($this)."::update dn=".$dn." olddn=".$olddn);
|
||||
|
||||
// Check parameters
|
||||
if (! $this->connection)
|
||||
@ -501,13 +501,13 @@ class Ldap
|
||||
if ($result <= 0)
|
||||
{
|
||||
$this->error = ldap_errno($this->connection)." ".ldap_error($this->connection)." ".$this->error;
|
||||
dol_syslog("Ldap::update ".$this->error,LOG_ERR);
|
||||
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
|
||||
//print_r($info);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Ldap::update done successfully");
|
||||
dol_syslog(get_class($this)."::update done successfully");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -524,7 +524,7 @@ class Ldap
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog("Ldap::delete Delete LDAP entry dn=".$dn);
|
||||
dol_syslog(get_class($this)."::delete Delete LDAP entry dn=".$dn);
|
||||
|
||||
// Check parameters
|
||||
if (! $this->connection)
|
||||
@ -638,7 +638,7 @@ class Ldap
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog("Ldap::addAttribute dn=".$dn." info=".join(',',$info));
|
||||
dol_syslog(get_class($this)."::addAttribute dn=".$dn." info=".join(',',$info));
|
||||
|
||||
// Check parameters
|
||||
if (! $this->connection)
|
||||
@ -666,13 +666,13 @@ class Ldap
|
||||
|
||||
if ($result)
|
||||
{
|
||||
dol_syslog("Ldap::add_attribute successfull", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::add_attribute successfull", LOG_DEBUG);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=@ldap_error($this->connection);
|
||||
dol_syslog("Ldap::add_attribute failed: ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::add_attribute failed: ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -690,7 +690,7 @@ class Ldap
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog("Ldap::updateAttribute dn=".$dn." info=".join(',',$info));
|
||||
dol_syslog(get_class($this)."::updateAttribute dn=".$dn." info=".join(',',$info));
|
||||
|
||||
// Check parameters
|
||||
if (! $this->connection)
|
||||
@ -718,13 +718,13 @@ class Ldap
|
||||
|
||||
if ($result)
|
||||
{
|
||||
dol_syslog("Ldap::updateAttribute successfull", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::updateAttribute successfull", LOG_DEBUG);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=@ldap_error($this->connection);
|
||||
dol_syslog("Ldap::updateAttribute failed: ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::updateAttribute failed: ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -742,7 +742,7 @@ class Ldap
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog("Ldap::deleteAttribute dn=".$dn." info=".join(',',$info));
|
||||
dol_syslog(get_class($this)."::deleteAttribute dn=".$dn." info=".join(',',$info));
|
||||
|
||||
// Check parameters
|
||||
if (! $this->connection)
|
||||
@ -770,13 +770,13 @@ class Ldap
|
||||
|
||||
if ($result)
|
||||
{
|
||||
dol_syslog("Ldap::deleteAttribute successfull", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::deleteAttribute successfull", LOG_DEBUG);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=@ldap_error($this->connection);
|
||||
dol_syslog("Ldap::deleteAttribute failed: ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::deleteAttribute failed: ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -872,21 +872,21 @@ class Ldap
|
||||
* @param string $search Valeur champ cle recherche, sinon '*' pour tous.
|
||||
* @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org)
|
||||
* @param string $useridentifier Name of key field (Ex: uid)
|
||||
* @param array $attributeArray Array of fields required (Ex: sn,userPassword)
|
||||
* @param int $activefilter 1=utilise le champ this->filter comme filtre
|
||||
* @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword)
|
||||
* @param int $activefilter 1=use field this->filter as filter instead of parameter $search
|
||||
* @return array Array of [id_record][ldap_field]=value
|
||||
*/
|
||||
function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0)
|
||||
{
|
||||
$fulllist=array();
|
||||
|
||||
dol_syslog("Ldap::getRecords search=".$search." userDn=".$userDn." useridentifier=".$useridentifier." attributeArray=array(".join(',',$attributeArray).")");
|
||||
dol_syslog(get_class($this)."::getRecords search=".$search." userDn=".$userDn." useridentifier=".$useridentifier." attributeArray=array(".join(',',$attributeArray).")");
|
||||
|
||||
// if the directory is AD, then bind first with the search user first
|
||||
if ($this->serverType == "activedirectory")
|
||||
{
|
||||
$this->bindauth($this->searchUser, $this->searchPassword);
|
||||
dol_syslog("Ldap::bindauth serverType=activedirectory searchUser=".$this->searchUser);
|
||||
dol_syslog(get_class($this)."::bindauth serverType=activedirectory searchUser=".$this->searchUser);
|
||||
}
|
||||
|
||||
// Define filter
|
||||
@ -909,13 +909,15 @@ class Ldap
|
||||
if (is_array($attributeArray))
|
||||
{
|
||||
// Return list with required fields
|
||||
dol_syslog("Ldap::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter. " attributeArray=(".join(',',$attributeArray).")");
|
||||
$attributeArray=array_values($attributeArray); // This is to force to have index reordered from 0 (not make ldap_search fails)
|
||||
dol_syslog(get_class($this)."::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter. " attributeArray=(".join(',',$attributeArray).")");
|
||||
//var_dump($attributeArray);
|
||||
$this->result = @ldap_search($this->connection, $userDn, $filter, $attributeArray);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Return list with fields selected by default
|
||||
dol_syslog("Ldap::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter);
|
||||
dol_syslog(get_class($this)."::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter);
|
||||
$this->result = @ldap_search($this->connection, $userDn, $filter);
|
||||
}
|
||||
if (!$this->result)
|
||||
@ -1073,7 +1075,7 @@ class Ldap
|
||||
*/
|
||||
function search($checkDn, $filter)
|
||||
{
|
||||
dol_syslog("Ldap::search checkDn=".$checkDn." filter=".$filter);
|
||||
dol_syslog(get_class($this)."::search checkDn=".$checkDn." filter=".$filter);
|
||||
|
||||
$checkDn=$this->convFromOutputCharset($checkDn,$this->ldapcharset);
|
||||
$filter=$this->convFromOutputCharset($filter,$this->ldapcharset);
|
||||
@ -1122,7 +1124,7 @@ class Ldap
|
||||
$i=0;
|
||||
while ($i <= 2)
|
||||
{
|
||||
dol_syslog("Ldap::fetch search with searchDN=".$searchDN." filter=".$filter);
|
||||
dol_syslog(get_class($this)."::fetch search with searchDN=".$searchDN." filter=".$filter);
|
||||
$this->result = @ldap_search($this->connection, $searchDN, $filter);
|
||||
if ($this->result)
|
||||
{
|
||||
@ -1134,7 +1136,7 @@ class Ldap
|
||||
else
|
||||
{
|
||||
$this->error = ldap_errno($this->connection)." ".ldap_error($this->connection);
|
||||
dol_syslog("Ldap::fetch search fails");
|
||||
dol_syslog(get_class($this)."::fetch search fails");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -487,12 +487,12 @@ LDAPServerUseTLS=Use TLS
|
||||
LDAPServerUseTLSExample=Your LDAP server use TLS
|
||||
LDAPServerDn=Server DN
|
||||
LDAPAdminDn=Administrator DN
|
||||
LDAPAdminDnExample=Complete DN (ex: cn=adminldap,dc=society,dc=com)
|
||||
LDAPAdminDnExample=Complete DN (ex: cn=admin,dc=example,dc=com)
|
||||
LDAPPassword=Administrator password
|
||||
LDAPUserDn=Users' DN
|
||||
LDAPUserDnExample=Complete DN (ex: ou=users,dc=society,dc=com)
|
||||
LDAPUserDnExample=Complete DN (ex: ou=users,dc=example,dc=com)
|
||||
LDAPGroupDn=Groups' DN
|
||||
LDAPGroupDnExample=Complete DN (ex: ou=groups,dc=society,dc=com)
|
||||
LDAPGroupDnExample=Complete DN (ex: ou=groups,dc=example,dc=com)
|
||||
LDAPServerExample=Server address (ex: localhost, 192.168.0.2, ldaps://ldap.example.com/)
|
||||
LDAPServerDnExample=Complete DN (ex: dc=company,dc=com)
|
||||
LDAPPasswordExample=Admin password
|
||||
@ -504,9 +504,9 @@ LDAPDnContactActiveExample=Activated/Unactivated synchronization
|
||||
LDAPDnMemberActive=Members' synchronization
|
||||
LDAPDnMemberActiveExample=Activated/Unactivated synchronization
|
||||
LDAPContactDn=Dolibarr contacts' DN
|
||||
LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=society,dc=com)
|
||||
LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=example,dc=com)
|
||||
LDAPMemberDn=Dolibarr member's DN
|
||||
LDAPMemberDnExample=Complete DN (ex: ou=members,dc=society,dc=com)
|
||||
LDAPMemberDnExample=Complete DN (ex: ou=members,dc=example,dc=com)
|
||||
LDAPMemberObjectClassList=List of objectClass
|
||||
LDAPMemberObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory)
|
||||
LDAPUserObjectClassList=List of objectClass
|
||||
@ -516,7 +516,7 @@ LDAPGroupObjectClassListExample=List of objectClass defining record attributes (
|
||||
LDAPContactObjectClassList=List of objectClass
|
||||
LDAPContactObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory)
|
||||
LDAPMemberTypeDn=Dolibarr member's type DN
|
||||
LDAPMemberTypeDnExample=Complete DN (ex: ou=type_members,dc=society,dc=com)
|
||||
LDAPMemberTypeDnExample=Complete DN (ex: ou=type_members,dc=example,dc=com)
|
||||
LDAPTestConnect=Test LDAP connection
|
||||
LDAPTestSynchroContact=Test contact's synchronization
|
||||
LDAPTestSynchroUser=Test user's synchronization
|
||||
@ -550,7 +550,7 @@ LDAPFieldCommonNameExample=Example : cn
|
||||
LDAPFieldName=Name
|
||||
LDAPFieldNameExample=Example : sn
|
||||
LDAPFieldFirstName=First name
|
||||
LDAPFieldFirstNameExample=Example : givenname
|
||||
LDAPFieldFirstNameExample=Example : givenName
|
||||
LDAPFieldMail=Email address
|
||||
LDAPFieldMailExample=Example : mail
|
||||
LDAPFieldPhone=Professional phone number
|
||||
|
||||
@ -1049,14 +1049,14 @@ LDAPServerUseTLS=Use TLS
|
||||
LDAPServerUseTLSExample=Your LDAP server use TLS
|
||||
LDAPServerDn=Server DN
|
||||
LDAPAdminDn=Administrator DN
|
||||
LDAPAdminDnExample=Complete DN (ex: cn=adminldap,dc=society,dc=com)
|
||||
LDAPAdminDnExample=Complete DN (ex: cn=admin,dc=example,dc=com)
|
||||
LDAPPassword=Administrator password
|
||||
LDAPUserDn=Users' DN
|
||||
LDAPUserDnExample=Complete DN (ex: ou=users,dc=society,dc=com)
|
||||
LDAPUserDnExample=Complete DN (ex: ou=users,dc=example,dc=com)
|
||||
LDAPGroupDn=Groups' DN
|
||||
LDAPGroupDnExample=Complete DN (ex: ou=groups,dc=society,dc=com)
|
||||
LDAPGroupDnExample=Complete DN (ex: ou=groups,dc=example,dc=com)
|
||||
LDAPServerExample=Server address (ex: localhost, 192.168.0.2, ldaps://ldap.example.com/)
|
||||
LDAPServerDnExample=Complete DN (ex: dc=company,dc=com)
|
||||
LDAPServerDnExample=Complete DN (ex: dc=example,dc=com)
|
||||
LDAPPasswordExample=Admin password
|
||||
LDAPDnSynchroActive=Users and groups synchronization
|
||||
LDAPDnSynchroActiveExample=LDAP to Dolibarr or Dolibarr to LDAP synchronization
|
||||
@ -1066,9 +1066,9 @@ LDAPDnContactActiveExample=Activated/Unactivated synchronization
|
||||
LDAPDnMemberActive=Members' synchronization
|
||||
LDAPDnMemberActiveExample=Activated/Unactivated synchronization
|
||||
LDAPContactDn=Dolibarr contacts' DN
|
||||
LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=society,dc=com)
|
||||
LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=example,dc=com)
|
||||
LDAPMemberDn=Dolibarr members DN
|
||||
LDAPMemberDnExample=Complete DN (ex: ou=members,dc=society,dc=com)
|
||||
LDAPMemberDnExample=Complete DN (ex: ou=members,dc=example,dc=com)
|
||||
LDAPMemberObjectClassList=List of objectClass
|
||||
LDAPMemberObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory)
|
||||
LDAPUserObjectClassList=List of objectClass
|
||||
@ -1078,12 +1078,13 @@ LDAPGroupObjectClassListExample=List of objectClass defining record attributes (
|
||||
LDAPContactObjectClassList=List of objectClass
|
||||
LDAPContactObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory)
|
||||
LDAPMemberTypeDn=Dolibarr members type DN
|
||||
LDAPMemberTypeDnExample=Complete DN (ex: ou=type_members,dc=society,dc=com)
|
||||
LDAPMemberTypeDnExample=Complete DN (ex: ou=type_members,dc=example,dc=com)
|
||||
LDAPTestConnect=Test LDAP connection
|
||||
LDAPTestSynchroContact=Test contacts synchronization
|
||||
LDAPTestSynchroUser=Test user synchronization
|
||||
LDAPTestSynchroGroup=Test group synchronization
|
||||
LDAPTestSynchroMember=Test member synchronization
|
||||
LDAPTestSearch= Test a LDAP search
|
||||
LDAPSynchroOK=Synchronization test successful
|
||||
LDAPSynchroKO=Failed synchronization test
|
||||
LDAPSynchroKOMayBePermissions=Failed synchronization test. Check that connexion to server is correctly configured and allows LDAP udpates
|
||||
@ -1093,8 +1094,8 @@ LDAPBindOK=Connect/Authentificate to LDAP server sucessfull (Server=%s, Port=%s,
|
||||
LDAPBindKO=Connect/Authentificate to LDAP server failed (Server=%s, Port=%s, Admin=%s, Password=%s)
|
||||
LDAPUnbindSuccessfull=Disconnect successfull
|
||||
LDAPUnbindFailed=Disconnect failed
|
||||
LDAPConnectToDNSuccessfull=Connection au DN (%s) r�ussie
|
||||
LDAPConnectToDNFailed=Connection au DN (%s) �chou�e
|
||||
LDAPConnectToDNSuccessfull=Connection to DN (%s) successful
|
||||
LDAPConnectToDNFailed=Connection to DN (%s) failed
|
||||
LDAPSetupForVersion3=LDAP server configured for version 3
|
||||
LDAPSetupForVersion2=LDAP server configured for version 2
|
||||
LDAPDolibarrMapping=Dolibarr Mapping
|
||||
@ -1105,7 +1106,7 @@ LDAPFilterConnection=Search filter
|
||||
LDAPFilterConnectionExample=Example : &(objectClass=inetOrgPerson)
|
||||
LDAPFieldLoginSamba=Login (samba, activedirectory)
|
||||
LDAPFieldLoginSambaExample=Example : samaccountname
|
||||
LDAPFieldFullname=First name
|
||||
LDAPFieldFullname=Full name
|
||||
LDAPFieldFullnameExample=Example : cn
|
||||
LDAPFieldPassword=Password
|
||||
LDAPFieldPasswordNotCrypted=Password not crypted
|
||||
@ -1116,7 +1117,7 @@ LDAPFieldCommonNameExample=Example : cn
|
||||
LDAPFieldName=Name
|
||||
LDAPFieldNameExample=Example : sn
|
||||
LDAPFieldFirstName=First name
|
||||
LDAPFieldFirstNameExample=Example : givenname
|
||||
LDAPFieldFirstNameExample=Example : givenName
|
||||
LDAPFieldMail=Email address
|
||||
LDAPFieldMailExample=Example : mail
|
||||
LDAPFieldPhone=Professional phone number
|
||||
|
||||
@ -1091,6 +1091,7 @@ LDAPTestSynchroContact= Tester synchronisation contacts
|
||||
LDAPTestSynchroUser= Tester synchronisation utilisateur
|
||||
LDAPTestSynchroGroup= Tester synchronisation groupe
|
||||
LDAPTestSynchroMember= Tester synchronisation adhérent
|
||||
LDAPTestSearch= Tester une recherche LDAP
|
||||
LDAPSynchroOK= Test de synchronisation réalisé avec succès
|
||||
LDAPSynchroKO= Échec du test de synchronisation
|
||||
LDAPSynchroKOMayBePermissions= Echec du test de synchronisation. Vérifier que la connexion au serveur est correctement configurée et permet les mises à jour LDAP
|
||||
@ -1123,7 +1124,7 @@ LDAPFieldCommonNameExample= Exemple : cn
|
||||
LDAPFieldName= Nom
|
||||
LDAPFieldNameExample= Exemple : sn
|
||||
LDAPFieldFirstName= Prénom
|
||||
LDAPFieldFirstNameExample= Exemple : givenname
|
||||
LDAPFieldFirstNameExample= Exemple : givenName
|
||||
LDAPFieldMail= Email
|
||||
LDAPFieldMailExample= Exemple : mail
|
||||
LDAPFieldPhone= Téléphone professionnel
|
||||
|
||||
@ -732,14 +732,14 @@ LDAPServerUseTLS=Use TLS
|
||||
LDAPServerUseTLSExample=Your LDAP server use TLS
|
||||
LDAPServerDn=Server DN
|
||||
LDAPAdminDn=Administrator DN
|
||||
LDAPAdminDnExample=Complete DN (ex: cn=adminldap,dc=society,dc=com)
|
||||
LDAPAdminDnExample=Complete DN (ex: cn=admin,dc=example,dc=com)
|
||||
LDAPPassword=Administrator password
|
||||
LDAPUserDn=Users' DN
|
||||
LDAPUserDnExample=Complete DN (ex: ou=users,dc=society,dc=com)
|
||||
LDAPUserDnExample=Complete DN (ex: ou=users,dc=example,dc=com)
|
||||
LDAPGroupDn=Groups' DN
|
||||
LDAPGroupDnExample=Complete DN (ex: ou=groups,dc=society,dc=com)
|
||||
LDAPGroupDnExample=Complete DN (ex: ou=groups,dc=example,dc=com)
|
||||
LDAPServerExample=Server address (ex: localhost, 192.168.0.2, ldaps://ldap.example.com/)
|
||||
LDAPServerDnExample=Complete DN (ex: dc=company,dc=com)
|
||||
LDAPServerDnExample=Complete DN (ex: dc=example,dc=com)
|
||||
LDAPPasswordExample=Admin password
|
||||
LDAPDnSynchroActive=Users and groups synchronization
|
||||
LDAPDnSynchroActiveExample=LDAP to Dolibarr or Dolibarr to LDAP synchronization
|
||||
@ -749,9 +749,9 @@ LDAPDnContactActiveExample=Activated/Unactivated synchronization
|
||||
LDAPDnMemberActive=Members' synchronization
|
||||
LDAPDnMemberActiveExample=Activated/Unactivated synchronization
|
||||
LDAPContactDn=Dolibarr contacts' DN
|
||||
LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=society,dc=com)
|
||||
LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=example,dc=com)
|
||||
LDAPMemberDn=Dolibarr members' DN
|
||||
LDAPMemberDnExample=Complete DN (ex: ou=members,dc=society,dc=com)
|
||||
LDAPMemberDnExample=Complete DN (ex: ou=members,dc=example,dc=com)
|
||||
LDAPMemberObjectClassList=List of objectClass
|
||||
LDAPMemberObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory)
|
||||
LDAPUserObjectClassList=List of objectClass
|
||||
@ -761,7 +761,7 @@ LDAPGroupObjectClassListExample=List of objectClass defining record attributes (
|
||||
LDAPContactObjectClassList=List of objectClass
|
||||
LDAPContactObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory)
|
||||
LDAPMemberTypeDn=Dolibarr member's type DN
|
||||
LDAPMemberTypeDnExample=Complete DN (ex: ou=type_members,dc=society,dc=com)
|
||||
LDAPMemberTypeDnExample=Complete DN (ex: ou=type_members,dc=example,dc=com)
|
||||
LDAPTestConnect=Test LDAP connection
|
||||
LDAPTestSynchroContact=Test contact's synchronization
|
||||
LDAPTestSynchroUser=Test user's synchronization
|
||||
@ -799,7 +799,7 @@ LDAPFieldCommonNameExample=Example : cn
|
||||
LDAPFieldName=Name
|
||||
LDAPFieldNameExample=Example : sn
|
||||
LDAPFieldFirstName=Firstname
|
||||
LDAPFieldFirstNameExample=Example : givenname
|
||||
LDAPFieldFirstNameExample=Example : givenName
|
||||
LDAPFieldMail=Email address
|
||||
LDAPFieldMailExample=Example : mail
|
||||
LDAPFieldPhone=Professional phone number
|
||||
|
||||
@ -1046,7 +1046,7 @@ LDAPFieldCommonNameExample = Example : cn
|
||||
LDAPFieldName = Name
|
||||
LDAPFieldNameExample = Example : sn
|
||||
LDAPFieldFirstName = First name
|
||||
LDAPFieldFirstNameExample = Example : givenname
|
||||
LDAPFieldFirstNameExample = Example : givenName
|
||||
LDAPFieldMail = Email address
|
||||
LDAPFieldMailExample = Example : mail
|
||||
LDAPFieldPhone = Professional phone number
|
||||
|
||||
@ -87,9 +87,6 @@ class User extends CommonObject
|
||||
var $photo;
|
||||
var $lang;
|
||||
|
||||
//! Liste des entrepots auquel a acces l'utilisateur
|
||||
var $entrepots;
|
||||
|
||||
var $rights; // Array of permissions user->rights->permx
|
||||
var $all_permissions_are_loaded; /**< \private all_permissions_are_loaded */
|
||||
private $_tab_loaded=array(); // Array of cache of already loaded permissions
|
||||
|
||||
@ -350,7 +350,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$message.='<div class="error">'.$langs->trans("ErrorLoginAlreadyExists",$edituser->login).'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$message.='<div class="error">'.$edituser->error.'</div>';
|
||||
}
|
||||
}
|
||||
@ -462,6 +462,7 @@ if ($action == 'adduserldap')
|
||||
$selecteduser = $_POST['users'];
|
||||
|
||||
$required_fields = array(
|
||||
$conf->global->LDAP_KEY_USERS,
|
||||
$conf->global->LDAP_FIELD_NAME,
|
||||
$conf->global->LDAP_FIELD_FIRSTNAME,
|
||||
$conf->global->LDAP_FIELD_LOGIN,
|
||||
@ -532,7 +533,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
print "<br>";
|
||||
print "<br>";
|
||||
|
||||
dol_htmloutput_errors($message);
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
if (! empty($conf->ldap->enabled) && (isset($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr'))
|
||||
{
|
||||
@ -557,6 +558,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
|
||||
// Get from LDAP database an array of results
|
||||
$ldapusers = $ldap->getRecords('*', $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, $required_fields, 1);
|
||||
|
||||
if (is_array($ldapusers))
|
||||
{
|
||||
$liste=array();
|
||||
@ -586,27 +588,27 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
}
|
||||
|
||||
// Si la liste des users est rempli, on affiche la liste deroulante
|
||||
if (is_array($liste))
|
||||
print "\n\n<!-- Form liste LDAP debut -->\n";
|
||||
|
||||
print '<form name="add_user_ldap" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table width="100%" class="border"><tr>';
|
||||
print '<td width="160">';
|
||||
print $langs->trans("LDAPUsers");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="action" value="adduserldap">';
|
||||
if (is_array($liste) && count($liste))
|
||||
{
|
||||
print "\n\n<!-- Form liste LDAP debut -->\n";
|
||||
|
||||
print '<form name="add_user_ldap" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table width="100%" class="border"><tr>';
|
||||
print '<td width="160">';
|
||||
print $langs->trans("LDAPUsers");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="action" value="adduserldap">';
|
||||
print $form->selectarray('users', $liste, '', 1);
|
||||
print '</td><td align="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Get').'">';
|
||||
print '</td></tr></table>';
|
||||
print '</form>';
|
||||
|
||||
print "\n<!-- Form liste LDAP fin -->\n\n";
|
||||
print '<br>';
|
||||
}
|
||||
print '</td><td align="center">';
|
||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Get')).'"'.(count($liste)?'':' disabled="disabled"').'>';
|
||||
print '</td></tr></table>';
|
||||
print '</form>';
|
||||
|
||||
print "\n<!-- Form liste LDAP fin -->\n\n";
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST" name="createuser">';
|
||||
|
||||
@ -220,7 +220,6 @@ function getUser($authentication,$id,$ref='',$ref_ext='')
|
||||
'statut' => $user->statut,
|
||||
'photo' => $user->photo,
|
||||
'lang' => $user->lang,
|
||||
'entrepots' => $user->entrepots,
|
||||
//'rights' => $user->rights,
|
||||
'canvas' => $user->canvas
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user