Am using WAMP for my php projects. i have successfully connect with our company Active directory by using LDAP. Getting user details also but i want to get group alone.
我尝试了一些代码,但我无法获得该组。
Here below my code for your reference:-
/ *从表单* /
获取用户名和密码 $un=$_REQUEST['username'];
$ps=$_REQUEST['password'];
/* LDAP connection */
require_once( 'adLDAP / SRC / adLDAP.php');
/* Ldap connection */
try {
$adldap = new adLDAP();
$username=$un;
$password=$ps;
$authUser = $adldap->authenticate($username, $password);
/* succes message */
if ($authUser == true) {
echo "User authenticated successfully";
}
else {
/* Failed Message */
echo "Username '{$username}' login failed: ".$adldap->getLastError();
}
}
catch (adLDAPException $e) {
echo $e;
//exit();
}