Below is my config. I am connecting through php to AD LDAP server for authentication. the ldap part works like a dream. I used the explode function to drop all the excess baggage with the user to only get me the display name, but I am unable to turn this into an array or some other way to sort the info. I know explode is suppose to make the variable an array, but i think because i'm in a loop, it is erasing the data
<?
/******globals needed for included pages***/
global $displayname;
//$user =& JFactory::getUser();
/*************Ens of globals needed for included pages***/
$dn = "CN=Sales_Managers,OU=CINET,OU=Carousel Everyone,DC=CHARLESTOWN,DC=CAROUSELINDUSTRIES,DC=com";
$attributes = array("displayname","member", "1");
$filter = "(cn=*)";
$ad = ldap_connect("10.0.25.250")
or die("Couldn't connect to AD!");
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ad, LDAP_OPT_SIZELIMIT, 500);
$bd = ldap_bind($ad,"administrator@charlestown.carouselindustries.com","c@r0us3L")
or die("Couldn't bind to AD!");
$result = ldap_search($ad, $dn, $filter, $attributes);
$entries = ldap_get_entries($ad, $result);
// Specify Variable and begin
$a=0;
//Create your loop for $a
do
{
//Grab all the Members array of the user logged in and store
$member=$entries[0]["member"][$a];
//$member=$entries[0]["member"][0];
// Explode $members to grab only the CN name
$member1=explode ("CN=",$member);
$member2=explode (",",$member1[1])
//echo $member . "<br>";
//echo $member1[1] . "<br>";
$members3[$a]=array($members2[0]);
//echo $members3;
echo $member2[0] . "<br>";
print_r ($members3);
echo $a;
$a++;
}
while($a<50);
ldap_unbind($ad);
?>
MCP ACA-I CTP
<?
/******globals needed for included pages***/
global $displayname;
//$user =& JFactory::getUser();
/*************Ens of globals needed for included pages***/
$dn = "CN=Sales_Managers,OU=CINET,OU=Carousel Everyone,DC=CHARLESTOWN,DC=CAROUSELINDUSTRIES,DC=com";
$attributes = array("displayname","member", "1");
$filter = "(cn=*)";
$ad = ldap_connect("10.0.25.250")
or die("Couldn't connect to AD!");
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ad, LDAP_OPT_SIZELIMIT, 500);
$bd = ldap_bind($ad,"administrator@charlestown.carouselindustries.com","c@r0us3L")
or die("Couldn't bind to AD!");
$result = ldap_search($ad, $dn, $filter, $attributes);
$entries = ldap_get_entries($ad, $result);
// Specify Variable and begin
$a=0;
//Create your loop for $a
do
{
//Grab all the Members array of the user logged in and store
$member=$entries[0]["member"][$a];
//$member=$entries[0]["member"][0];
// Explode $members to grab only the CN name
$member1=explode ("CN=",$member);
$member2=explode (",",$member1[1])
//echo $member . "<br>";
//echo $member1[1] . "<br>";
$members3[$a]=array($members2[0]);
//echo $members3;
echo $member2[0] . "<br>";
print_r ($members3);
echo $a;
$a++;
}
while($a<50);
ldap_unbind($ad);
?>
MCP ACA-I CTP