2
0
forked from Wavyzz/dolibarr

More fix and enhancements in LDAP module

This commit is contained in:
Laurent Destailleur
2010-01-17 13:51:08 +00:00
parent da41b06636
commit 77a0def86e
2 changed files with 13 additions and 12 deletions

View File

@@ -21,11 +21,11 @@
*/ */
/** /**
\file htdocs/admin/ldap_members.php * \file htdocs/admin/ldap_members.php
\ingroup ldap adherent * \ingroup ldap adherent
\brief Page d'administration/configuration du module Ldap adherent * \brief Page d'administration/configuration du module Ldap adherent
\version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
@@ -285,7 +285,7 @@ print '</tr>';
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldCountry").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_MEMBER_FIELD_COUNTRY.'">'; print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_MEMBER_FIELD_COUNTRY.'">';
print '</td><td>'.$langs->trans("LDAPFieldCountryExample").'</td>'; print '</td><td>&nbsp;</td>';
print '<td align="right">&nbsp;</td>'; print '<td align="right">&nbsp;</td>';
print '</tr>'; print '</tr>';

View File

@@ -645,6 +645,7 @@ class Ldap
$content.="# ldapadd $target -c -v -D ".$this->searchUser." -W -f ldapinput.in\n"; $content.="# ldapadd $target -c -v -D ".$this->searchUser." -W -f ldapinput.in\n";
$content.="# ldapmodify $target -c -v -D ".$this->searchUser." -W -f ldapinput.in\n"; $content.="# ldapmodify $target -c -v -D ".$this->searchUser." -W -f ldapinput.in\n";
$content.="# ldapdelete $target -c -v -D ".$this->searchUser." -W -f ldapinput.in\n"; $content.="# ldapdelete $target -c -v -D ".$this->searchUser." -W -f ldapinput.in\n";
if (in_array('localhost',$this->server)) $content.="# If commands fails to connect, try without -h and -p\n";
$content.="dn: ".$dn."\n"; $content.="dn: ".$dn."\n";
foreach($info as $key => $value) foreach($info as $key => $value)
{ {
@@ -697,7 +698,7 @@ class Ldap
// 2.4 Attribute methods ----------------------------------------------------- // 2.4 Attribute methods -----------------------------------------------------
/** /**
* \brief Add a LDAP attribute in entry * \brief Add a LDAP attribute in entry
* \param dn DN entry key * \param dn DN entry key
@@ -748,7 +749,7 @@ class Ldap
return -1; return -1;
} }
} }
/** /**
* \brief Update a LDAP attribute in entry * \brief Update a LDAP attribute in entry
* \param dn DN entry key * \param dn DN entry key
@@ -799,7 +800,7 @@ class Ldap
return -1; return -1;
} }
} }
/** /**
* \brief Delete a LDAP attribute in entry * \brief Delete a LDAP attribute in entry
* \param dn DN entry key * \param dn DN entry key
@@ -850,12 +851,12 @@ class Ldap
return -1; return -1;
} }
} }
/** /**
* Returns an array containing attributes and values for first record * Returns an array containing attributes and values for first record
*/ */
function getAttribute($dn,$filter) function getAttribute($dn,$filter)
{ {
// Check parameters // Check parameters
if (! $this->connection) if (! $this->connection)
{ {
@@ -867,7 +868,7 @@ class Ldap
$this->error="NotConnected"; $this->error="NotConnected";
return -3; return -3;
} }
$search = ldap_search($this->connection,$dn,$filter); $search = ldap_search($this->connection,$dn,$filter);
// Only one entry should ever be returned // Only one entry should ever be returned