From c430b11a685da498fc3671e282fb2af2876d99cc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 20 Dec 2006 20:53:33 +0000 Subject: [PATCH] =?UTF-8?q?Modification=20afin=20de=20r=E9cup=E9rer=20le?= =?UTF-8?q?=20SID=20avec=20Active=20Directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/html.form.class.php | 3 ++- htdocs/lib/ldap.class.php | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 27e566897ca..472fdba7f7a 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -2835,7 +2835,7 @@ class Form function show_ldap_content($result,$level,$count,$var) { - global $bc; + global $bc, $conf; $count++; if ($count > 1000) return -1; // To avoid infinite loop @@ -2866,6 +2866,7 @@ class Form else { print utf8_decode("$val"); + //print $val; //print "
\n"; print ''; } diff --git a/htdocs/lib/ldap.class.php b/htdocs/lib/ldap.class.php index 1a413468cbf..1809b4559e9 100644 --- a/htdocs/lib/ldap.class.php +++ b/htdocs/lib/ldap.class.php @@ -753,18 +753,28 @@ class Ldap for ($i = 0; $i < $info["count"]; $i++) { $recordid=$this->ldap_utf8_decode($info[$i][$useridentifier][0]); - if ($recordid) - { - //print "Found record with key $useridentifier=".$recordid."
\n"; + if ($recordid) + { + //print "Found record with key $useridentifier=".$recordid."
\n"; $userslist[$recordid][$useridentifier]=$recordid; // Add to the array for each attribute in my list for ($j = 0; $j < count($attributeArray); $j++) { //print " Param ".$attributeArray[$j]."=".$info[$i][$attributeArray[$j]][0]."
\n"; - $userslist[$recordid][$attributeArray[$j]] = $this->ldap_utf8_decode($info[$i][$attributeArray[$j]][0]); + + //permet de récupérer le SID avec Active Directory + if ($this->serverType == "activedirectory" && strtolower($attributeArray[$j]) == "objectsid") + { + $objectsid = $this->getObjectSid($recordid); + $userslist[$recordid][$attributeArray[$j]] = $objectsid; + } + else + { + $userslist[$recordid][$attributeArray[$j]] = $this->ldap_utf8_decode($info[$i][$attributeArray[$j]][0]); + } } - } + } } asort($userslist);